Author Archives: qsf

A room or two with a view

Near Capvern, Hautes-Pyrenees, France.

The Englishman Abroad

Complete with fashionable headgear, knobbly knees, trusty hound, and Brompton (on kind loan from John)

Even mad dogs and Englishmen have been choosing early evening for cycling excursions here: it’s been very hot over the last few days. Light showers have made for a more autumnal climate today, though, which makes a nice change.

You’ll notice that, despite this being prime Tour-de-France country only a few miles from the Col de Tourmalet, my parents and I have somehow managed to cycle in the one flat valley in the area.

That’s just for our warm-up training, of course…

Thought for the day

A good holiday is when you can't remember whether it's Sunday or Monday.

 

The evening commute home

The harbour, Getaria, Spain.

Sunset over the Pyrenees

The Alternative

From the UK
To Santander
Without involving
Ryan Air

Who should really be suing Apple?

Dickon’s comment on my last post reminded me of another post from four years ago.

Imitation is the sincerest form of flattery, they say, but it can also be the most expensive.

Dear Apple, a billion dollars would be nice, but I think the Broadband Phone team would probably settle for some nice new MacBook Pros…

🙂

Before and after

John posted this lovely image from CultOfMac, showing phone designs before and after the iPhone.

As he says, imitation is the sincerest form of flattery…

How you can actually find things with Spotlight

Mac tip of the week…

The Spotlight search engine is a really useful feature of Mac OS X, providing an easy way to open your files, email messages etc. But suppose you want to do something other than open them: how do you find out where they actually are? Is it showing you the copy on your internal drive, or your external drive? What other things are in the same folder? Can I copy it onto a flash drive?

A quick note for new Mac users: the ‘Option’ key is labelled ‘Alt’ on some keyboards.

Using Little Computers to control Big Computers

Here’s my latest Raspberry Pi-based experiment: the CloudSwitch.

I don’t discuss the software in the video, but the fun thing is that the Pi isn’t dependent on some intermediate server – it’s using the boto module for Python to manage the AWS resources directly.

I decided to build the app slightly differently from the way I would normally approach a little project like this. I knew that, even for this very simple system, I would have several inputs and outputs of various kinds, some of them with big delays, and I wanted to make sure that timing hiccups or race conditions didn’t ever leave the lights displaying something that didn’t represent reality.

So this is only a single python file, but it runs several threads – one that looks for button presses, one that monitors and controls the Amazon server, and one that handles the lights – including flashing them in various patterns. They interact with the main thread using ZeroMQ messages, which is a lovely way to do inter-thread communications without all that nasty messing about with semaphores and mutexes.

Update: Here’s the very simple circuit diagram. The illuminated buttons I used have LEDs which take a little more power than the Raspberry Pi can really drive, so I put a couple of NPN transistors in there. It really doesn’t matter too much what they are – I used the 2N3904.

Keep the customer notified

Here’s a handy utility for those using Mountain Lion’s new Notifications system (something I find I rather like despite never really getting on with Growl).

It’s called ‘terminal-notifier’ by Eloy Durán, and it lets you send these from the command line. So, for example:

   $ terminal-notifier \
     -message “Shall I compare thee to a summer’s day?” \
     -title “Morning greeting” -execute “open http://bbc.co.uk/weather/2653941”

This pops up a little notification, and clicking on it will take you to the BBC weather forecast for Cambridge.

You could put the command all on one line – I’ve just split it up with backslashes for readability. It’s easy to install terminal-notifier from the command line with:

  $ sudo gem install terminal-notifier

Now, as an illustration of why it can be useful, I wanted this for a particular purpose:

I’ve been experimenting more and more with Multimarkdown, since so much of what I write ends up in HTML, and the markdown syntax is a convenient way to create it. I have an Automator service which takes the currently selected text, for example in a blog post text-entry field, parses it as Markdown, and replaces it with the HTML equivalent. I’ve assigned it a keystroke, so typically I’ll just do Cmd-A to select everything I’ve typed and Ctrl-Alt-Cmd-M to convert it to nice HTML. Very handy. It’s how I wrote this.

Just occasionally, however, I might want to go back to the Markdown version, so before conversion the selected text is also copied into the clipboard. This is the kind of quick temporary backup that becomes second nature if you have a clipboard history utility. But it’s easy to forget this has happened.

Now, I can just add a quick extra line in the automator script and I get a little pop-up to remind me, which vanishes again after a few seconds:

Thanks, Eloy!

Here’s what the Automator service looks like, in case anyone wants to do something similar:

Learning from the disaster

Most of you have probably heard by now about how the technology reporter Mat Honan’s accounts were hacked and how he lost his Google Mail, his Apple and Amazon account, his Twitter account and the contents of his iPhone and laptop. All in under one hour.

What’s fascinating about this story is that we know how it was done: there was no heavy brute-force attack on weakly-encypted passwords, no SQL injections on his company’s website. The hackers had no animosity towards him; they didn’t know who he was, they just liked his three-letter @mat Twitter ID. In other words, this could easily happen to you too!

If you haven’t heard the story, then I recommend listening to episode 364 of Security Now, which you can get from here or here. The discussion starts 30 mins into the programme.

You should probably listen to this if you, say, use the Internet…

© Copyright Quentin Stafford-Fraser