Knoppix recovery for Mac Mini crash

We had a hard crash of our Mac Mini the other day. It wouldn't boot after a hard power reset. Don't ask -- I'm trying to protect the innocent ;-)

My wife used to work at Apple, but I'm not a Mac man, so we brought it in to the "Genius" counter at a local Apple store. The guy was pretty helpful but he said there was no hope to recover the disk. However, I've been using computers long enough to know that this was some kind of file system error that was largely recoverable, and we had some data that wasn't yet backed up.


Odd Chromium behavior on image flyovers

I was doing some testing of the in Google Chrome (Chromium). I sometimes like to use a different browser just to see how things look.

Anyway, I noticed that "menu flyover images" weren't changing in Chrome. But the text (Description and Time) were changing. Odd thing was that ONE of the images changed, but the others didn't.

Things worked OK in Firefox 3.x, IE 7, and Opera 9.x, so this is likely a Chrome bug. I think Chrome has an optimized JavaScript interpreter, so that may be a source of the quirkiness.


How to set up PuTTY SSH keys

1. Start up PuTTYgen.exe. The defaults of SSH-2 RSA and 1024 bit key should be fine.

2. Click Generate to make the key (moving mouse randomly over blank area).

3. Fill in the comment (me at Enter a passphrase. A passphrase is more secure, but you'll be prompted for it on every access (unless you use keychain or others).

4. Use PuTTYGen's button to save the public key on your PC (ex. c:\putty\keys\me-at-example.txt).

5. Use button to save the private key. You must use .ppk extension (ex. c:\putty\keys\me-at-example.ppk).


IeUnit Quick Start

Wikipedia currently lists the following "Internet test frameworks" :

* HtmlUnit
* HttpUnit
* IeUnit
* Canoo WebTest
* Selenium

So IeUnit has made what could be called an "exclusive" list of web test frameworks. Of course there are plenty of other "Internet test frameworks" including Watir, Sahi, WatiN and even JsUnit and QUnit (for jQuery).


Dual-boot Ubuntu Linux on a Windows laptop

I wanted to turn an old laptop from a Windows XP system to one that dual-booted Ubuntu. To get this to work, I first had to resize my Windows partition.

I started out with Windows default disk defragmenter (Accessories => System Tools => Disk Defragmenter). I ran it a few times, but it always left files at the "high end" of the partition so I couldn't downsize the partition.

I then tried Defraggler ( This maybe is a bit better at defragmenting, but still left files at the high-end of the partition.


Git cheat sheet

My own personal cheat sheet of useful Git commands.


git diff --stat --staged (staged in 1.6+, cached in older)

Differences between HEAD and index (i.e., shows changes that have been staged)

git diff -U1 --stat

Reduces the context lines around differences to one line for shorter display. Puts summary (stat) at start of diff.


"Local branches" and BitKeeper

As far as I know, BitKeeper does not seem to support the notion of "local" (intra-repository) branches.

Git supports these, and I've found them very useful. With Git, you can easily have debug/test branches without the overhead or config issues of an entirely different repo. I've even used one branch per bug so I can have several things in the air before merging them into the master branch.

The only way I can see to do this in BitKeeper is to have separate repos, which wastes disk space and adds the trouble of creating and managing separate directory trees in the file system.


Handling BitKeeper merge conflicts

I'm more familiar with Git and its merge process, but I also use BitKeeper and sometimes run into merge conflicts. Here's some info on how to handle them.

Unlike Git, BitKeeper doesn't have the notion of "local" branches, so all merges are from push/pull operations. BitKeeper has a merge command, but it's for merging single files, rather than merging one local branch into another.


Quick and dirty PHP debugging

Xdebug ( is probably one of the best ways to debug PHP code. But Xdebug can be difficult to setup, depending on the environment.

If you want an one-liner to see defined variables, try this :

print print_r(array_keys(get_defined_vars()), 1);

If you only want to see a select list of PHP variables, try this which was lifted from the notes at

    function getDefinedVars($varList, $excludeList) {
        $temp1 = array_values(array_diff(array_keys($varList), $excludeList));


Subscribe to RSS