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!
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.
The fix was obviously working within seconds of driving – it’s like having an engine several times larger. Woo!
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!
Recent articles
- Docker, SELinux, Consul, Registrator
(Wednesday, 04. 29. 2015 – No Comments) - ZFS performance on FreeBSD
(Tuesday, 09. 16. 2014 – No Comments) - Controlling Exim SMTP behaviour from Dovecot password data
(Wednesday, 09. 3. 2014 – No Comments) - Heartbleed OpenSSL vulnerability
(Tuesday, 04. 8. 2014 – No Comments)
Archives
- April 2015
- September 2014
- April 2014
- September 2013
- August 2013
- March 2013
- April 2012
- March 2012
- September 2011
- June 2011
- February 2011
- January 2011
- October 2010
- September 2010
- February 2010
- September 2009
- August 2009
- January 2009
- September 2008
- August 2008
- July 2008
- May 2008
- April 2008
- February 2008
- January 2008
- November 2007
- October 2007
- September 2007
- August 2007
- December 2006
- November 2006
- August 2006
- June 2006
- May 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005