stash: fixup DOS line termination

Wednesday, 10. 26. 2005  –  Category: all, stash

Inevitable evil: developer drops off a load of content with DOS line endings, flutzing up editor screens with ^M.

$ find /some/path -type f -exec perl -pi -e'y/\015//d;' \{\} \;

It’d be nicer to used xargs(1) instead of find(1)’s own -exec flag – way more efficient. However, chances are that if there’s borked line endings in a file tree then there’s probably also filenames with whitespace…

Not editing binary files would also be a bonus!

air mass

Wednesday, 10. 26. 2005  –  Category: all, vague

The turbo on my VW Golf 1.9Tdi had become disappointingly non-functional. I could hear the exciting whizzing from the device as it spun up, but there was no boost. For a heavy car like a mark 4 Golf, this makes driving a pain, both around town and on long motorway inclines.

Getting the garage (who are cool and have never ripped me off) to diagnose the fault would cost at least two hour’s labour, plus a callout fee for the bloke with the expensive VW diagnostic computer. Actually removing the turbo unit from the engine would cost north of £300.

Thankfully, there are two (relatively) cheap and accessible components in the setup, the solenoid which tells the wastegate to operate, and the air mass sensor (aka MAF) that tells the car’s brain how much air there is to compress. Both of these aren’t in the turbo unit itself, but located just beneath the bonnet. I picked one, the latter, and replaced it for the small fee of £60 + VAT. The MAF sits immediately behind the air filter on the air intake pipe. Two Philips screws and a big clip later and the new part was in.
Bosch MAF

The fix was obviously working within seconds of driving – it’s like having an engine several times larger. Woo!


Technical info about MAF here.

A forum of VW turbo woe here.

mysql wildcard permissions

Monday, 10. 24. 2005  –  Category: all, vague

I just can’t get wildcard permissions to work with MySQL – I want user ti to be able to do anything he likes to any database matching /^ti_/. The test databases are configure out of box like this, but I can’t seem to do this with GRANT:

mysql> grant all on "ti_%".* to ti@ti.jail.lemonia.org ; 
ERROR 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '"ti_%".* to ti@ti.jail.lemonia.org' at line 1

mysql> grant all on "ti\_%".* to ti@ti.jail.lemonia.org ;
ERROR 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '"ti\_%".* to ti@ti.jail.lemonia.org' at line 1

mysql> grant all on 'ti\_%'.* to ti@ti.jail.lemonia.org ; 
ERROR 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near ''ti\_%'.* to ti@ti.jail.lemonia.org' at line 1

Flail!