img_18777 crw_10215 crw_9450.jpg img_13228 img_15769 Hursley Model Railway img_16043 img_18383 p1040759 img_1541 img_15606 crw_9593.jpg img_19689 img_12843 img_1089 img_17226 img_15852 img_16489 RiversOfSound img_1457

@antonpiatek on twitter

Posting tweet...

Powered by Twitter Tools

It feels like a new house!

We had some trees removed yesterday, mostly because of their proximity to the house, but they did block a lot of light. Some of the before and after shots really give a striking contrast of how the trees change the property.

We need some time to get used to the new look, but will probably end up planting something, probably some trees (oh, the irony of getting rid of trees to plant some), though certainly nothing like the ones we had. Something smaller and more decorative maybe, if it doesn’t block too much light. Of course keeping it pruned is probably the most important thing to stop them overgrowing like the old ones.

 

P1010144 P1010151

P1010143 P1010152

 

P1010145 P1010150

 

There are also a few shots partway through:

 

P1010147 P1010146

P1010149 P1010148

Reduce wordpress comment spam with .htaccess rules

I get quite a lot of spam comments on my wordpress blog, and even with things like akismet to try and detect and block spam I still get a lot. Some people have suggested using a mod_rewrite rule in apache to detect very obvious attempts to post unsolicited comments. The basic idea is that if anyone tries to submit a comment and they have not set a referrer in the HTTP headers of your site, then they probably aren’t doing anything near normal browsing. Also, a blank user agent is also only common if you have gone to the effort of not setting one.

Based on the mod_rewrite hack from http://www.wprecipes.com/reduce-spam-on-your-wordpress-blog-by-using-htaccess, I have my own slightly different version

<IfModule mod_rewrite.c>
  RewriteEngine On

  RewriteCond %{REQUEST_METHOD} POST
  RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
  RewriteCond %{HTTP_REFERER} !.*YOURSITE\.COM.* [OR]
  RewriteCond %{HTTP_USER_AGENT} ^$
  RewriteRule .* / [R=301,L]
</IfModule>

This basically rewrites the url back to / (edit the last line if you want to set it to somewhere else). The rule only works if the request is a POST request and for the wp-comments-post.php file, and either the referrer url was not your site or the user agent is empty. I can’t think of anything that sends blank user agents, so this should be pretty safe. All browsers should also send the referrer url, so again this should be pretty safe.

Don’t forget to change “YOURSITE\.COM” to your domain name

Guest presenting on the Ubuntu UK PodCast

I was a guest presenter on this weeks Ubuntu UK PodCast. I talked about Southackton, and IBM’s use of Ubuntu on the desktop.
Listen to the podcast at
http://t.co/vVL5M3YJ

Rooting and upgrading a HTC Desire to android 2.3 (CyanogenMod 7)

I started writing this as I was actually doing this to my phone. The problem I found with most existing instructions is they seem to slightly contradict other instructions you find. Many have steps which are not well laid out and often don’t give a reason for doing things which can be a bit annoying. Often the instructions are from ancient Android OS version days, so steps like installing hboot versions, and recovery roms are now all covered with the one unrevoked3 step, but not all instructions are clear that this is the case.

These instructions are heavily based on the instructions from CyanogenMod 7 for HTC Desire: http://wiki.cyanogenmod.com/wiki/HTC_Desire_(GSM):_Full_Update_Guide but also some other sites I found along the way, often for other phone models so only parts apply. I also had some direct feedback from various IRC channels.

The following links were useful to me, so I mention in case you want to read some more:
http://forum.xda-developers.com/forumdisplay.php?f=628
http://forum.xda-developers.com/showthread.php?s=ea2964d1e59f99d394ca758037ee6bc1&t=696189
http://forum.xda-developers.com/showthread.php?t=788044

1. Preparations

The first thing that may be of use, especially if you are checking other instructions, is to grab a few version numbers of the rom levels on your phone:

power off, hold vol down and power – get hboot version page, includes radio version
mine was hboot 0.93.0001
and my radio version is 5.11.05.27
hboot version shouln’t matter for unrevoked3 though unless on very new phone like EVO4
You can also check the radio version from “Settings->About Phone->Software information”.
You should see “Basebane version”, mine is 32.49.00.32U_5.11.05.27
The last part of that, after the _, is the radio rom version

2. Rooting your phone

