blue64.net

Living in a 64 bit world

Archive for the ‘Linux’ tag

Easy Upgrades

without comments

Who doesn’t like easy upgrades? Easy upgrades are great when implemented correctly. There are two speciifiic easy upgrades I have been (enjoying) using recently, namely, Wordpress and Ubuntu Server.

Wordpress

This blog has been powered by Wordpress for a long time, and has been upgraded many times along the way.  Download the latest tgz file, unzip it, save your wp-content directory, upgrade your database, and then you are good to go.  Keep in mind this was a very simple procedure, as they call it their “famous 5-minute installation”, which it typically was.

Once upgrading to 1.7, the procedure became as easy as clicking a link on the admin page, and stepping through a wizzard  This blog is now running 1.8, so it has been through several automatic upgrades already, and each one of them has been completely boring, which when talking about upgrading an environment, is a very good thing.  This magic does not only apply to upgrading the entire platform, as you can automatically upgrade your plugins as well.

Ubuntu

Many years ago I set up several Ubuntu Gutsy Gibbon (7.10) Servers in my basement to serve different purposes on my internal network.  These servers have been running without issue for the past 2 years.  They would probably run seamlessly for another 2 years, but unfortunately, I needed to install a new package that didn’t have a deb available for the current version of Ubuntu.  At first I was trying to find ways around this, installing the sources instead, but that didn’t work well for me, as it needed a newer version of a dependent library.   Even considered trying a different software package, but it seemed like all of the software packages I was trying to install, required a newer version of Ubuntu.

What was I left to do?  Either upgrade or rebuild from scratch.  Based on past experiences with other distros, upgrades have been nothing but headaches for me.  Since, I really didn’t want to invest the time to rebuild the server from scratch, decided to try my first Ubuntu upgrade.  Again, based on my past experiences, I assumed I needed to download the media, and then hook up a monitor to the server, and finally go through a set of upgrade screens.

To my delight, after a little bit of research I found that you can do the entire upgrade from the command line, no user interface required, no media download required, no monitor required!  This was too good to be true right?  Well, no.  I ran the do-release-upgrade command, and now my server is running Hardy Heron (8.04). Couldn’t be any easier.  Ubuntu’s upgrade infrastructure is very impressive.

What is the moral of the story?  If you want to build a loyal user community, treat the members of the community well by providing them with an easy upgrade path.

This entry was posted by Steve on Monday, June 15th, 2009 at 5:49 pm and is filed under: , , . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Directory size from the cmd line

without comments

Have you ever wanted to scan recursively through a directory to find out how much space each sub directory was taking up? Well, there is an easy way of doing this on *nix. Just run du “Disk Usage”.

On a Darwin (OS X) based distro you can run:
du -hd1
which tells du to render the results in [h]uman readable format and to traverse a max depth of 1.

To achieve the same results on a Linux based distro you can run
du -h --max-depth=1

For further information (rtfm) refer to the man page.

This entry was posted by Steve on Saturday, February 25th, 2006 at 8:55 pm and is filed under: , , . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

How to SSH without using a Password

without comments

0. The basis of using ssh without typing your password is public key based authentication. You need to generate a pair of public/private keys for this.

1. Firstly, generate your public/private keys using ssh-keygen

% ssh-keygen -t rsa

You must use the -t option to specify that you are producing keys for SSH using RSA. This will generate your id_rsa and id_rsa.pub in the .ssh directory in your home directory.

2. Copy ~/.ssh/id_rsa.pub to the server.

% scp ~/.ssh/id_rsa.pub user@host:.

3. On the server run the following commands:

% cat id_rsa.pub >> ~/.ssh/authorized_keys
% chmod 644 ~/.ssh/authorized_keys

Thats it! Easy as 1,2,3.

Now you should be able connect to the server via ssh without being challenged for a password.

If for some reason, it is not working for you, you may also need to do one of the following things to get it working:

  • Put the public key in .ssh/authorized_keys2
  • Change the permissions of .ssh to 700
  • Change the permissions of .ssh/authorized_keys2 to 640

This entry was posted by Steve on Monday, December 27th, 2004 at 9:33 pm and is filed under: , . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.