Firstly, you need to already have firmware version RC29 or RC7. To check which version you have go to "Settings" and then "About phone". At the bottom you will see a "Build number" which will include "RC" and then a number. If you have RC30 or RC8 then you need to downgrade. THAT WILL WIPE ALL THE DATA/APPLICATIONS ON YOUR PHONE. Instructions for downgrading are here.
Now that you have RC29/RC7:
- Download 'AndroidMod.zip' from one of the links in JesusFreke's post
- Extract 'recovery_testkeys.img' from that zip and copy it to your SD card.
- Download 'install.zip' which is attached to this post below.
- Extract 'install' from that zip and copy it to your SD card.
- Put the SD card in the phone or disconnect the phone if it is attached by USB.
- Reboot the phone (switch it off and then on again).
- When it has finished booting type the following at the home screen. It will start searching your contacts, but don't worry about that. Also, you won't see any visible sign that the first command worked. Just go ahead and type the second command straight afterwards:
cd sdcard<press enter>
sh install<press enter>
After a moment your phone should reboot itself. To check that the flashing worked, switch off the phone and then hold down the home key while you switch it on again. Keep the home key held down until you see the recovery screen (with the "!" triangle and the picture of the phone). Then press Alt+L on the keyboard and if you see "Using test keys" on the second line of text then the modified recovery image is installed and you can now install a modified firmware.