Archive for the ‘server admin’ Category

Configuring SSH

Tuesday, February 17th, 2009

In the last while I have been having to connect to various servers using different accounts with different types of credential requirements. This has lead to some interesting ssh commands such as

ssh -l some_user -i ~/.ssh/

After having a few servers and starting to lose the commands in my history, I figured there must be a better way to keep track of this. Turns out there is (surprise surprise). Inside your home directory, there’s a .ssh folder where you can drop a config file. So, to recreate the above example you would add the following section:

    User some_user
    IdentityFile ~/.sh/

and now I can connect with


There is a whack of documentation about how this can make your life easier. Check out the man pages

man ssh_config

RAM – who knew it could take out a computer?

Tuesday, January 20th, 2009

At one point or another I’m sure most of you have run across bad hardware. This past week I built a computer and was running into an odd situation. After about 2 minutes of running (or less) the system would completely lock up. Rebooting would sometimes make it to the login screen while other times it would just die part way through. Other times, the system wouldn’t event make it past the POST or show the BIOS loading screen.

Fearing a faulty motherboard, or inproper CPU installation, I decided to watch what was happening to the temperature in the BIOS. The temp was staying quite low ( < 30 C for both the CPU and motherboard) but, the system would still lock up… even in the BIOS screen. At this point I had detached everything except for the video card, 1 stick of RAM, and the hard drive and was still getting the same problem.

As a last ditch attempt, I swapped out the final stick of RAM for one of the other ones in the pile of components sitting beside the case. And what do you know, it worked!

Now, the only conclusion I can come to is that the RAM was overheating after about 2 minutes or so of use, and then completely ceasing to function. The bad memory addresses must have been quite close the beginning since even in the BIOS screen (where I’m assuming it doesn’t do all that much with RAM) would lock up.

Has any one else ever experienced something like this? For the record it was a Corsair 2GB stick.

Setting up VPN Connection with gnome Network Manager

Friday, December 5th, 2008

Recently for a project I’ve been working on at the office I had to set up a VPN connection to gain access to the client’s network. They already had vpn set up on their end (thankfully) however, oddly enough I didn’t have a vpn client. I noticed that the gnome Network Manager had a tab for VPN, however the add button was disabled. After a quick google, I found out that you just have to install the packages ‘network-manager-pptp’ and ‘pptp-linux’ to enable it.

sudo apt-get install network-manager-pptp pptp-linux
Network Manager Window

Did the trick and now it was just a matter of entering the server information, username, password. At this point I was still unable to connect to the network. I double and triple checked my info and it was all right. It turned out I had to enable Point to Point Encryption (makes sense) in the advanced section.

Use Point to Point encryption

Now, I have a nice little ‘locked’ icon on my network status bar.

VPN Connection in Network Manager

VPN Connection in Network Manager

Who knew it would be that easy?

Stress Testing Apache Using ab

Sunday, November 30th, 2008

If you’ve ever written a web-app you’ve probably wondered how well it will hold up once the world discovers your awesome service. Will it work if you get dugg? What happens if 200 people all try to access your site at once? This is where benchmarking can provide some useful numbers to give you an idea as to how your server will hold up.


Save Your State with Rsnapshot

Saturday, November 15th, 2008

We all know backups are an essential part of running a server. Being able to restore in the worst case scenario of complete drive corruption (let’s say that your RAID setup failed somehow as well) as quickly as possible is key. Another situation could be one of your clients deleted their incredibly important file 3 days ago, but decided to call you about it now.

Rsnapshot is a series of scripts and commands which can automate the process of backing up your files to a remote location, as well as keeping a incremental copy of any changes. I have it set to keep 7 daily copies, 4 weekly copies (on Saturdays) and 6 monthly copies. Now this may sound like it will use up a great deal of disk space, but rsnapshot makes clever use of hard links, which means it only needs to store copies of files that have changed since the last backup as well as aslight overhead. In my case, this means that for every 100 megs that is backed up, on average only 1 extra meg is stored per copy. So, if I had 1GB of data and 17 old versions (7 days + 4 weeks + 6 months) it would require approximately 1.2GB of physical disk space.