Running….

This will end my fit of blogging diarrhea. Honest.

On Saturday, I ran to Kidderminster (21 miles in total). It went quite well, although my left thigh ached a little and I got a sore groin. Afterwards I also noticed my feet were aching on the outside of my sole (they don’t normally)….

Yesterday morning I went running again, only for 30ish minutes and found my thigh seemed worse and my right knee was unhappy too. And my lower back aches a little.

I’m wondering if my new running shoes are responsible – or if it’s just because I somehow pushed myself too far on Saturday (considering my running routine has been a mess for the last month with me rarely managing to run more than twice a week (i.e ~8-10 miles if optimistic)).

Stay tuned. Or not. Today and tomorrow will be run-free days in the hope something will repair itself.

Random PHP CSV writing code fail

Why do some programmers not ensure data is escaped for the right output ‘layer’… today I came across some legacy code which appends strings together to create a CSV file – it went along the lines of  :

$line .= $foo . ‘”,”‘ . $bar . ‘”,”‘ . $etc…. . “\n”;

There was no attempt at escaping the data being embedded, so if it contained a ” (which I know some records do) it will/would fail (yes, one premises has “…” in it’s name, and it’s caused us problems already with similar code).

The easy answer in this instance is to use PHP’s fputcsv() function (which has been around since 5.1).

What other demons are lurking there waiting to cause trouble I wonder?

(See also my random tweet linked to this)

Ubuntu Karmic … my first impressions

Today, I installed Karmic on my desktop/server at work (aka orange). It was running Debian Lenny, but with the purchase of 2 24″ monitors and my subsequent failure to quickly configure them properly, I decided to jump ship to Karmic (which I knew would work thanks to the Ubuntu LiveCD).

So, installation was pretty simple – there appeared to be a language bug in the partitioner – where the text was telling me something different to the UI, but that wasn’t a real problem, and it seemed a bit tricky selecting the right time zone – the installer was adament that I would be It took about 20 minutes to install, I think, and then it was a case of reinstalling the various services/things needed on there (apache, bind9, dhcpd, postfix, mdadm, cron jobs [poo, lost some in the move], ftpd, ssh)…

Annoyingly, dotdeb packages don’t seem to install due to dependency issues, and there’s no php5-apc package, and I’m currently stuck with php 5.2.10 (until I can find 5.2.11 packages for Ubuntu somewhere).

The monitors work perfectly – a simple GUI click was required to stop cloning and turn them into two joined together monitors.

Empathy, the new Instant Messaging client doesn’t support FacebookChat, so it’s been given the boot – and I’ve ‘reverted’ to using pidgin (which works perfectly once you upgrade to using the .deb from here).

At last, my desktop effects seem to be working – I’m using the radeon kernel module – which appears to be open source, so that’s good.

Annoyances:

  • I’m a little miffed that I can’t do alt+shift+tab to cycle backwards through the window selector, but I’ll cope.
  • The ‘Windows’ key still does nothing (FFS – windows key + D to show desktop, or windows key + E to open nautilus…). Such simple usage of it would be a huge improvement from a usability point of view.
  • When I get new IM messages, the ‘notification bubble’ that appears seems to persist for too long, can’t be dismissed (although at least it doesn’t interfer with any windows you may have open already)
  • The mess ‘they’ have made with /etc/ldap/slap.d; I can’t figure out how I’m meant to be able to configure this, so I copied my old slapd.conf file into place and changed the /etc/default/slapd file
  • Have problems ssh’ing to some external servers, with useless messages like “Max number of auth attempts exceeded”. I’m assuming this is somehow related to ssh trying every possible ssh key in ~/.ssh (is this new behaviour?). Oddly one lenny server has no problem – another won’t let me in, unless I go via a third party and don’t do authentication agent forwarding (-a).
  • pulseaudio is spamming /var/log/syslog with messages like :

Nov 25 21:17:01 orange pulseaudio[15064]: main.c: Module load failed.

Nov 25 21:17:01 orange pulseaudio[15064]: main.c: Failed to initialize daemon.

Nov 25 21:17:01 orange pulseaudio[15062]: main.c: Daemon startup failed.

I’ll guess this is file ownership related, as I dropped my old passwd and group files over the top of the ‘new’ Ubuntu ones. So far, however I’ve not found which file is to blame… reinstalling the package might be an option.

Likes:

  • Zero configuration of attached hardware (network card, graphics card etc)
  • Monitors just work 🙂
  • Almost the config files from the previous install (Lenny) can be dropped in and work
  • Still debian like, so I know what to do
  • Finally ‘service $foo start|stop|etc’ is available
  • Pretty quick booting; I think.
  • Like the new login screen, and default backgrounds
  • UbuntuOne – had a quick meddle with this, better Nautilus integration could be achieved, but it’s not bad and seems easy to use. Not sure what I’ll use it for however….

So.. that was 2-3 hours of my morning wasted. Now I’m obviously so much more productive with massive(?) monitors…. and funky desktop effects.

