Changing Ubuntu startup splash screen

Tip of the day: To change the boot-up splash screen on Ubuntu (ex., the Ubuntu, kubuntu, xubuntu, etc. logos that are displayed before gdm/kdm fire up), `sudo apt-get install startupmanager`, then launch it from “System -> Administration > StartUp Manager”. Select the “appearance” tab, and choose the desired splash screen.

The StartUp Manager application also lets you tweak grub settings, in case you don’t care to edit the files manually.

Hiding an idle mouse cursor on Ubuntu

One of the obscure features of OS X that I love is that the mouse cursor hides itself when idle. By doing so, it stays out of the way when reading on-screen. When I made the shift to using Ubuntu at work, the non-hiding cursor was one of those little details that annoyed me. Of course, like most things on linux, someone else had the same opinion and has solved the problem already. The solution is a tool called unclutter (easily installable with a `sudo apt-get install unclutter`.)

Unclutter takes a few optional parameters. I like: `unclutter -idle 1`, which hides the cursor after one second of inactivity. The hidden cursor not eliminates the potential annoyance while reading on-screen, but may also serve to remind the user that keyboard shortcuts are faster anyway ;-)

For more, see: unclutter: hide the mouse cursor after a period of inactivity

Recovering deleted images from a Nokia N90 (Symbian OS)

Over the holidays we had an accidental deletion of every image on one of our phones (a Nokia N90, Symbian OS device.) Mild panic was quickly replaced with a gentle pondering on the difference between what a normal person would do in this situation vs. what a geek would do. The geek process goes something like this:

Step 1: Get the memory card out of the phone as quickly as possible

Either shut the phone down and pull the card, or use the super-secret combo hidden within the profile-switching shortcut to have the phone un-mount the card.

Step 2: Obtain a USB memory card reader

I’ve needed a reason to buy one of these for a long time. Good thing I had a gift card left from the holidays. I went with a Dynex gazillion-to-one card reader, not for it’s technical superiority, but because it was the only thing the shop nearby had.

Step 3: Stick the memory card into the reader, and plug the reader into your Linux box

Mine happens to run Ubuntu at the moment, but the results will likely be similar on other distros.

Step 4: sudo apt-get install testdisk

Testdisk “was primarily designed to help recover lost data storage partitions…” and includes a utility called “PhotoRec“, which is what you want.

Step 5: Run photorec

PhotoRec is a data recovery tool designed specifically for recovering files from digital camera media. It supports a number of file-system formats, including the FAT format that Symbian OS uses on it’s memory cards. PhotoRec is a text-based, terminal application, but it does the job perfectly.

Select the mounted memory card from the list of drives (which should be easy to spot given how small memory cards are relative to modern hard drives), and send it scanning. PhotoRec can be told to look for specific file types (you want JPG’s, in this case), but by default it will look for just about any media file format that you’re likely to have on your phone. Files will be recovered and written to a local directory.

Step 6: Sigh in relief when you see your beloved cat pictures returned to you

PhotoRec isn’t going to restore the images to the memory card’s file system such that the phone can see them again, but you’ll have the pictures on your Linux box now, and can copy them back over if you choose to. The naming scheme will be different, but that’s an acceptable compromise.

The Adruino Diecimila board supposedly h…

The Adruino Diecimila board supposedly has circuit protection to ensure that one doesn’t fry their computer accidentally, but just in case, I figured it might be better to use a spare machine for my Arduino hacking. I happened to have an older PowerBook that fits the bill perfectly; however, I run Ubuntu PPC on it, and it didn’t take long for me to realize that neither the Arduino OS X or Linux builds would work on it.

Not to be discouraged, some quick googling led to the instructions on patching up the OS X release for Ubuntu PPC. However, a little more googling dug up something much more interesting: Arduino from the Command Line [Update 10/08/17: Build Process.]

It’s not obvious while using the Arduino/Wiring IDE, but you’re really just writing C without includes and prototypes. When you save, the IDE patches up your code, then passes it to gcc-avr for compiling and avrdude for flashing. Therefore, if you’re so inclined (or happen to prefer vi and be on a non-supported platform), one can simply add the extra code manually and build/flash yourself.

The docs on this (linked above) tell the story, but they’re a little out of date (since they reference release 0007.) You still need to “sudo apt-get install gcc-avr avr-libc avrdude”, but after that, download the “Arduino 0009 installer for Linux” [the newest at the time of writing] instead, uncompress it, and look in “lib/targets/arduino/” for the Makefile and libraries you need. Read the comments in the Makefile — they explain it all quite well.

Once you stash the libraries somewhere handy, starting a new project goes like this:

  1. Create a new directory to work in
  2. Write your Arduino code as a *.cpp instead of a *.pde file
  3. Copy and modify the Makefile for your project
  4. Run ‘make’ to compile it
  5. Run ‘make upload’ to flash your code to the Arduino

It’s not as simple as the IDE, but it works, it lets you use any text editor you want, and gets you a little closer to whats going on behind the scenes.

For those curious, I’ve included an example of how the supplied “Blink” sample looks once modified for command-line building. It’s a bit longer… but still manageable:

 * Blink (modified for command-line building)
 * The basic Arduino example.  Turns on an LED on for one second,
 * then off for one second, and so on...  We use pin 13 because,
 * depending on your Arduino board, it has either a built-in LED
 * or a built-in resistor so that you need only an LED.

#include <WProgram.h>

void setup();
void loop();
int main();

int ledPin = 13;                // LED connected to digital pin 13

void setup()                    // run once, when the sketch starts
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output

void loop()                     // run over and over again
  digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(1000);                  // waits for a second
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(1000);                  // waits for a second

int main() {

  for (;;)
  return 0;

Manually fixing Ubuntu Edgy timezone file (my laptop didn’t update)

Even though most articles indicate that Ubuntu Edgy should have automatically patched itself with updated timezone files, my laptop (and apparently a few others didn’t get the update either.) With some googling, I found plenty of suggestions (including “sorry, mine worked”, and “just manually set your clock”), but none got to the core issue, which is that the timezone files themselves were wrong.

No doubt, by now, you know whether your machine updated correctly; but if it didn’t, you can verify your timezone files with this:

`zdump -v /etc/localtime | grep 2007`

If you see “April 1” in there, the machine has old files (as mine did.)

The solution (for me), was to manually rebuild the timezone files (since the system thought it was fully patched.) Step 1: Go here: and download the latest file (for me, it was

Put the file somewhere (like /tmp/), ‘cd’ there, and un-tar it all. ‘cd’ into the uncompressed files until you find a file called ‘northamerica’. Now compile the timezone file like this:

`sudo zic northamerica`

Remove your previous file:

`sudo rm /etc/localtime`

And sym-link to the new one:

`sudo ln -sf /usr/share/zoneinfo/CST6CDT /etc/localtime` (substituting CST6CDT for your timezone.)

Now verify with:

`zdump -v /etc/localtime | grep 2007`

It should now read “Mar 11” and “Nov 4” instead of “April 1” and “Oct 28”, and the machine should fix it’s clock shortly (it just took a few minutes for mine to correct itself.)

I have no idea what the long-term effects may be of having manually fixed this (as in, what happens when I update to Feisty Fawn), but for now, all is good with the system clock.