Profile cover photo
Profile photo
Nigel Metheringham

Nigel's posts

Post has shared content
Typically options such as -s would go before recipient addresses, so I guess the -s is being passed as a recipient.

You also need to be careful about input handling - what happens if the subject is:-
Thing'; rm -rf /; echo '

Hi all, I am getting the following error in my ssh terminal when my script prompts an email to be sent:

exim abandoned: unknown, malformed, or incomplete option -s

My script is as follows:

void send_alert(const std::string &subject, const std::string &text) {
  start_sql("SELECT * FROM tconfig;");

  std::string sender_addr = decode_str(sql_result("sender_addr"));
  std::string alert_addr = decode_str(sql_result("alert_addr"));


  std::string filename = tmpnam(NULL);
  std::ofstream file(filename.c_str());
  file << text;

  std::string cmd = "mail " + alert_addr + " -s '" + subject + "' < " + filename;


any suggestions?

Obviously a while since I last looked on here - not only has layout changed, but I had to go through something like a new member process...

First three pantomime performances over the weekend. First one was a bit rocky (cast good, backstage less so), but followed by 2 stonking performances.
Now at work relaxing... umm actually back in theatre again this evening...

Went to see Bill Bailey last night in York - I've been lucky to see some great shows in the last few months. It was a great show, and Bill gives the impression that its all very spontaneous, although it is obviously a number of set pieces (from the instruments on stage there are a set of other pieces he didn't use last night, so he works from a menu of rather more pieces and picks the ones he wants), and Bill really riffs on comments/heckles from the audience.
This is a huge contrast to Dave Gorman's show where it is hugely planned - the use of a powerpoint background means it has to be tightly scripted, so I guess there are only a very few words out of place in the whole thing. The fact Dave hits his finishing time dead on shows how good he is at his art.
2 absolutely brilliant yet different shows, and hardly a dry seat in the house...

Dear <large software package producers>

Daylight savings time shifts have been a solved problem on Unix systems for decades - as far as the user space is concerned it just works.
So how come your package, which is only available on Unix platforms, manages to fuck up in a new and fascinating way every fucking year?
In related news I see the US have cowardly moved their DST shifts a week later to allow the software producers to beta test on the rest of the world.

Google Two Factor Authentication - Changing Authentication Device

I've just upgraded my phone, but did not want to just restore the old backup on the new phone, so have set it up again from scratch.

Unfortunately, however, there is no way to suck just the Google Authenticator data from the phone (in my case both iPhones, but I suspect this is just the same for Androids) and put it on the new phone. So the Google Authenticator config was lost and needed recreating... except you cannot get the authenticator seed info back from Google, so you have to reset that too.

So you need to modify your authentication config for the new device.
To do this:-
* Go to your google account (since you are using 2 factor auth you will need to login with user/pass plus additional auth code).
* Find the Using 2-step verification entry and click Edit (you may be prompted again for your password)
* On the Mobile application line click Remove
* 2 Factor auth will be switched off the account (temporarily).
* If you do not have a number set up for SMS auth then you will be guided through setting this up. (this tends to include yet another re-auth stage).
* Set up authentication for your phone/device again - you can probably use the 2d barcode to set your device up (make sure you can tell the new entry from the old - which you will need to delete now or later).
* and after working through this you have working 2 factor auth again

The upside of this is that your old emergency 2 factor auth password (given to you when you first set it up - also displayable from within the 2 factor auth setup screens) are not changed.
Also any application passwords you set up (ie email IMAP/SMTP access, google reader sync etc), also continue working OK without change.
Obviously if you were doing this because you believed your config was compromised then you would need to invalidate all of these too.

Overall this was a bit of a faff, but less painful than I was expecting.

So far Apple updates have not been a completely smooth experience :-(

First updated laptop to OS X 10.7.2 - which apparently went quite smoothly, although taking longer than expected. However following the reboot I logged in (which I have to do early as I use an encrypted disk), and then got a screen with the apple logo and a spinner for a very long time (until I forced a restart). Ended up having to use the recovery partition reinstall option - which worked pretty well (hint the initial timer - which started at 98 hours but dropped quickly to a few minutes, is only for the initial boot image download - there is then a 45 minute install process).

Now with working laptop found that itunes didn't work - looks like some of yesterdays itunes update had been reverted by the reinstall despite me now running 10.7.2.

Started update of iPad during which I found I had no development tools any more - OS X reinstall had shot them. And the XCode install and itunes device updaters became locked in a deadly embrace... each waiting for things to complete...

Hopefully back at a stage where I can do useful stuff...

X-factor is on in the house (not watching it myself). Its like all the oxygen is being sucked from the place...

Email from

That's why we've decided the internet needs a Central Index! With so many different data sources and directories to consider when maintaining your online profile, it makes sense to have everything in one place.

So we need a new Yahoo, or one of the other companies doing this localish central web classification! Welcome to almost 2 decades ago....

Wondering why I am seeing nothing in my G+ stream today - just "Nothing shared here so far. Try adding more people to your circles".
There are people in my circles, and there was content yesterday, today however...
Wait while more posts are being loaded