Saturday, April 29, 2006

Clear command history in Linux

In bash, to clear the command history, execute the following command

$ rm -rf /.bash_history

To disable history of the commands execute the following command

$ ln -s /dev/null /.bash_history

The above command in essence redirects all history data to /dev/null file, which is a dummy file (NULL file).


Alternatively, you can set the HISTSIZE variable in /etc/profile to 0.

Thursday, April 27, 2006

Hide programs from appearing in Start Panel frequently used program list in Windows XP

If you want to prevent other users from seeing a program that you frequently use you have to prevent it from appearing in start panel's frequently used list. You can do this by this registry trick
type regedit
Exapand HKEY_CLASSES_ROOT folder. Search through folders until you find called Applications. Expand that. Now you can see list of execuatble files of programs. Find the executable file the program you need to hide uses. Expand the key. If program you are trying is an windows application builtin then it won't be listed there. Then you have to right click Application select new key and give the name the name of executable file.

Now right click the executable's folder. Select New>String. Type NoStartPage as the name of string variable. Close the registry editor.Log off , log in. You will never see program listed in frequent program list.

Wednesday, April 26, 2006

Display free space of Hard Drive in Linux

The free command displays how much space is left in your hard drive

Tuesday, April 25, 2006

Alphabetize your start menu using single click

This is a very quick ans simple way to alphabetize start menu.
Click start
move your mouse pointer to All programs
Right click on any folder in program listing and click sort by name.
And you are done.

Find location of your executable commands using which in Linux

which command shows the actual location of your executable programs.
$which bash
This command is similar to type command which produces similar results. This is particularly useful if you are scripting more than one system.

Reach Classic login screen from Welcome screen in Windows XP

You can switch to classic login screen from welcome screen by hitthing Ctrl+Alt+Del two times at the welcome screen. This is particularly useful if your account is hidden or you want to login as administrator which is not shown default in XP welcome screen.

Sunday, April 23, 2006

Prevent non root user from shutting down or restarting a redhat system

In the file /etc/X11/gdm/gdm.conf, change the line that reads:



In the file /etc/inittab, change the line that reads:

ca::ctrlaltdel:/sbin/shutdown -t3 -r now


ca::ctrlaltdel:echo < "message denoting prevention of reboot" >
In the directory /etc/security/console.apps/, delete the files reboot, poweroff, and halt.
Remove the file /usr/bin/poweroff.

Find any file fast in Linux

For finding a particular file you can use locate instead of find. locate is much more faster than find command.

Thursday, April 20, 2006

Disable Unread mail message alert in Welcome Screen in Windows XP

If the unread mail message alert in welocme annoy you this is the way to get rid of this.
Type regedit this brings the registry editor
Now navigate to HKEY_LOCAL_MACHINE\Software\MicrosoftWindows\CurrentVersion\UnreadMail
Make a dword value MessageExpiryDays put its value to 0
This will get rid of message expiry alert.

Make a boot floppy in Linux

You can easily make a bootable linux floopy disk uisng the mkbootdisk command.
As root type
# mkbootdisk --device /dev/fd0
# mkbootdisk --device /dev/fd0 2.4.21-0.13mdk

for knowin the kernel version type
#uname -r

Monday, April 10, 2006

Cal command in Linux

Cal command shows current month in Linux.

$cal -3
shows 3 month calender

$cal 9 1950
shows calender of september 1950

$cal -y
shows calender for full year.

$cal -y 1950
shows calender for year 1950

Another way to reset root password

You can reset the root password on any linux machine using this. For that you need to have a bootable distro like knoppix. Boot from the distro type linux single at boot prompt.
#vi /etc/passwd
Next, press the I key, which places the Vi editor in Insert mode. The first line of the passwd file looks like this
now carefully remove x from the middle donot touch: .After that it should look like
save the file by pressing esc key and typing ZZ
Now the next file open it using
#vi /etc/shadow
The first line is scrambled long characters. Change that to
root:::: ie, root followed by four colons.
Save the file by pressing esc and typing ZZ
Now reboot the computer login as normal user.
and change the root password as you want.

The Command "file"

There is a command very simple one in linux called file
It returns the type of file you specified.
$ file /etc/lilo.conf
/etc/lilo.conf: ASCII text

Easy way to know IP address of websites in Linux

There is a easy to know ipaddress of websites in Linux.
Use the host command
This gives its ip
Remember browsing over ip is faster than using domain names.

Wednesday, April 05, 2006

Running Explorer as a separate process in Windows XP/NT

By default Windows Desktop,explorer,taskbar run as a single process. But you can modify exploere alone to use separate process. This eliminates the need of losing taskbar and desktop during explorer failure. This is how to do it.

  1. Start Regedit
  2. Go to HKEY_CURRENT_USER \ Software \ Microsoft
  3. \ Windows \ CurrentVersion \ Explorer
  4. Create a DWORD value called DesktopProcess
  5. Give it a value of 1

Opening DOS in the directory you want

You can use the Explorer to easily open up a DOS window to a specific directory.

  1. From Explorer Option Menu select File Types
  2. Highlight the object for Folder - NOT File Folder
  3. Click the Edit button
  4. From the 'Edit File Type' panel click the 'New' button
  5. Action is '&Goto DOS Prompt'
  6. Application used is C:\windows\ /k cd %1
  7. Select OK, then Close and Close.
  8. Now from Explorer secondary (right) click the folder you want to go to in DOS
  9. From the menu select 'GotDOS Prompt' (or hit G) and you are in that directory with a DOS windows
  10. For Win NT 4.0 same tip, but substitute cmd.exe for

Removing right click items in Windows

When you right click a big list may pop up as right click. It is annoying especially if you are having a slow computer. This is how to remove it.
First take note of the entry in right click
Then Start>run
Type regedit click OK. This opens the registry editor.
Now Navigate to
Delete the entry you noted as the entry in right click menu.
You may have to reboot for changes to effect.

Tuesday, April 04, 2006

Create a Standby Shortcut Icon

You can create a standby shortcut by using this method.
Right-click an empty area of your desktop
Select New>>Shortcut. This will invoke the Create Shortcut Wizard
In the text box, copy and paste the following code: %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState
Click Next, then rename your shortcut to Standby or whatever youwant
Click Finish.

Quick date and time insert

This is a very handy method of inserting the date and time (according to the Windows calendar) into a text document. I believe this only works in Notepad, not in MS Word or WordPad.
Steps to insert date and time into a Notepad .txt file:
Click Start>> Run
Type: notepad
Push F5 on your keyboard
This simple shortcut can be very useful, especially when making logs or recording any kind of time-sensitive observations.

source:unknown website

Back up in Windows XP Home Edition

Backup on the Home edition of XP is not installed by default.
The backup application on the retail version is located on the XP CD in the Valueadd folder, Some OEM's include backup, but some OEM's elect not to supply the additional folder.
Place the XP CD in the CD drive and select Additional Functions, then browse the CD.
The readme file includes additional information on installing backup.
Once installed, it can be accessed from Start, All Programs, Accessories, System, Backup.