Apr. 27th, 2014

import_that: XKCD guy flying with Python (Default)
There's an entertaining anecdote from the early days of the Apple Lisa and Macintosh computers relating to counting lines of code as a measure of productivity. The story involves Bill Atkinson, the creator of Quickdraw and Hypercard. Apple management had asked their programmers to fill out a form each week stating how many lines of code they had written that week:

Bill Atkinson, the author of Quickdraw and the main user interface designer, who was by far the most important Lisa implementor, thought that lines of code was a silly measure of software productivity. He thought his goal was to write as small and fast a program as possible, and that the lines of code metric only encouraged writing sloppy, bloated, broken code.


After completely re-writing Quickdraw's region calculation routines, making them six times faster while saving 2000 lines of code, Bill was asked to fill out the weekly productivity form. So he dutifully wrote "-2000" as the lines of code written.

A few weeks after that, management stopped asking him to fill out the form.

Trying to measure programmer productivity is a hard problem. Any objective metric, like lines of code, number of tickets serviced, bug reports closed, etc., can either be gamed by the programmer or is vulnerable to social manipulation.
import_that: XKCD guy flying with Python (Default)
Sometimes Firefox is too smart for its own good. I have been annoyed now for a very long time, months if not years, that when saving images with Firefox, the default Save As location will unexpectedly change. One moment I'm saving assorted images to directory X, the next the directory has changed to Y.

It turns out that Firefox remembers what Save As location you last used on a per-domain basis. I'm not the only person this feature has annoyed, and Firefox has a hidden preference to turn it off:

  1. Open about:config. (If clicking the link doesn't work, type it in the location bar.)

  2. Firefox may warn you that you're about to destroy the Universe void your warranty. Continue regardless.

  3. Search for browser.download.lastDir.savePerSite, and set it to false.

  4. If that preference doesn't already exist, create it by right-clicking on the blank space, then choosing New > Boolean from the context menu to create it.
import_that: XKCD guy flying with Python (Default)
Backups are important, right? Really important. Computers die. Hard drives die. If you don't have backups, data may be lost for ever.

But making backups is a nuisance, it's a chore, one of those things that you feel virtuous for doing a few times and then get distracted or bored and stop doing. Especially with home systems, it's easy to be slack.

About a week ago, I had a hard drive suddenly die in my home server. And I had no backups. Oops.

Fortunately, I did have RAID.

Although one drive had died, the second hard drive in the RAID array was okay, with a complete copy of all my data, including a working operating system, and my server just kept going. After a couple of days, I got a new hard drive, moved furniture around so I could actually get to the server, replaced the hard drive (and the long-dead DVD drive as well), moved everything back, and ... the damn server wouldn't boot.

Hmmmm.

As far as I am concerned, RAID is fantastic. It's not really practical in a laptop, but in a desktop or server, I couldn't do without it. RAID isn't really designed as a backup system, but it behaves as a poor man's backup. Or perhaps a slack person's backup. It lets you keep going even in the face of an otherwise catastrophic hard drive failure. But it does have one horrible flaw: the boot loader isn't included in the RAIDed partition. So I had a situation like this:

Before the disk died:

    +--------+-----------------------------+
hda |  GRUB  |      RAIDed Partitions      |  <== Boots from this drive.
    +--------+-----------------------------+

    +--------+-----------------------------+
hdb | blank  |      RAIDed Partitions      |
    +--------+-----------------------------+


After the disk was replaced:

    +--------+-----------------------------+
hda | blank  |      RAIDed Partitions      |  <== The former hdb, moved.
    +--------+-----------------------------+

    +--------+-----------------------------+
hdb | blank  |      blank                  |  <== The replacement drive.
    +--------+-----------------------------+


So here I was with two good disks and no working computers (all my desktops mount their home from the server via NFS). Since neither disk had GRUB installed, there was no way to boot from either of them. After making an attempt to fix the situation with the Centos recovery system, I soon decided that this was beyond my level of expertise. (I might administer my own system, but I have no illusions that I'm a system administrator. A man's got to know his limitations.) Fortunately I was able to get one of the sys admins that I work with to re-install GRUB (thanks David!), this time on both hard drives, and configure RAID for the new drive.

The moral of this story:

  • Backups are important.

  • RAID makes a nifty backup for slackers.

  • But when you configure RAID, your Linux installer probably won't install GRUB on both drives. You need to do it yourself.

Profile

import_that: XKCD guy flying with Python (Default)
Steven D'Aprano

May 2015

S M T W T F S
     12
345678 9
10111213141516
17181920212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags