Twitter Weekly Updates for 2010-08-15

  • Sorcerers apprentice 7/10. Better than inception. #
  • pah, sorcerers apprentice.. i know what i meant. #
  • Internet: last airbender or the magicians apprentice? #
  • Today I did a total of 85 pushups thanks to the Hundred Pushups iPhone app. (Week 3, Day 1, Level 3) #100Pushups #
  • http://www.bbc.co.uk/news/magazine-10965608 rise of the MAMILS (Middle Aged Men in Lycra) – middle aged men cycling…. #
  • Shopping for three items turned into three carrier bags of stuff. #fail #
  • Good morning sunny Aberystwyth. We are armed with bucket and spade. Beware locals. #
  • The wheels on the bus go round and round….. And I'm falling asleep. #
  • £3 for the largest starbucks hot chocolate which isn't very big. Tasted crap. Should stick to costa or buy my own galaxy. #grumpyoldman #
  • I'm so cool. I have a Thomas the tank engine ringtone. #hip #cool #dad #
  • Seaside today. Better wake up early for once…. #
  • Rowan says I'm Shrek. ROAAAAAR!! #
  • Chocolate: £6.50ish, envelope: £1.50, postage to Canada: £12. Lesson learnt: don't bet with foreigners. #
  • http://code.google.com/p/iphone-backup-decoder/ <- seems to work quite well. Win. #
  • Clearly now is a bad time to go shopping for take away lunch. #
  • Install wordpress from svn && firewall webserver to not make port 80 requests out from apache && modify class-snoopy.php -> perhaps secure? #
  • #phpwm meeting tomorrow; don't forget … Or BurgerWM as some are referring to it already… #food #faminearoundthecorner #
  • To think, I was pretty sure I'd turned off the twitter integration in those exercise apps. #fail on my behalf. #
  • Today I did a total of 126 situps thanks to the 200 Situps iPhone app. (Week 2, Day 3, Level 3) #200Situps #
  • Today I did a total of 86 pushups thanks to the Hundred Pushups iPhone app. (Week 2, Day 3, Level 3) #100Pushups #

Asterisk – setting the caller id through an ldap lookup

Having just upgraded to asterisk 1.6, I was faced with the problem of callerid lookup no longer working.
We’d previously used the external LDAPGet module to lookup against our internal LDAP directory – but the module doesn’t compile in 1.6, so here’s a quick and dirty workaround which requires you have ldap-utils installed on your server.

In my extensions.conf :
exten => _[a-zA-Z0-9].,9,Set(CALLERID(name)=${SHELL(ldapsearch -w thepassword -D “cn=admin,dc=mydomain,dc=com” -h ldapserver -b “ou=addressbook,dc=mydomain,dc=com” -s children “(&(objectClass=person)(telephoneNumber=${CALLERID(num)}))” cn | grep ^cn | cut -d: -f2 | xargs echo -n)})

Where I used to have :

exten => _[a-zA-Z0-9].,9,LDAPget(CALLERID(name)=cidname)

