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
Start>run
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
$free

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
eg
$which bash
/bin/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:

SystemMenu=true

to

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

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

to

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.
Start>run
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
eg:
# mkbootdisk --device /dev/fd0 2.4.21-0.13mdk

for knowin the kernel version type
#uname -r