My sysadmin toolbox

115

Author: Adam Williamson

I’m only an amateur systems administrator, but I’m also terribly lazy, so I do have a few good tools in my toolbox.

I work for Mandriva. However, all these tools except Urpmi are available and usable on any distribution. Even Urpmi could potentially work on any distribution, if you set up a correct package source.

An interactive process viewer: htop

My first tool is htop. Most Linux users, when they first wanted to find out what was eating all their CPU time, were taught about top. Top tells you what processes are running and how many resources they’re using … in just about the most unfriendly way possible.

Htop does exactly the same thing as top, but is much less likely to induce migraines. It’s color-coded, which makes it easier to read. It has an easy-to-read summary of CPU, memory, and swap usage displayed as simple bars at the top of the screen. Most usefully, it has the most important keyboard commands permanently listed at the bottom of the screen for easy reference. It also displays the complete command line for running processes, not just the process name.

The nano editor

Despite having used Linux for more than four years, I still have no idea how to use vi or Emacs, because I use GNU nano.

Vi and Emacs may be able to write a novel for you and make your coffee once you learn how to use them, but nano can edit text without requiring a months-long learning process. Like htop, it displays the most important commands right on the screen so you never forget them or have to look them up, and it’s the most straightforward text editor around for simply editing text.

EasyTAG

My next application is not, strictly speaking, a sysadmin tool, but I have a lot of music files sitting around on my computer. EasyTAGis a brilliant little application for managing the metadata that describes a file’s song title, artist, album, and so forth — for MP3, FLAC, Ogg Vorbis, and other digital media files. You can quickly and easily apply any given tag to any number of files, but that’s just the start. EasyTAG’s best features are its smart features. One simple feature is a little button that numbers tracks in a directory in order from 01 upwards. On the more complex side of things, EasyTAG can rename files based on tags, or fill in tags based on file names, through a simple, variable-based filtering module which has built-in templates that cover many common types of filenames.

Filelight

How often have you run out of disk space on a partition and wondered what was eating it all, then been frustrated while trying to come up with a console command that would tell you quickly and easily? Filelight is one of the few GUI applications that covers a sysadmin task better than a CLI command.

Filelight gives you a graphical display of your filesystem as a series of concentric segmented rings organized by disk space used. It starts off with an overview of the entire filesystem, with directories that use more space showing up as larger chunks of pie. The directory layers are arranged outwards in concentric circles. You can easily zoom in at any level by clicking, making it a few seconds’ work to identify the culprit in even the largest filesystem. Baobab is a similar utility, but I find Filelight’s display method lets you find large files much faster than Baobab’s.

Fanout

Fanout is a simple utility that does a simple but useful thing: it connects to any number of machines via SSH and executes the same command on all of them. It’s as simple as fanout "machine1machine2machine3" "command".

GNOME Password Manager (GPass)

GPass is not strictly a sysadmin utility, but it’s an essential tool for any security-minded Internet user. If you’re anything like I used to be, you have a few strong passwords you use for your user, the root account, and “important” Web sites, and one or two simple, weak passwords you use on all the other places that require passwords.

Even some “unimportant” accounts could cause you inconvenience if they were compromised, so it would be best to have strong passwords everywhere. Most people can’t remember 212-character, non-dictionary passwords — but GPass can!

GPass is a password management application that stores unlimited username and password combinations in a securely encrypted database which is protected by a single password or passphrase.

By restricting access to the database file (you can even store it on a USB key and keep it with you at all times), you can get all the security benefits of multiple strong passwords with none of the inconvenience of trying to remember them.

Out of all the many password management applications available, I like GPass because it’s convenient, it can generate random passwords easily, and it has many sensible shortcuts. For instance, you can use Shift-Ctrl-i to copy the username and Shift-Ctrl-c to copy the password from any username / password pair.

Urpmi’s parallel mode

Urpmi is Mandriva’s package management tool, and it has all the normal features of tools like Debian’s apt-get. It has its own special party trick too. Though using it is a bit more complicated than the other tools on my list, it’s worth the investment.

On a master machine you can define a group of slave machines in a configuration file, and then you can use the --parallel parameter to perform any Urpmi operation on all the machines in the group. Any packages that need to be installed will not be retrieved separately on each machine, but retrieved just once on the master machine and then distributed to the slave machines prior to installation. I use urpmi --parallel to keep my three machines updated daily with the latest Mandriva development packages. It’s much faster than updating each machine separately, and it saves on bandwidth by downloading the packages only once.

Adam Williamson is the editor of the Mandriva Community newsletter and the official Mandriva Club Forum Monkey, a job title he demanded as a condition of his employment.

Let us know about your most valuable utilities (there need not be 10 of them), and if we publish your work, we’ll pay you $100.