Twitter Weekly Updates for 2010-08-08

  • Woke to the sound of lions roaring at 4am… (well I think it's the lions; not like the MGM lion) #
  • Campfire's burning .. Campfire's burning…. Draw nearer. http://yfrog.com/eqc4fj #
  • We're going to be camping at the safari park. ROAR! ROAR! #
  • Today I did a total of 111 situps thanks to the 200 Situps iPhone app. (Week 2, Day 2, Level 3) #200Situps #
  • Today I did a total of 75 pushups thanks to the Hundred Pushups iPhone app. (Week 2, Day 2, Level 3) #100Pushups #
  • Coffee + hot chocolate seems a good drink. Why do shops not sell chocolate coffee or hot choffee? #
  • "I design monkeys for zoos" … #pickupline #dayjob http://www.b3ta.com/questions/stupidity/post667972 #
  • Achilles tendonopathy (sp?). Exercises should fix it. Thanks to Taft physiotherapy, 46 new road, bromsgrove #
  • And now to physio-ize my ankle. I'm fed up not being able to run. #
  • Yey. Fixed a long standing sporadic bug … Silly soap data types. #
  • Today I did a total of 68 pushups thanks to the Hundred Pushups iPhone app. (Week 2, Day 1, Level 3) #100Pushups #
  • Jailbreakme worked first time. Quick. Exceedingly easy. Idiot proof. Well done @comex etc #
  • Jailbreakme looks excellent. Apple will be pissed that it appears so easy to do. I've so missed sbsettings and bitesms #
  • Toy story 3 …. Someone's transfixed by the big big big telly a least. Shame there's a head in my way. #

Twitter Weekly Updates for 2010-08-01

  • Sea life centre – £10ish… Seeing your son run into a mirror twice in a hall of mirrors – priceless. #evildad #
  • Apple Grammar fail (their != they're) http://store.apple.com/uk/product/H0462ZM/A?fnode=MTY1NDA0Ng&mco=MTM3NTE4NzA #
  • Birmingham sealife centre for me today it seems. #
  • RT @madeupstats 16% of the residents of Newark are unaware that their hometown is an anagram of 'Wanker'. #
  • Ooh, look… fancy URL rewriting (e.g. http://…./Light_Therapy) … I wonder what'll happen when I put a ' in there… #sqlinjection #
  • Protip – Webdevs submitting a CV, check your reference URLs; today's example: 2 domains parked; 2+ have SQL injections in the URL #
  • I told Ofcom what's wrong with the #DEAct code It only takes 2 min http://bit.ly/reply-to-ofcom #
  • Thanks for the nits toddler…. #joysofparenthood #
  • Nom nom. 5 crunch corners for £1. 52p each. Crazy stuff @asda #
  • 'ukathletics ltd' sent me some spam – 'london disability athletics challenge' … containing only remote images #accessibility #fail #
  • Why don't cows lay round bottles any longer? Is this a case of genetic over engineering? #
  • I wonder what people put in sandwiches before cheese was invented? #
  • The BBC's Sherlock (well first epsiode) was pretty good – glad to finally see some decent UK telly. #
  • while [ true ]; do echo 'thanks for waiting, one of our advisors will be with you as soon as possible'; done #onhold #hmrc #tax is-taxing #
  • I hope it's bromsgrove's air that smells of crap and not me… #
  • Email:"only 7 weeks to marathon… Get training". Me: that might be a problem as both legs voice displeasure. Stupid body. #
  • In other news, I'm now mayor of the cinema after two visits on 4sq. Guess no one plays it around here… #backwardsbirmingham #
  • Saw inception today. OK, but predators was better. End & plot twist too predictable #caveman #unculturedmanwhoprobablydidntgetit #

Grr…

Why would someone write Python and mix tabs and spaces. Do you really want to have random arbitrary bugs … grr….

:%s/^I/    //g

Grr. grr. grr. stupid programmer. Grr.. That’s my final moan. honest.

Logging … and how not to do it.

One thing that really annoys me is when I come to look at the log file and I see something like :

blah blah did blah blah
blah foo blah random comment
fish blah some data
which spans many lines or does it?

This is bad, as I’ve got absolutely no idea where the messages are from (so have to grep around a code base), and I’ve no idea WHEN they were made. At best I can look at timestamps on this file and figure out a timeframe (assuming logrotate is in use so there is a definite (must be after X timestamp)).

What’s far better from a maintenance point of view :

2010/07/29 09:33 filewhatever.py:355 blah blah blah did blah blah

2010/07/29 09:34 filewhatever.py:355 blah blah blah did blah blah

2010/07/29 09:35 filewhatever.py:355 data received from x is {{{hello world…. }}}

Changes are :

  1. Date and time stamps (in python: datetime.datetime.now())
  2. Recording where the message came from (see the ‘inspect’ python module – inspect.stack()[1][1] for calling file, and inspect.stack()[1][2] for the line number, or debug_backtrace() in PHP)
  3. Wrapping any interesting output (e.g. from a remote service) in obvious delimiters (e.g. {{{ and }}} )  – without e.g. timestamps or some other common line prefix, I’ve no way of knowing what’s from where, especially if the output spreads over many lines.

Other good ideas :

  1. Different severities of log message (classic: debug, info, error type annotation with appropriate filtering).
  2. Make sure logrotate is in use, or a simple shell script via cron, to stop the log file growing too large and causing problems.
  3. Stop writing your own logging mechanisms and use ones provided by the system (e.g. Python has a logger built in which does all of the above and more)

EOR – EndOfRant

Twitter Weekly Updates for 2010-07-25

  • Morrisons. You are the worst supermarket ever. Let me buy single bananas. #
  • Even with an iPhone and google maps etc I got lost around Bentley / webheath. #amireallyawoman #mapreadingfail #
  • Cycled to arrow valley park (redditch) and back, via lickey hill (out) and cycle route 5 on the way back….. #
  • Cycling with a dead weight toddler in a rear seat is hard. This might have to become a regular routine. #
  • Toddler cycling day (well I'm cycling, he's along for the ride) #
  • Hmm. Apple case app crashed my phone. Great. Shame there aren't more pictures or info provided to help me choose #iPhone4 #case #
  • Wish subversion would let me revert line ranges within a file so I can easily avoid committing whitespace changes etc. #svn #
  • FOOL WOMEN into thinking their opinions are valued by nodding occasionally and saying 'mmm' /via @VizTopTips #
  • Say the word and I'll be gone. Say the word and I'll be gone forever, and ever. #
  • Yey. Query time reduced from 2.5 seconds to 0 seconds. And a happy customer soon. #
  • http://www.myconfinedspace.com/2010/07/20/proper-use-of-your-and-there/ #

Twitter Weekly Updates for 2010-07-25

  • Morrisons. You are the worst supermarket ever. Let me buy single bananas. #
  • Even with an iPhone and google maps etc I got lost around Bentley / webheath. #amireallyawoman #mapreadingfail #
  • Cycled to arrow valley park (redditch) and back, via lickey hill (out) and cycle route 5 on the way back….. #
  • Cycling with a dead weight toddler in a rear seat is hard. This might have to become a regular routine. #
  • Toddler cycling day (well I'm cycling, he's along for the ride) #
  • Hmm. Apple case app crashed my phone. Great. Shame there aren't more pictures or info provided to help me choose #iPhone4 #case #
  • Wish subversion would let me revert line ranges within a file so I can easily avoid committing whitespace changes etc. #svn #
  • FOOL WOMEN into thinking their opinions are valued by nodding occasionally and saying 'mmm' /via @VizTopTips #
  • Say the word and I'll be gone. Say the word and I'll be gone forever, and ever. #
  • Yey. Query time reduced from 2.5 seconds to 0 seconds. And a happy customer soon. #
  • http://www.myconfinedspace.com/2010/07/20/proper-use-of-your-and-there/ #

Twitter Weekly Updates for 2010-07-18

  • Good morning world. #
  • . @ChairmumMiaow is on @BBcWm tomorrow
    Morning (fri) to talk about upcoming breastfeeding picnic (Monday – http://bit.ly/brumbfpicnic) #
  • Breastfeeding picnic in Birmingham – monday 19th July 12-3pm http://bit.ly/brumbfpicnic see fb group. #Birmingham #bfpicnic #
  • Sblug html5 talk from @brucel might start soon. #
  • So much for an early night. Potential office viewing tomorrow…. *crosses fingers* #
  • Evolution is better than thunderbird for mail on Linux …. Except for address learning / completion. #
  • Interesting day – customer turns up unannounced for what turns into a near 5 hour meeting. Still he bought lunch 🙂 #
  • Finding a wordpress virus thing (eval(gzinflate(base64_decode(….)))) on a site just before bed is annoying. Timestamp implies before us 🙂 #
  • 2 old ladies sitting in church 1 leans over and whispers to the other "my butt is going to sleep", other replies "i heard it snore 3 times" #
  • I love orange. O2 you sucked so much. #
  • Sweet. FETIDUS is back on podcast. Zombies. Yey. #
  • I'm not sorry to see the Food Standards Agency go 🙂 #fsa #
  • Thanks mr postman for parking your bike right in front of me in the middle of the fricking pavement. #
  • This is excellent and should be seen by everyone: http://is.gd/doq8o /via @FellowAtheists – zombies religion venn diagram #
  • My 10km time – 42.38 (43rd, last year: 42.50 & 29th). #timberhonger #running #bromsgrove (results at http://timberhonger10k.co.uk) #
  • Back home from the launch party of Intimate Perfection. Go Jenny! Congrats on doing the England team! And the world cup winners get it free? #

Twitter Weekly Updates for 2010-07-11

  • BBQ time ! #
  • Timberhonger 10k race tomorrow; here's to hoping my legs are up to it. #bromsgrove #10km #run #
  • A woman says she's uncomfortable watching you wank. You A: need more time together B: she's a prude C: Tell her to sit elsewhere on the bus. #
  • I`m getting sick of these Tyneside gunman jokes. They`re not even raoulmoatly funny. #
  • Postfixadmin 2.3.1 live; .rpms and .debs etc; see http://postfixadmin.sf.net – virtual mail domain admin tool for postfix #php #mail #isp #
  • Turned on the radio to kerrang. Toddler demanded we danced. Fun times. Shame the radio reverted to talking after the song. #
  • Ooh. Thanks John truslove. Two potential offices to view 🙂 bromsgrove ftw 😉 #
  • Bromsgrove … Where are the decent offices hidden.? Room for 4-5 required. #
  • Postfixadmin release 2.3.1 is almost here. #postfix #linux #sysadmin #
  • Paddy tells Mick he`s thinkin of buying a labrador. "F___ off" says Mick, "have you seen how many of their owners go blind?" #joke #
  • Women! They just don't have a sense of humour. The wife didn`t find it nearly as funny as I, when I replaced her tampon with a party popper! #
  • OH: "website ______ is crap it has BNP images in it…. " (I heard bnp, he did say bmp). #
  • I quite like my jabphone 4 but cant help think it's a bit like the emperors new clothes. Wish orange would port my number too. #iphone4 #
  • The estate has a scrap man who drives around in an ex-BT transit van. Failure on so many levels, and let's not mention his 'jingle' #
  • Sweet. Phone didn't loose 3G coverage walking home. Suck on that o2, orange ftw. #
  • Come on orange. Finish porting my number. #
  • Twitterific on my new phone seems to be having a bad day wrt authentication #
  • RT @CalEvans: http://bit.ly/a4MLMx #rofl Rasmus has the patience of Job. #php /via @akrabat #