Applying old updates via yum
When new software packages are released, you don’t want to blindly apply them to all your systems. You should have a test environment, or at least a set of less-critical systems, where you test things first. If you normally stick to a consistent update schedule, such as once a week, you can use the date a package was created to determine whether it should be updated in your production environment. I couldn’t find an way to do this directly through yum, so I created a shell script named update_production to do this. As written, it applies all updates, except for packages released to CentOS or EPEL in the last week. It’s designed to be easy to tweak the repositories you delay updates from or how long the delay is. Ideally this functionality should be available as a plugin to yum, but that looked much more complicated to develop.
Converting software raid
If you accidentally set up a server with the wrong software raid type, as long as you used LVM you can use mirroring to temporarily move the filesystem off the RAID device, recreate the RAID properly, then move the filesystem back onto it. Needless to say if things go wrong during this process you’ll be reinstalling. Below is an example where md1 on sda2 and sdb2 is being converted from RAID0 to RAID1, and an iSCSI volume serves as the temporary storage. In it VG is the volume group name. LV is the only logical volume being moved, and DEVICE is the device linux creates for the iSCSI target. If doing this yourself, you’ll want to frequently check the sanity of what you’re doing with commands like ‘pvs’ and ‘lvs -a -o +devices’. If feasible, you can save a lot of time by turning off swap, removing its logical volume during the conversion, then recreating it afterwards.
Wwwaiter released
I’ve released a small perl script named wwaiter. wwwaiter is a program for visualizing delays in receiving portions of a document from a web server. It won’t be exact due to buffering done by your webserver and operating system, but it should help diagnose slow parts of web applications.
Nethook
I recently had a problem on CentOS 5 where the best solution I could think of required running a command when a network interface is brought up. I’m used to having this functionality as a part of the networking scripts on Debian-derived distributions, but I discovered that Red Hat-derived distributions lack it. I’ve written a small daemon called nethook to provide it. You can find the code and documentation for nethook on github.