One Line Guitar Tuner

Every now and then I come across something which makes me marvel at the flexibility of Linux. This is one of these things.

I play guitar, and I’d previously written a small script to act as a guitar tuner. I generated some .ogg files of the correct pitch and then wrote a script to loop through them in sequence. “Pretty good”, I thought, “Clever Me.”

Then a few days ago I came across this little gem of a script.

for n in E2 A2 D3 G3 B3 E4;do play -n synth 4 pluck $n repeat 2;done

That’s it. Sheer brilliance. Of course you’ll need to install the sox package first.

Linux Memory Usage Summary Script

I was having trouble with a webserver this week, which I’d just set up for a client. When it went live, it seemed OK initially, but when we left it overnight it curled up its toes and died. It was so dead that I couldn’t even ssh in to reboot it, so we had to do a remote reboot. Crunch.

Anyway, on getting it back up, I poked around in the logs and found that it was running out of memory, which it really shouldn’t do given that it was a fairly low load on the webserver, and only apache, mysql and php were running on it. I looked around the Interwebs and found an excellent resource called Troubleshooting Memory Usage, which gave me some pointers about how to rein in apache and stop it from eating up memory so quickly. Thanks!

Anyway on the page was a script for summarising memory usage, which I thought was a good idea, so i grabbed that one and adapted it to my own purposes. I thought I’d make the results available here, so feel free to grab it and adapt it to your own needs.

Read more

Ubuntu Touchpad toggle tweak

I’ve been getting irritated with the touchpad on this new Dell Vostro 1400. I type for a while, and then my palm touches the touchpad, sending the pointer skimming into the line above, or clicking on buttons I don’t want to click on. So, I looked around and figured out a solution. Over the past two years, I’ve had to update this post for every single new version of Ubuntu, which has been a pain, so look for the heading below which corresponds to your version of Ubuntu.

Ubuntu Hardy 8.04

First of all, you need to edit your /etc/xorg.conf file, for which you’ll need root privileges – use sudo.You just need to add one line in the input device section, which is the one in bold below. (Intrepid 8.10, see below)

Section "InputDevice"
        Identifier      "Synaptics Touchpad"
        Driver          "synaptics"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "auto-dev"
        Option          "HorizEdgeScroll"       "0"
        Option          "SHMConfig"
EndSection

Read more