Monthly Archives: March 2008

Introduction to Linux clustering

I’ve released a new article – Introduction to Linux Clustering. This one has been cooking for a few months now, so I finally finished it off seeing that I’ve got 4 days off thanks to Easter.

Easter is great – one of the few good things the church has given atheists – time off AND chocolate. ;-)

Anyway, you can download the article at: introduction_linux_clustering_1.1.

Big thanks to my friend Mark Rais for reviewing it for me and helping me make improvements. If there’s any mistakes left in it, I’ll blame him. ;-)

PHP Timezone Problems (for NZ)

In 2007, the NZ government changed daylight savings, by extending it a couple of weeks. Whilst the Linux vendors pushed out updates for tzdata which contains the data needed for your system clock to function, PHP has it’s own timezone database which is causing problems for some systems, where the clock in PHP is being calculated using the old daylight savings time.

Run the following to check if PHP on your server has been updated to the correct timezone:

$ date
$ php -r "echo strftime('%Y-%m-%d %H:%M:%S');";

If the times match, no problem. If they DON’T it means that all dates are being calculated using the old daylight savings time, so from the 16th March until the 6th April, all time shown in PHP applications will be 1 hour behind.

It’s a pity that not all the Linux vendors realised this and released fixes, but I had never even considered that PHP would use a separate timezone database, so it’s quite possible neither did they.

I have tested on the following systems:

  • CentOS 4 – PHP 4.3.9 (no problem)
  • CentOS 5 – PHP 5.1.6 (wrong time)

It looks like PHP 4 doesn’t suffer from the problem, possibly it uses the system timezone data instead, but I wasn’t able to find a lot of information about this.

Fortunately, you can fix the timezone data without rebuilding PHP. The timezone data can be installed as a separate module (timezonedb), which is used instead of the compiled in timezone data.

Wearable PC

I just ordered some parts, to start building a wearable computer! I’ll be using the gumstix LCD kit for the base of it.

The base unit will have touch screen, ethernet, microSD and 3 serial interfaces. From there, I can then hookup anything else I want (wifi, bluetooth, GSM modem, GPS) using the host USB port on the gumstix. :-)

I will have to research options for battery power…. need a Li-PO battery supply with 5V output… since most batteries seem to be 3.7V, I will need a DC->DC transformer to step up the voltage to 5V. Also want to be able to trickle-charge it via USB.

To run USB devices from the gumstix, I will need 5V, and up to 500mA for each USB device, so need something with a good amount of amperage if I want to run a number of devices.

It’ll be a good project to give me a chance to improve my (currently bad) knowledge of C programming as I will need to write custom applications for it. :-)

I’ll post more information once the kit arrives and I start playing with it… Will probably take a number of months to build, since I am really busy these days, but will be worth it.

Uses for the wearable PC:

  • Access to email 24/7
  • Link into GPS maps
  • Typical PDA functions (note taking, calendar, etc)
  • Mobile VoIP
  • Music/video player
  • Because it’s a cool project and has geek cred. ;-)