Rigidly defined areas of doubt and uncertainty.

Monday, June 26, 2006

My wheel

After riding the London to Brighton ride last week my already slightly wobbly rear wheel was looking decidedly out of true. Truing a wheel is in my opinion the trickiest maintenance task you can do with a bike. Every one of the 36 spokes needs it tension minutely adjusted until the wheel is straight and round to millimetre accuracy. It took me a while. I don't have a truing stand, so I used the brakes and a piece of card taped to the frame to as a guide. The procedure is pretty simple:
  • Rotate the wheel to a point where it's to far to the left or right, or a too far in or out.
  • Find the mid point of the imperfection and mark it with a small piece of electrical tape attached to the nearest spoke.
  • Adjust the tension of the surrounding spokes on either or both sides of the wheel.
  • Repeat....
So that's what I did for most of sunday morning Rotate, Mark, Adjust, Rotate, Mark, Adjust. It could have been a frustrating tedious task, but it turned out to be surprisingly rewarding. The simple repetition, the intense focus on tiny adjustments, the slowly improving shape of my rear wheel, and little background music on the CD player just absorbed me. It would be nice if I could make every job feel like that.

Friday, June 16, 2006

HOWTO: Add libtidy support to PHP5 in Ubuntu.

Oddly, the default PHP5 package on Ubuntu doesn't have support for the HTML tidying library, libtidy (bug #41690). I followed the instructions in the Debian APT Howto and the Ubuntu Document Storage Facility and replaced the installed package with one I compiled myself from the source. On the off chance someone else finds it useful I've posted the steps I took here:

Create a directory for compiling the source code in.

$ mkdir source
$ mkdir source/php5
$ cd source/php5/

Get the source code package from the source repository. (Note you don't need root privileges for this step as you're not installing anything, just downloading the source to your personal directory).

$ apt-get source php5

Install the other packages needed by the source code to compile.

$ sudo apt-get build-dep php5

In the downloaded source code there is a file php5-5.1.2/debian/rules. Add --with-tidy to the end of the list of options in COMMON_CONFIG. Now compile the modified source.

$ cd php5-5.1.2
$ dpkg-buildpackage -rfakeroot -uc -b

and install the newly created packages.

$ cd ..
$ sudo dpkg -i *.deb

Apache is automatically restarted as part of the build process, and a quick check with phpinfo() shows the new compile date and lists the tidy module.

When the package manager next downloads the latest version of php5, your changes will be overwritten. So be careful what boxes you tick when it asks you what to update. To get the latest version with your changes added to it repeat the above process. Easy enough for a simple one line change, but for bigger changes you should create a diff file, or manage your version in svn.