Twitter Weekly Updates for 2009-11-22

  • Stupid body. Both thigh muscles should not be able to cramp at the same time twice :-/ Baths are clearly not relaxing or good for me. #
  • Back from a 21 mile run to Kidderminster – http://favoriterun.com/286539 … took ages, but good fun. #
  • The driver on the bus says move on back, move on back…. #
  • Fail of the day , dodford style http://twitpic.com/qcbch #
  • Time to run 20 something miles. Is my fat chocolate biscuit fed body up to it? #
  • Can haz internetz. Pondering perm move of hotel. #tetheringsucks #
  • Breakfast at 4am. The toddler demanded it. He has a shreddie addiction. #
  • Giving blood…. #
  • New monitors == configuration hell. 2×24" tho. #
  • Guess I ought to drag my lazy arse out of bed and go running. #
  • Time for sudoku and sleep I think. Until tomorrow. #
  • We've been dancing with Mr Brownstone. He won't leave me alone. #
  • Ebuyer no longer allow me to pay via google checkout and I have to login before I can use paypal. Grrr. #
  • I'm not the sharpest tool in the box tonight. Took 20+ mins to realise I was repeating one song over and over on this iPhone. Must not doze. #

Twitter Weekly Updates for 2009-11-15

  • Orange breakfast, toddler style http://twitpic.com/plrmc #
  • Interviewing nearly done. One last group. Students seem better this year at least. #
  • Cv's reviewed. Whiskey drunk (not by me). Bed soon. #
  • In Wales, it is wet. #
  • My minions seem to not want their work monitors upgraded from 19" to 24". Strange employees. #
  • Stuck in traffic outside Newtown (powys). Grr. #
  • WordPress update time (2.8.6); svn update ftw. #
  • And another night of sweating like a pig in bed. Am I ill again or did @ChairmumMiaow leave the heating on? #
  • The toddler is now eating play dough. Tasty! #
  • First adventures with openid. Shame Zend_openid_consumer doesn't work with google. Wasted time *sigh* #zf #php #fail #
  • Hotel seem to be including free drinks and sweets. Now where are the people? #phpwm http://twitpic.com/p0st7 #
  • Php Training complete for this week. Now to get the train to @phpwm meeting in bham. Ajax server side push stuff. Greek to me #phpwm #comet #
  • And it's hard to hold a candle in the cold November rain. #
  • Via many… RT @mikebutcher: UK O2 iPhone people: unlock yours tomorrow http://bit.ly/1jX9i7 o2++ #
  • RT @nixgeek Now hiring a Systems Admin at work (@GradwellTweets) — go see http://tinyurl.com/yfe7uv2 if interested and RT please! #
  • I've totally forgotten what I was going to say/tweet. Old age sucks. V 2009 looks good. #
  • Failed to resist buying ms Swiss chocolate. Again. Soon I will not fit through doorways. #

Initial foray into OpenId (Zend_OpenId_Consumer / PHP etc)

While updating some security training materials, I thought I’d include some more information on OpenId – with the hope of demonstrating how the typical username/password mess which web applications create can be countered (for example see here )

So, being a PHP type, and having seen that the Zend Framework supports OpenId, I thought I’d create a simple demo. The documentation looked good, and I quickly got a test script online (see below). So – to test it, I thought I’d try using Google as my OpenID provider (afterall StackOverflow does) and I obviously have a Google account.

So, the Zend Framework gives the following test code :

<?php
require_once(dirname(__FILE__) . '/Zend/OpenId/Consumer.php');
require_once(dirname(__FILE__) . '/Zend/OpenId/Extension/Sreg.php');
$sreg = new Zend_OpenId_Extension_Sreg(array(
 'nickname'=>false,
 'email'=>false,
 'fullname'=>false), null, 1.1);
//echo file_get_contents('https://www.google.com/accounts/o8/id');
$status = "";
$consumer = new Zend_OpenId_Consumer();
if (isset($_POST['openid_action']) && $_POST['openid_action'] == "login" && !empty($_POST['openid_identifier'])) {
 if (!$consumer->login($_POST['openid_identifier'], null, 'http://*.palepurple.co.uk', $sreg)) {
   //echo $consumer->getError();
   $status = "OpenID login failed.";
 }
} else if (isset($_GET['openid_mode'])) {
 if ($_GET['openid_mode'] == "id_res") {
   if ($consumer->verify($_GET, $id, $sreg)) {
     $status = "VALID " . htmlspecialchars($id);
     var_dump($sreg->getProperties());
   } else {
     $status = "INVALID " . htmlspecialchars($id);
   }
 } else if ($_GET['openid_mode'] == "cancel") {
   $status = "CANCELLED";
 }
}
?>

<html><body>
<?php echo "$status<br>" ?>
<form method="post">
<fieldset>
<legend>OpenID Login</legend>
<input type="text" name="openid_identifier" value=""/>
<input type="submit" name="openid_action" value="login"/>
</fieldset>
</form>
</body></html>

Which doesn’t work if you try to use https://www.google.com/accounts/o8/id [Google’s OpenID provider URL]. It just fails with a hopeless “Discovery Failed” error message. I spent an hour or two poking it, and making fruitless Google searches (or so it seemed). Then I gave up and tried using a different provider – success.. it all works.

