Remove the Vista / Windows 7 Hibernation File

Posted on June 16th, 2009 in Howtos, Windows Admin by Rodney

Windows XP used to allow you to remove hiberfil.sys from within the power management options, under control panel. There’s little point going over how to do this as it’s well known and well documented.

However in Vista (and therefore Windows 7), Microsoft push hibernation and sleep far more aggressively and don’t provide a GUI way of turning it off. This is a real pain in the butt, as the hiberfil.sys is likely to be about the size of your physical memory – in my case 16GB. So I am wasting 16GB of space on my system drive for a feature I will never use. Not cool.

None the less, it is easy to disable and get your disk space back.

Just open the command prompt and enter:
powercfg.exe -h off

That’s it. Hibernate should disappear from the shutdown menu and the disk space should be cleared up straight away.

Passwordless SSH / SCP

Posted on June 16th, 2009 in Howtos, Linux Admin by Rodney

Ok, it’s time to get 1990’s on yo’ ass. I admit this post is old news but sometimes it’s better late than never.

Anyway, on occasion, you may wish for the ability to log into to other Linux boxes or securely copy files between Linux boxes, using SSH, without being prompted for passwords. I.e. scripts. In my case, I wanted to copy the contents of my CentOS web development directory on a VM machine back to the VMWare Server 2 host system, so that I have an extra backup, that’s “not on the same machine” (it is actually a physically different disk and it’s not in the same config so despite sharing hardware, this is sort of true).

Anyway, enough background. Here’s the how.

Step 1. Log into the source computer. I.e. the computer that will run the script.

Step 2. Generate some SSH public keys as follows.
ssh-keygen -t dsa

Step 3. Load the newly created public key to the destination server, as follows.
ssh-copy-id -i ~/.ssh/id_dsa.pub user@destination.servername
Please note: user should be the same on both boxes.

Step 4. Test it out by trying to SSH to the destination server.

Step 5. Test copying your files. Here’s an example:
scp /backup/friday/* root@192.168.1.1:/u02/backup/webdev/friday

That’s it. You should now be able to use SCP to securely copy files between machines with no password prompts.