Go to http://unrevoked.com/recovery/ and download the rooting program.

This uses an exploit in the phone to install a new recovery rom, the “clockwork recovery” rom, which can then be used to do complete phone backups and install new roms.

You will need the “usb debugging” enabled on the phone, and the phone connected only to charge, not as disk access or tethering

It is straight forward on linux (run the downloaded file, and follow the instructions on screen), but I believe on windows there are soe extra drivers to install so check the unrevoked site for more instructions if you are on windows. .

I tried unrevoked3 with only 14mb available, and got “internal error: installing package failed”. Getting the space up to 25mb and it worked fine (I just uninstalled the gmail updates)

3. Backup your current OS (nandroid backup)

Reboot into the hboot screen as in step 1 for version numbers, then use use vol up/down to select “recovery”. The power button acts as the “ok” button here.

This boots the clockwork recovery rom which was installed when you ran unrevoked.

Then use trackball to select backup.

This does a complete backup to SD, also referrred to as a “nandroid backup” which should include the system OS, all installed apps and user data.
You probably need as much space as your phone has on internal memory (512mb for desire).
This will take a little while, so do it on power or a full battery.

The backup should appear in your sdcard in /sdcard/clokworkmod/backups/

Then press back and select the reboot option.

4. Backup apps and app data for migration

Why do you need this if you just did a complete backup? Well, when you install the new OS you will be erasing everything from the internal memory, so this backs up your apps so you can install them again, and also the app-data so you don’t lose it all.

I used the free version of “Titanium Backup” but “Astro File manager” has been suggested too, and it looks like “Gemini App manager” can do this as well.
It is pretty straightforward, but see http://www.incredibleforum.com/forum/htc-incredible-hacks/7893-titanium-backup-how.html if you want specific steps.

5. Backup your whole SD card

Ok, maybe I am paranoid, but at this point I plugged in my phone via USB and zipped up the entire SD card onto my computer. This way I have a backup of my SD card, which includes all the above backups, so if anything goes badly wrong I still have the restore files

I had to disable the usb debug mode to get the disk to mount

6. Update radio rom

Before applying the cyanogenmod, or any other, you may need to update your radio rom version.

According to http://wiki.cyanogenmod.com/wiki/HTC_Desire_(GSM):_Full_Update_Guide the version of mine is good enough for CM7, so I didn’t update it.

7. Now install new rom

Installing the mod is straightfowrard (there are instructions in the first link of this page).

Basically download the mod, and google apps if you want it, and drop the zip files in the root folder of the SD card.
Then use the clockwork recovery mod as we did earlier and select “Wipe data/factory reset” to clear the flash (I have seen reports that this may not be required, but as it is such a large change of version numbers, I decided to do a full wipe), then “Wipe cache partition” to clear that too.

Then simply select “install zip from SD card” and install the new mod, and google apps if you wanted it.

Alternatively, you can use Rom Manager to do it as an app.

After the reboot, use your chosen backup program to then restore all your apps and data, however read the next step first as you may find space to still be an issue.

8. Space savings with CyanogenMod 7

After rebooting into the new OS, I had over 100mb free for base image (out of 148mb capacity reported by OS). 83mb free after installing a similar set of google apps from the market.

After then restoring all my backed up apps and data I found out I only had 25mb free, which is only about 10mb better than on the original android 2.2 from HTC.

You will probably find you have to install an app to force apps to install on SD card by default. Note that CyanogenMod 7 has an option to force all apps there by default, but it will put apps with widgets on there, which breaks the widgets.

There is a way to get even more space for apps with CM7:

All you have to do is add an ext4 partition to your SD card and then install “simple2ext” from the android market.

This is a feature only available on the CyanogenMod 7 roms, and allows you to move all apps, app data, and caches to SD card. There is a performance hit for this, but it seems worth it.

I used a microSD adapter to plug in my SD card into my PC and used “gparted” on Ubuntu (a Live CD will do fine) to shrink the current partition and add an ext4 one
without losing data (but you backed up above in any case, right?)

I created a 1GB partition and after installing simple2ext, I set it to move my apps and dalvik cache to the ext4 partition.

After a reboot I now have loads of space for apps to install to, about 80mb free despite installing another dozen apps without bothering to move them to SD.

