Script to convert Unix time to a human readable date

date -d @$1


adding a 2GB SD card on a WRT54G with openWRT

It's been documented to death, so I'm not gonna bother telling you how exactly I did it. Just make sure you use the optimised mmc.o driver from http://forum.openwrt.org/viewtopic.php?id=9653.

I will however document the errors you can get when there's something wrong with your soldering, as I can attest that, if it doesn't work, it doesn't come from the card or the code, it comes from lousy soldering.

o [FATAL] mmc_card_init: invalid response from card: 03 found, waiting for 01

There is a short between your CLK line (usually GPIO3) and your DI line (usually GPIO2)
This can happen if your connection to the white LED is also touching the amber LED. TRIPLE check that your solder points are clean between the 2 front LEDs

o [WARN] mmc_init: impossible to get card indentification info for reason code: 01
o [FATAL] mmc_init: got an error when trying to get card configuration registers: 02

This one's a lot trickier. Just make sure you have the gpio tool at hand, and watch the amber LED closely. By default, it should be completely off. Then issue "gpio disable 3" and then "gpio enable 3". If you can now see a small residual light on the LED, that didn't exist before, then your LED is screwed and therefore your CLK is screwed.
Always make sure that your "enabled" voltages on GPIO are 0V and stay 0V.

I ended up removing the Amber LED (after a test using GPIO5 confirming that I had indeed an issue with GPIO3) and now everything works like a charm.

Oh, and if you're running in mixed mode (root fs still using the onboard flash), chroot is your friend to install packages on the card with ipkg.