Thursday, February 21, 2008

Finding Disk space Hogs

I occasionaly have a system go off the deep end eating up all of its space. This can be very difficult to track down. In order to find the offending files/directories goto the root and do
du -k -s * |sort -n
this will list the directories and files in the current directory in asc order so that the last one you see is the largest. Using this it is easy to move down the directory tree and quickly identify the offending files.

Using date in file name (and compressing files)

Yea this is stupid an easy, and also very annoying if you forget how!

    backup=`date +%Y%m%d`
tar czvf SQL-$backup.tar.gz *.sql
That backs up all the current .sql files in a directory into a file with todays date as the name

Deleting Files over Certain Age

The command to delete files over a certain age is deceptivly easy in linux.

   find * -mtime +5 -exec rm {} \;

That finds all files over 5 minutes old in the current directory. This is quite usefull in a backup script run from cron.

Tuesday, February 5, 2008

VMWare Server (Guests very slow)

If you are having trouble with guest machines being slow it could be because they don't have any shared memory setup. Make sure you have /dev/shm setup with tmpfs and at least half your physical memory mounted. Then add tmpDirectory="/dev/shm" to your /etc/vmware/config file and restart vmware. (Full directions at above link).

I've also found that staying close to the recommend memory settings in guests is better than adding more memory.

Friday, February 1, 2008

Enable or Disable the CTRL+ALT+DELETE Sequence

To Enable or Disable the CTRL+ALT+DELETE Sequence

1.Click Start, click Control Panel, and then click User Accounts.
2.Click the Advanced tab.
3.In the Secure logon section, select or clear the Require users to press Ctrl+Alt+Delete check box.