Various postings imply there is/was a problem with the Zend Framework’s OpenId consumer – although to start with I thought it might have been due to my local PHP configuration (E.g. lacking support for openssl/mhash or something else, but this wasn’t the case). See also this and this

Thankfully the code does work when using other providers – e.g. MyOpenId. One nice feature of OpenId, which I wasn’t aware of, is that you (the web client application) can also request e.g. nickname, name, date of birth and country of residence from the OpenID provider (which is what the Zend_OpenId_Extension_Sreg stuff is all about – I’ve made the request parameters all optional, otherwise you get an auth failure when the provider doesn’t return the data you require).

Anyway, it’s really, really, easy to do. Shame about the poor support for Google though.

Twitter Weekly Updates for 2009-11-08

  • I now have a new pair of running shoes. New balance or something. Will have to take them out tomorrow. #
  • Clearly he wanted a drink. #
  • The toddler is trying to tell me something. I'm too stupid to understand him :-/ #
  • RT @guardiantech Penelope Trunk: Why I tweeted about my miscarriage http://bit.ly/4o8iTq #
  • Generally unimpressed with snow leopard. Laptop has had 2 kernel panics and stuff crashes more. Rock solid before (seemingly). #apple #osx #
  • Black opal licorice ftw #
  • Preparing to say goodbye to Milton Keynes and it's jungle of roundabouts. Hope the train doesn't get lost getting here…… #
  • Metro headline – [bnp] Griffin: I was racially abused. Stop feeding the racist troll media! #
  • Taxi driver: what's the big deal with windows 7 is it that you can run two programs at once? Me: errrr #
  • Someone failed to reinstall the delegates pcs. Stupid ou. #
  • I've arrived early – first time in memory? This must be a sign from the Great Spagetti Monster, who I can also thank for a safe journey. Thx #
  • All hail – King of the loosers! Sir blame it on your ISP. Ahh berushed. Food please. #
  • Finished diy radiator swap etc finally. Didn't spray over her bed and perhaps no leaks. Alternative career – very slow plumber! #

Yet another all in one update

A random weekly rambling.

Rowan’s started to draw, say more words and generally be far easier – we’ve been out to a couple of restaurants lately, and in each he’s been no hassle (as opposed to him wanting to roam around the room and generally sticking his hands in anything he can find). We’re also hoping he’s deciding to sleep more overnight as well – but two days does not make a pattern with a toddler, so who knows what’s going on there.

Last night we had some fireworks at Jenny’s – Rowan seemed to enjoy them quite a lot (“Oh wow!”) – I had feared he’d start crying when a bang went off, and that would be the end of the evening. Thankfully he behaved really well. I also managed to drink 5 bottles of beer (far more than normal, so I had a crap headache overnight/this morning).

Kat and Rowan have spent most of the last week going to various museums in London – and finding other toddler friendly spots. I was slightly worried that taking him to London would fail totally – but it seems to have worked quite well, and it’s nice for me to be able to see them during the week in the evenings (while I’m there training).So far they’ve found some child friendly park in Russel Square, and hands on water and wheelbarrows in the Science Museum.

Yesterday, I bought a new pair of running shoes. This time I was insistent that having a neutral pair of shoes was not good – and the assistant eventually realised I was correct and gave me some with appropriate support. Hopefully I’ll soon get a routine running around London and be able to halt my expanding chocolate biscuit fuelled waistline.

In other news – my employees appear to be handling work things quite well – as by Wednesday I’ll have been out of the office for 2-3 weeks. No doubt there will be a stack of stuff waiting for me, and customers wanting updates and I’ll be kept busy. One good thing is that this excess of training work has allowed me to be more selective over which work we do, and it seems BinaryKitten/Kathryn will remain a part time, remote employee (lucky her?!).

Now I just need to sort out our Pale Purple Christmas party thing – I’m tempted in doing some sort of clay pidgeon shooting type thing – perhaps in the start of January. Somehow I doubt we could find a live fire range where we can shoot targets/zombies, so clay pidgeons will have to be the next best bet.

Anyway, time to think about getting the bus to Birmingham and then the train to Euston. Oh, the joy.

Twitter Weekly Updates for 2009-11-01

  • I'll be running in the rain, just running In the rain. With a cold wet feeling, i hope it doesn't make me Ill again… #
  • Seen on tube advert:"I asked for fewer dicks. Now it takes fewer dicks. I've never been so influential. Windows 7" #windows #badeyesight #
  • Ticket booking fail. Virgin train packed. Imposing in first class. At least training went well. Hope mr toddler sleeps like a baby #
  • Soaked bed with sweat, slept on towel (now damp). Turned duvet over and soaked that too. I'm fed up now. #
  • Feel worse today. Stupid virus go to hell. #
  • Feels generally unwell. F. Off virus. #
  • Ah. Relief. My sinus just popped. Fscking cold thing. #
  • Delegates may take offense if I take fishermans friends. Lockets will have to do. #
  • Waiting for a train. I'm on a Night train. Bottoms up… #