To help you decide what to move, the Dalvik cache appears to be a binary cache for the Android implementation of Java. There is a performance hit to moving anything to SD unless you have quite a fast card (http://forum.xda-developers.com/showthread.php?t=1175707 recommends minimum class 4, better yet a class 6). Mine is class 2, and I found that moving the application data seems to
cause the phone to be very noticably slower, so it is probably best avoided unless you have a fast SD card.

Moving the Davlik cache did slow things down a little, but mostly only the boot time and first launch of an app. I decided that for an extra 80mb of space that I could live with that (I have also just ordered a new class 6 SD card, so that should help).

Conclusions

Rooting, and modding was actually incredibly simple. It sounds so scary, but I think it is actually very, very hard to mess it up to a point where you cannot just overwrite with a new mod (or your backup) and start again. Once you get to the nandoid backup point you have a very good recovery strategy!

I have loads more space, which is good, because counting the bytes is annoying. I now don’t have to worry about if I have space to install something.

You do lose the HTC apps and widgets, but I found I could live without them fairly easily (I haven’t used peep since I discovered TweetDeck, and that was my most used HTC app). If you miss the clock widget, search for “sense analog glass clock” on the android market, that is a nice replacement for me. “glass widgets” is a replacement calendar widget, which I now actually prefer.

The battery manager in the new rom is awesome compared to the old 2.2 one. It really shows where the battery is going. I think I possibly get longer battery life with this rom too.

I much prefer the android 2.3 native keyboard to the HTC sense one.

There are some niggles – I have a few gui glitches which cause me to reboot the phone every few weeks, but I am hoping they will be fixed in the next stable build (I have not been brave enough to try the nightly builds :-s )

Overall, I quite like the new UI though it did take some getting used to. The fact I dont have to worry about space is the biggest reason I will keep this rom, though it does sound like starburst rom which is much closer to vanilla HTC sense branded android also allows the “data2sd” hack to get more space

Time is short. (Or why piracy is not the problem)

We are constantly being bombarded by claims that the music and film industries are being destroyed by rampant piracy eating away at their profits. This whole argument really annoys me, and partly because of the following really well illustrated point.

Click to load

I pay for a DVD and then waste loads of time being told not to pirate DVDs. If I had pirated the DVD, I wouldn’t have had to put up with all that.

So how does that fit with a title of “Time is short”? Well… You may have noticed that I did not write a single blog post last month – I haven’t had the time. I also haven’t had the time to go to the cinema, the last film I saw was the penultimate Harry Potter and it not only cost an arm and a leg, but a drink and some nibbles nearly cost me the other arm.

I also have not bought much music in a while – I haven’t heard much I particularly like on the radio, and haven’t really had time to go out looking for anything new, so just stuck with my iPod. If I did buy music, it would probably be a digital download for only a few pounds per album.

You might have guessed that I haven’t bought a DVD in a while – My lovefilm subscription gives me two DVDs a month to watch, and that keeps me busy enough with a little trashy tv.

I have bought a few X-Box games, and am likely to buy some more – Quite shocking really, as they are about £40 or £45 each. So that is eating up a lot of my time as I work my way through Crysis 2 (which is a truly awesome game) and try to resist handing over my wallet Portal 2.

I am also hacking away at Arduinos, rebuiling my media PC and hanging out on twitter and facebook. I wish I could say I even read some of my friends blog’s, but sadly the only items in my reader feed being read are lolcats, failblog, dilbert and xkcd.

As I have already said my blog barely gets updated as it is.

I bought a kindle a few months ago, and so have been reading a lot of books, which really is fantastic and of course consumes huge amounts of my time.

And next month (or possibly sooner) I will be a father, so that will take away all the free time I had for all the above activities!

So where am I supposed to find the time to watch all these films and DVDs that the industry says are being pirated? Piracy is not the problem – Crap films, high prices and, yes, time. They are what is causing me to spend less money on films and music. Instead I am spending more on games, books, gadgets, toys, and soon children.

Cactus flowers

I finally got round to posting some photos I took last year of the cactus I have flowering. It has only done it twice in the ~6 years I have had it, and this time it had quite a few flowers. The macro photos of it came out the best, helped by sheets of A4 paper as light reflectors (and in some photos backgrounds). I cannot remember if I used a wireless flash or not, but I suspect I probably did.

IMG_11807 IMG_11809
IMG_11806 IMG_11804 IMG_11803 IMG_11800 IMG_11788 IMG_11787
IMG_11808 IMG_11810