resizing a ext3 disk image

Took me a while to figure this out, so thought I’d put it here for others. This is useful for Xen setups, where you use a file for the disk image. AFAIK, you can only grow an image, not shrink it.

# dd if=/dev/zero bs=1M count=1024 >> disk.img
# e2fsck -f disk.img
# resize2fs disk.img
# e2fsck -f disk.img

This makes the disk image bigger, checks the image, resizes the file system, and then checks it again

Automatically syntax checking of PHP files when checking to SVN

This precommit script will prevent people from checking in syntactically invalid PHP files to a subversion repositroy


CHANGED=`$SVNLOOK changed -t "$TXN" "$REPOS" | awk '{print $2}'`
  FILE=`echo $LINE | egrep \.php$`
  if [ $? == 0 ]
   MESSAGE=`$SVNLOOK cat -t "$TXN" "$REPOS" "${FILE}" | $PHP -l`
   if [ $? -ne 0 ]
    echo " " 1>&2
    echo "---------------------------------------------------------------------------------" 1>&2
    echo "During automatic PHP syntax checking we found an error in the following PHP file: " 1>&2
    echo " " 1>&2
    echo "${FILE}: $MESSAGE" | sed "s| -| $FILE|g" 1>&2
    echo " " 1>&2
    echo "Please correct the error and try commit again." 1>&2
    echo " " 1>&2
    echo "You can check for syntax error on your computer by running command: php -l ${FILE}" 1>&2
    echo " " 1>&2
    echo "Best regards," 1>&2
    echo "Doctrine Dev Team" 1>&2
    echo "---------------------------------------------------------------------------------" 1>&2
    exit 1

Nokia N95 on Three

I’ve done a bit of research, and the N95 is defiantly coming to Three. The time frame isn’t set (or at least, isn’t announced, and I’ve been unable to find one…), however it’s likely to appear within the next few weeks or months.

UPDATE (31/05/2007): The manager at my local 3 store was told that the phone would be in by the end of this month. It’s not actually going to happen, but it does give the impression it will be happening any time now. Perhaps within the next few weeks. Someone discussing this on suggests that Three don’t want to release another buggy handset, and are holding back on releasing this phone for a while.

UPDATE (01/06/2007): Another place worth watching might be here
– apparently the first week of june is looking likely!

UPDATE (12/06/2007): Three called me today, and explained it would be a while, they are still testing. They could unfortunately give me no idea as to how long it would be, but it is coming (apparently).

Guide to Fitting CNC metal rotor to a Walkera 60

The parts of a Walkera 60 are hard to find, as such I had to get mine of ebay. The parts came with no instructions at all, and it took me much googling before I managed to find anything useful.

So, I though I would link to guides I found from here, to help out fellow Walkera 60 owners. The first guide also covers the fitting of the tail rotor kit, and shows how you would go about replacing a rotor shaft should you need to.

Morphy Richards Performair 1900w Bagless Pets Cylinder Review (71061)

My old vacuum cleaner (a cheapish Electrolux 1600w bagless thing) just wasn’t cutting it anymore. The small filter in it clogged up quite easily – causing it to loose suction reasonably quickly.

I decided to buy a new one, and spend some time searching. The first and obvious choice is of course the Dyson. I looked at the DC08 – however there were mixed reviews (ranging from fantastic to awful, most complains appeared to be about support or build quality, not functionality). However, the main factor for me not buying one was the price, I wanted a ‘turbo/turbine’ brush (spinning brushes) and to get this on the DC08 it was quite an expensive model. So.. I looked for alternatives.

I eventually found the Morphy Richards Performair 1900w Bagless Pets Cylinder on amazon. Reviews for this that I could fine were good, as is the price. Amazon took too long to deliver it to me, firstly quoting a 1-2 weeks wait, and at the end of 2 weeks emailed to say it would be another 2 weeks, so instead I got it from argos for the same price.

On opening the box, I was confused as to why there were 2 hoses. Turns out one of the hoses is designed for cleaning stairs, it’s super stretchy – a really good idea. It also comes with 3 main heads – 1 large turbo head, 1 small, and 1 large standard head. The turbo heads have spinning brushes that apparently help remove pet hair from the carpet, however I found the standard head worked better for me.

