Updating grub and automagic in Ubuntu

Working with grub used to be somewhat of a pain. The biggest complaint being that if you, say, disabled apic using the noapic boot option, and updated the kernel without updating the grub file, you could be stuck with a kernel panic. This was happening to me tonight when working with jeos and VirtualBox.

Automagic has made this a whole lot easier. There are automagic options in /boot/grub/menu.lst that are used when any kernel is installed into the system.

Fixing a squeaky floor

Our floor used to squeak very badly in several spots. Fixing a squeaky floor can be a challenge.

Floors squeak for a variety of reasons. The most common is the nails that hold the sub-floor down coming loose from the joist and squeaking.

Fixing them means getting under the house, unless we're talking about a floor that isn't a ground floor, or getting under the house isn't an option. If that's the case, good luck.

The kit that's sold in stores that uses break away screws through the carpet did not work for me. It made the problem worse in our situation.

Curly brace expansion in the Bash shell

A very handy trick using the Bash shell in Linux involves the curly braces. The Bash manual at gnu.org defines brace expansion as "a mechanism by which arbitrary strings may be generated."

I use this mostly when working with files, especially making back ups of configuration files. For example, to copy /etc/X11/xorg.conf to /etc/X11/xorg.conf.backup, you could do this:

$ cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

or you could use brace expansion

A little busy today

load average: 139.66, 112.91, 59.18

But not too busy to post this. The machine is still responding great.

top - 10:27:11 up 2 days, 3:02, 3 users, load average: 139.66, 112.91, 59.18
Tasks: 461 total, 6 running, 454 sleeping, 0 stopped, 1 zombie
Cpu(s): 8.4%us, 10.1%sy, 44.1%ni, 36.6%id, 0.7%wa, 0.1%hi, 0.0%si, 0.0%st
Mem: 8077204k total, 7940096k used, 137108k free, 150324k buffers
Swap: 1911608k total, 139204k used, 1772404k free, 3818652k cached

Gmail as the KDE default email client

I just got GMail working as the default email client for KDE. To do this, go to KDE Menu -> Computer -> System Settings and click on Default Applications.

There are plenty of notes on getting this working out there, but getting the subject and body working can be tricky. Select the radio button next to Use a different email client: and enter the following:

/opt/google/chrome/chrome https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=%t&su=%s&%u

replacing /opt/google/chrome/chrome with the command for your browser.

Get unique lines in file using bash

I had to take a closer look at a distributed attack on one of our web servers today. The attack only involved around 50 hosts which seemed to be testing our URL parameters for injection susceptibility. Coldfusion has some protection against SQL injection, and we take extra steps, as every programmer should, to guard against it.

After identifying the attack vector, I was able to grep the log file for the signature of the attack which was present in the URL information.