- You'd think rubbing 24 miles would mean the dog wouldn't need walking again. Apparently not. #
- God. Can't put it off any longer. Must shower and cut the lawn, else it'll become hay. Hoping body works again. #
- Body now rebelling against 3hr 20 min run (bromsgrove -> Birmingham and back). Hope it was about 24-26 miles. #
- RT @glynmoody A letter to my MP – http://bit.ly/aeLsTh – brilliant letter about the Digital Economy Bill/Act; wish I'd written it #deact #
- Spotting the 10k runners go past sanders park. Lovely day. #bromsgrove #
- We're all going on a toddler hunt. What a beautiful day. We're not Ill. Uh oh. He is! Grump grump grump. #
- Stupid classic iPod. Just turn off ffs. *sigh* fine! I'll give you to a 7 year old who'll care and make full use of your abilities. So long! #
- Busy making single threaded perl backup scripts parallelised. #
- RT @loudmouthman hey O2 you just kept my business http://ow.ly/1wsHr #DeBill (not as good as talktalk tho..) #
- Digital Economy Bill it's a wash up – http://www.talktalkbog.co.uk/2010/04/08/digital-economy-bill-its-a-wash-up/ #debill #talktalk #
- Where I live I have the power of 0.1 votes. See your result at http://voterpower.org.uk #GE2010 #VPI #
- The dog has it in for me. Twice he tried to trip me up while running. Grr. #
- Morning motivation – coffee – http://www.myconfinedspace.com/2010/04/08/coffee-posters/ #
- Interesting southpark episode (s14e04) taking the piss out of facebook & tron …. #
- Upgraded Mac Mini's RAM to 4gb; shame none of the 'tutorials' online were up to date. Anyone want 1gb of DDR3 8500S RAM? #
- Oi! Don't piss there [door mat] you stupid dog! GRRR. (We'd only come back from a run 1-2 hours ago). He accidentally fell nose first on it. #
- Looks like a fine evening for a run. I wonder how many runners I can overtake….. #
- We won't be attending coilwindingexpo.com in Germany. They sure put plenty of effort into targeting that letter-shot #marketing #spam #fail #
- RT @loudmouthman I swear I was watching Scrapheap Challenge as MPs tried to make some sort of Copyright law from outdated ideas. #DeBill #
- .@Pewari I think mps pair off againt opposing parties so they don't need to turn up to everything, Plus someone has to feed the ducks#debill in reply to Pewari #
- It's all very well that you stock the best razor (kos azor) asda, but do you think you could sell blades for it too? #
- You know you're onto a "winner" when you see a html drop down containing values like "title ASC" "price DESC" etc #security #sqlinjection #
- RT @glynmoody Unknown root certificate in Firefox – http://bit.ly/9yeuw8 ouch #firefox #security #
- Finally found the eclipse 'accept remote session' xdebug setting. Now it's usable (xdebug, eclipse remains slow and nasty). #xdebug #php #
- id3tag – I am not impressed with your lame error message of "Abort trap". #
- It seems Dr @carolinegoodwin fixed the dog's limp yesterday; back to having four working legs etc etc 🙂 Woof! Woof! #
- Toddler tractor power http://twitpic.com/1dddwf #
- Looking forward to tractor assembly. 🙂 #
- Beer; Chocolate; Relaxation #
- I like the Tory election posters up ATM. They seemed everywhere in Kidderminster – is it a marginal seat or something? #
Twitter Weekly Updates for 2010-04-04
- Latest farm health and safety device 'promise' (this is real… Hang it on broken stuff so others know) http://twitpic.com/1d5w0u #
- Reason 501 that religion is bad – http://nsfw.myconfinedspace.com/2010/04/03/whip-it-whip-it-good (page decorations are nsfw, image is ok) #
- Good run – shame tripod couldn't keep up and had to be left behind. Dog seems to be going through a bad patch lately. #
- F.it. No blank CDs at home to burn ubuntu onto to do an install. Off to the office I go. #
- In my usual manner I'm fixated on one musical artist atm – Devin Townsend thanks @moobert & @aypok Plenty of bad air guitar/drums. #
- American deluxe sized burger – http://www.youtube.com/watch?v=XqIWPvCgi9g …. bigger than most men. #
- I've got swingers elbow :-/ #
- Bromgrove council have failed wrt the car park layout outside asda. Nice waste of money. Motorists can't get back to the empty part. #
- More hail / rain. Now if the dog would only let me pull the thorn out of his foot, and not throw up pork chop… we'd be onto a winner. #
- Everyone seems to be buying lots of crap. Wish they'd get out of my way. #
- RT @Surfrdan LOL Nice one RT @VecchioJo: wish i was this good an artist http://i.imgur.com/JEcO1.jpg ++ 🙂 #
- Perhaps I need to quit my peanut butter on toast addiction first though… 4 weeks to first marathon (Stratford) #
- Possible blisters between my legs; sore nipples and a filthy dog. Why do I bother? Oh, yeah, so I don't turn into http://bit.ly/cCWXi2 #
- Body appropriate tired after longish run; time to clean up, shop, mess with computers and eat. #
- Support world domination. Buy a book and t-shirt …. http://www.scottsigler.com/thestarter #thestarter #podcast #fakefootball #scifi #
- Potential office above chippy. Looks promising. We might get very fat though. Nice chips tho. #
- Twitter seems almost devoid of April fools. I'm not complaining. Toddler pulling one on me now – by having a lie in …. #
- Will anyone come up with a believable/original april fools prank? #
- 'NO!… Scissors do not go in the mouth Rowan!' #
- The dog's had a hair cut and now is attacking a gigantic chew http://twitpic.com/1c55e8 #
- Look prospect customer, if you have a rush job that needs completing in 32 hours, wasting 6 hours by not sending spec till 5pm does not help #
- I just donated to stop the Digital Economy Bill http://bit.ly/dc7B1u #38degrees #debill #
- RT @birminghampost Council blunders caused Brum municipal golf crisis, http://tinyurl.com/yabxvxz <- WTF? Slow news day? #
- Hmm fail me. Today is clearly a cottage pie DAY #
- Rowans asking for seconds. Clearly today is a cottage pie week. #
- Stupid American(s): I AM gingerdog@gmail.com – NOT YOU. Stop requesting password recovery. It's not going to work. KThxBai #
- Patch been to vet; lactulose is soln. #1 .. suspect a bone is stuck in his gut causing irritation. If no improvement by Weds, x-ray etc. #
- Hmmm. Awake. Listening to what sounds like a dog being sick. He seems to be sick a lot lately… 🙁 #
- RT @guardiantech Ofcom plans to cut cost of calls to mobiles http://bit.ly/b7EAs8 #
- Wholemeal toast + peanut butter FTW. #
- The dog instantly recognised the sound of a dog food can opening and appeared. Strange when I've hardly ever fed him canned meat before #
Twitter Weekly Updates for 2010-03-28
- work meeting over; time to go shopping or something. #
- Dear #Lazyweb I'm looking for 400-600sq feet of office space in/near Bromsgrove town centre (enough for 4 desks etc). #
- Google Chrome Still The Unhackable Browser http://thenextweb.com/google/2010/03/28/google-chrome-remains-unscathed/ are ff's days numbered? #
- the free @digg app is here for iphone! they're giving out 1 tricked ipad each day for 2 weeks to celebrate! http://bit.ly/diggapp #
- Bromsgrove hockey 4ths. Won 2-0. Yey. My first real game in 13 years… #
- It'll never cook if I keep stirring and watching… Apparently. #
- RT @guardiantech News Int. starts paywall for Times and Sunday Times (UK) from June. £1/day, £2/week. Will you pay? — hahaha. No. #
- Had 2 industrial year applicants so far; both with SQL injection flaws on their portfolio sites. #php #security #fun #
- Why do I always want more peanut butter on toast? #
- Just entered the Nottingham Marathon – http://www.experianfestivalofrunning.co.uk/ – September 12th 2010… #
- I've just asked Harriet Harman to give the #debill a real debate. Please join in and RT http://bit.ly/bJ3HwF #38degrees #debill #
- Soon it may be time to wake up. Soon. #
- Firefox 3.5 was almost unusable on this acer aspire one; switched to google-chrome – netbook becomes usable and responsive. #
- Patch enjoying the fruits of my labour http://twitpic.com/1aaiy8 #
- The dog is eating better than the toddler. Shepherds pie – rejected. The dog and I enjoyed it at least. #
- Anatomy education by colouring in parts of the dinosaur. Toddler style. #
- Hmm. Had better not tell anyone I turned the oven on but wasted 10 mins as it wasn't turned on right 'oven' just 'light+fan+pretend' #fail #
- Neighbour has what looks like a mountain bike with an engine. I tried not to stare #
Running routes
I’ve used http://www.favoriterun.com for years now (See e.g. http://favoriterun.com/account/public_user_profile/5369 ). However, today Chris pointed me at http://gb.mapometer.com/en – which does a far better job of plotting routes (e.g. auto-follow road; calorie guess-timation etc).
Unfortunately it doesn’t seem to allow the public to see who plotted a route – or see any other information about a route – apart from it being plotted on a map.
So, here’s a few of mine :
Bromsgrove to Kidderminster (21.94 miles)
Bromsgrove – Timberhonger – Droitwich – Canal – Finstall (19.48 miles)
Bromsgrove – Stourbridge Road – Swan Lane – Catshill (5.94 miles)
If only they had twitter / facebook or some means of ‘showing off your running routes’ …. silly people.
zencart security crapness
Today, I logged into one server to have a rummage and see if I could free up some disk space… on a whim I do an ‘ls’ of /tmp and find a file called ‘att1.txt’. Hmm. Lets take a look – ‘head att1.txt’ gave :
... POST http://....../admin/record_company.php/password_forgotten.php?action=insert ... POST http://..../index.php?main_page=products_all/admin/record_company.php/password_forgotten.php?action=insert
... GET /index.php?main_page=products_all/images/6e072.php?site=http://...../index.php?main_page=products_all/images /6e072.php
It turns out there was a security update for Zen-cart sometime ago – see http://www.zen-cart.com/forum/showthread.php?t=130161
Suffice to say the various attackers had left a few files on the filesystem; thanks to ‘find -user www-data’ these were easy to find and remove. Interestingly Zen-Cart suggests you rename the ‘admin’ directory – I wonder how many people don’t (in this case) or do it to e.g. ‘admin.old’ …
*sigh*
Twitter Weekly Updates for 2010-03-21
- What a beautiful day. #
- Need more sleep. 4am is not wake up time toddler. And just leave me be while you play with Lego. /please/ #
- The dog has had bacon and mince for tea. I hope I eat as well. #
- Looks like the funky new car park crap at asda #bromsgrove is failing. #
- Time to run a new route… Longer and harder hopefully. #
- Thank you Aubrey for http://www.mysupermarket.co.uk/ #
- Bad memory day. Totally forgot about hockey until 15 mins ago. #gettingold #
- "Yesterday – in just one day – 6,000 UK citizens emailed their MPs" from the Open Right Group it looks like people want to debate #debill #
- I jumped into the river, too many times to make it home, I'm out here on my own, drifting all alone.. Gnr Estranged; time to find new music #
- RT @Greenpeace: @Nestle's answer to our video was to have it removed? never heard of Streisand Effect http://greenpeace.org/kitkat #kitkat #
- I think I'm in a weird mood this morning. Must be the dogs fault. #
- Turn around b1tch I've got a use for you, besides you've got nothing better to do. And I'm bored! #gnr it's easy. #
- Why are Bromsgrove pavements covered in dog poo? Why is Patch wee'ing on the door matt? All this + more won't be answered in the next tweet #
- RT @38_degrees 38 Degrees | Don't rush through extreme web laws http://bit.ly/dBaMcg #
- RT @doctorow: If 10K Brits ask MPs to debate Digital Economy Bill, it'll probably die! 1K did ystdy! http://tinyurl.com/yhnn9fj #debill #
- I really ought to get up now and run. #
- Yey; broadband works earlier than expected; 10mbit downstream too. *happy* #
- Ooh expensive new parking thing in operation at asda #bromsgrove wish they'd spend the money on potholes and the high st. #
- Will I ever tire of gnr's estranged ? Perhaps tomorrow… I just need a drum kit and guitar, oh and being ably to sing without causing GBH #
- Rule number one: don't wake a toddler up early. Persuade them to sleep as long as possible. #
- Neighbour with car alarm going off may either have no car or no friends tomorrow. #
- Still no Internet. We're all playing games now. As we just *can't possibly* do anything without the 'net. Obviously. #
- Still no Internet. Boo. #
- Internet fail day. Grrr. (bad bethere) #
- http://www.timberhonger10k.co.uk/ #running #bromsgrove – entries online etc. #
- DAB radio++; not quite sure what the fuss about BBC Radio 6 Music was for though (they cost 26 quid in @asda) #
Python script to backup mysql databases on Debian
Here’s a short python script I must have knocked up some time ago – and totally forgotten – hopefully it’ll be of some use to others….
Purpose: backup all MySQL databases, one in each file with a timestamp on the end. You’ll probably want to have a secondary cron job which does something like :
find /backups/mysql -mtime +5 -print | xargs -r rm
to delete old copies… changing +5 to how ever many days history you wish to have.
Method: Read /etc/mysql/debian.cnf to get login details for MySQL, connect to MySQL and ask it for a list of all databases, go through this list calling mysqldump on each one.
Code:
(Last updated: 2012/10/10 – skip trying to backup the performance_schema).
#!/usr/bin/env python import ConfigParser import os import time # On Debian, /etc/mysql/debian.cnf contains 'root' a like login and password. config = ConfigParser.ConfigParser() config.read("/etc/mysql/debian.cnf") username = config.get('client', 'user') password = config.get('client', 'password') hostname = config.get('client', 'host') filestamp = time.strftime('%Y-%m-%d') # Get a list of databases with : database_list_command="mysql -u %s -p%s -h %s --silent -N -e 'show databases'" % (username, password, hostname) for database in os.popen(database_list_command).readlines(): database = database.strip() if database == 'information_schema': continue if database == 'performance_schema': continue filename = "/backups/mysql/%s-%s.sql" % (database, filestamp) os.popen("mysqldump -u %s -p%s -h %s -e --opt -c %s | gzip -c > %s.gz" % (username, password, hostname, database, filename))
Twitter Weekly Updates for 2010-03-14
- Tcp over Dns seems a success – just slow, really slow. 33kbps old skopl slow. Hurry up bethere I want those 10mbps #
- And no real golf involved either in last tweet. Not sure I'll visit all the watering holes. Getting to 3 holes would make me happy. #
- Beer and running don't mix too well. At least I avoided the drinking games. 9 hole golf next weekend #bromsgrove #hockey #
- Beer and skittles. Not too interested in the skittles part tbh. #hockey #bromsgrove #
- What's with all the little hot air balloons people seen intent on launching at night? #lazyweb #
- Nealry walked into some idiot who was too absorbed in his phone. Muppet….. *ahem* #
- Dog picked up by someone and now in evenjobb. *sigh*. #
- All aboard the toddler train! #
- finds his dad drinking coffee on Google street view #
- Set up http://analogbit.com/tcp-over-dns_howto -initial 'test' appears to show it working; hope it saves me from being screwed in the future #
- Discovered perl's quotemeta() and php's preg_quote() …. Wondering how it's taken so long for me to realise they exist! #
- Notes a darkening sky and that he has no coat. This could be sub optimal. #
- I think patch wants to be nocturnal. #
- Off to hockey #bromsgrove #
- Congratulates @moobert on purchasing tolberone cookies from @asda nom nom nom nom #
- Step 1: Chocolate, Beer and Pizza. Step 2: …. Step 3: Sleep #
- Office game of the day – http://www.cantyouseeimbusy.com/games/breakdown/indexFS.php?cname=Your%20Company #
- Today looks like it'll be busy. #
- Today has been more productive… Next up #phpwm zend form etc #zf http://phpwm.org #
- I think a long hard sweaty morning fu^h^hrun is needed. Toodle-pip. #
- Despite sending essays via SMS lately (or so it seems) I've still got 292 left to cover 9 days. Now who do I annoy next…. :-> #
- Most unproductive day ever. Meh. #
- Wasted 2 minutes of my life – went to MySpace; eventually remembered login details; realised it's still crap -> closing the browser window. #
Twitter Weekly Updates for 2010-03-07
- Sweet. The now show is back. Good times. #nowshow #radio4 #BBC #
- Lovely run up Lickey hill; http://favoriterun.com/294345 – 7:45mins/mile; 12.57 miles. Now to eat breakfast and visit/annoy @carolinegoodwin #
- Congratulations Rowan. You've slept well. Don't rush to get up; I don't mind. When you do wake, we'll eventually go and have Lots of fun. #
- My ankle seems worse this morning. Time to wear boots :-/ #
- Hockey good. Left ankle not so good. Feels f–ked and swelling. Boo. #
- Hockey time. #bromsgrove At least it's dry #
- I seem to be in a good mood today; a welcome change. Hockey tonight, Dead mech podcast to listen to, new ear phones and a sunny day. #
- I seem to be in a good mood today; a welcome change. Hockey tonight too #
- Interesting day. Hyper toddler. Poor patch. #
- Signed up to the #dyfienduro – #474 Perhaps I need to do some cycling now. Or not. #
- fixed http://www.whoateallthepies.tv – silly rinetd and so on. Perhaps I ought to do some /paying/ work today…. #
- It's probably a good thing i haven't got last.fm recording what I listen to on my iPhone. Guns and roses estranged would be top. #
- Surprise surprise galaxy chocolate is now the same price in @asda as poundland. £1 for 125g. Was £1.26 in asda. #
- Lovely sunny morning in bromsgrove – one of the rare times I miss farming. #
Twitter Weekly Updates for 2010-03-07
- Sweet. The now show is back. Good times. #nowshow #radio4 #BBC #
- Lovely run up Lickey hill; http://favoriterun.com/294345 – 7:45mins/mile; 12.57 miles. Now to eat breakfast and visit/annoy @carolinegoodwin #
- Congratulations Rowan. You've slept well. Don't rush to get up; I don't mind. When you do wake, we'll eventually go and have Lots of fun. #
- My ankle seems worse this morning. Time to wear boots :-/ #
- Hockey good. Left ankle not so good. Feels f–ked and swelling. Boo. #
- Hockey time. #bromsgrove At least it's dry #
- I seem to be in a good mood today; a welcome change. Hockey tonight, Dead mech podcast to listen to, new ear phones and a sunny day. #
- I seem to be in a good mood today; a welcome change. Hockey tonight too #
- Interesting day. Hyper toddler. Poor patch. #
- Signed up to the #dyfienduro – #474 Perhaps I need to do some cycling now. Or not. #
- fixed http://www.whoateallthepies.tv – silly rinetd and so on. Perhaps I ought to do some /paying/ work today…. #
- It's probably a good thing i haven't got last.fm recording what I listen to on my iPhone. Guns and roses estranged would be top. #
- Surprise surprise galaxy chocolate is now the same price in @asda as poundland. £1 for 125g. Was £1.26 in asda. #
- Lovely sunny morning in bromsgrove – one of the rare times I miss farming. #