It comes with 2 filters – which can be washes under warm water to clean. This means you should never need to buy new filters , they have a lifetime warranty. On top of that, as you can see in the photo (click to enlarge) there’s a yellow circular bit you can turn that effectively shakes the filter removing any dust from it. You can also see a tiny little brush in the picture if you look close enough, I guess that’s for cleaning the filter. The dust bin is huge (3.8 liters) which is great. Emptying the canister is very simple, remove it from the unit, take it to be bin and press a button which opens the bottom of the canister and everything calls out – couldn’t be easier. Another nice feature is that the cleaner comes with little smelly tablet type things, which you drop into the canister after you empty it, so that whilst you’re cleaning the cleaner emits a lemon smell, apparently good for eliminating the pet smell in your house.

The vacuum cleaner is 1900watts, so it really does have great sucking power, it had no problem sucking up a sock of mine. There’s a built in tool compartment to hold the smaller tools. The metal pole is telescopic, halving it’s length for storage. The cable has a bit of yellow table at the end of it to warn you’re nearing it’s maximum length, and a bit of red tape to tell you it’s fully extended.

Overall, I’m really pleased with it, I’ve actually not found fault in it yet. If I do, I’ll be sure to update this page.

Review of the Nokia N73 on Three (3) with X-Series

I’ve recently got a N73 on Three – and I’m using the X-Series plan which gives me unlimited (with limits.. go figure) access to MSN, Skype and.. other things.

I’m sorry to report that this phone is really quite buggy.

I know there are methods to upgrade the firmware yourself, however it’s unclear to me the risks involved. Have a read of my currently unanswered post on

Here’s my mail to 3 – I’ll update if/when they reply

Hi -

I've recently got a N73 from you, and it's amazingly buggy.  It
occasionally will crash when I answer calls, sometimes reboots, often
tells me I don't have enough memory and should close some applications.
 Not very usable at all.  My phone shop is going to replace my handset,
but I'm almost certain this is related to the Firmware you use.

My N73 is running v2.0628.0.0.1, which is a known buggy version of the
Nokia firmware.

If you look at this site, it shows a list of bugs:

Notice here that in the firmware you are currently using it has a memory
leak in gallery (would explain my out of memory errors), frequent
reboots, applications not closing properly and more.

When will you be updating your firmware to the latest Nokia release so I
can have a phone which doesn't require rebooting every few days of usage?

Many Thanks,

Pixima MP150 under linux

It works in current CVS of gimp-print! Download the CVS…

cvs -d:pserver:[email protected]:/cvsroot/gimp-print login
cvs -z3 -d:pserver:[email protected]:/cvsroot/gimp-print co -P print

compile it

./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man 
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc 
--localstatedir=/var/lib --enable-test --with-ghostscript 
--with-user-guide --with-samples --with-escputil 
--disable-translated-cups-ppds --enable-nls 
--with-readline --enable-lexmarkutil --with-cups 
--enable-cups-ppds --enable-cups-level3-ppds 
--without-foomatic --build=i686-pc-linux-gnu

If this fails (it did for me), edit the Makefile, find the line below and remove ‘docs’ from it.

SUBDIRS = include src samples test po man scripts

rerun make, and make install, and configure cups. YMMV, WFM – if it doens’t work for you I’m unlikely to care, please don’t email me asking for help 🙂

Myspace Exploit!

I wrote the below about 3 months ago (mid july) and published it, but a day later decided to remove the post from my blog – one such exploit like this that was found before took myspace offline for a few hours. It appears myspace have now fixed (well, partly..) the issue I’ve documented here, so I now consider it safe to publish.

Seems I’ve foudn a way of exploiting a hole in myspace’s XSS filters!

Myspace block all kinds of common XSS exploits from your profile, however, I’ve found a way around it! I did email them explaining that I took 2 hours trying to find it, and asking if they offered any incentive to report it to them – but I didn’t hear back. I guess I might as well publish it then…

<div <img />
href="#" onmouseover="alert('moo')">w00t</div>

Using that foothold, I’m sure there’s many things you could do….

Odd XSS quirk in google videos

I don’t think this is exploitable, but here’s the details that I reported to google…

Bug with your XSS filters.

when viewing a view, you have a bar down the right hand side of the screen.
There is a bug in what I presume is your cross site scripting filter.

When it encouters a ‘ (single quote) within a string, it generates undesired results.

For example:
<a href=”/videoplay?docid=2421984664875201064″ onclick=’setSessionCookie(VP_playlistCookieName, “…,”, VP_cookieDomain); setSessionCookie(VP_playlistIndexCookieName, -1, VP_cookieDomain);’ title=”Steve Irwin How I” d=”” like=”” to=”” be=”” remembered=””>Steve Irwin How I’d Like to…</a>

Notice how the ‘title’ attribute of the <a> tag has been formatted, causing the title string to be formatted as additional attributes to the <a> tag

Last time a friend found a bug and reported it, it took a shockingly long time for google to fix it …