The fens are alive with the sound of moosic

Yesterday we attended a rehearsal of the famous Grantchester Bovine Acapella Trio.

20160820-07570304-900

Actually, they were trying to reach this particularly tasty tree which was growing just a bit too far out over the river.

No trouble at mill

No trouble at t'mill

We paddled from home, through Grantchester, past Byron’s Pool and out towards Hauxton before breakfast this morning. Most enjoyable. This is the mill at Grantchester, taken from just beside Jeffrey Archer’s garden.

Saw kingfishers, ducklings, a comorant… Enjoyed a cup of coffee up a little tributary before turning for home.

20160820-08535712-900

Power pricing

Here’s a very rough rule of thumb which I find exceedingly useful:

If something uses 1W of electricity, and it’s switched on all the time (24 x 7), it will cost about £1/year in electricity.

So, for example, I have an elderly Mac Mini next to my television which used to be on all the time because it was my ‘media centre’ – it recorded things from the TV onto disk, etc. It takes about 80-100W, so it costs me roughly that many pounds per year, which means that if I turn it off I can get my Netflix subscription for free!

All sorts of calculations become pretty straightforward.

  • I have a second display for my iMac, which uses about 60W. (I’ve just measured it.) So that would be £60/year, but it’s only on for about 8hrs/day, so £20/year.

  • If a salesman tells you a new fridge will save you an average of 40W compared to your current fridge, but costs £400, you can work out easily that it’ll pay for itself in about 10 years.

In case you’re curious, this rule assumes you pay about 11.5p/kWh for your electricity, which is close enough for most UK residents. I forget who first pointed the convenient annual multiplication out to me, but I find myself using it all the time, so I thought I’d pass it on!

Lend me your ears

Most of my ‘reading’ these days is in audiobook form. I have more time, and I’m more alert, when I’m driving or walking the dog than when I’m sleepily in bed after a long day and a glass or two of wine (though I do read in bed as well). I’ve written before about this — have a look at this post for some recommendations. The main advantage of listening over reading, of course, is that you can do it while leaving your eyes free for other tasks.

Listening to a book is different from reading it, of course – better in some ways, inferior in others – but some people also feel it’s cheating. Melissa Dahl, writing in New York magazine, suggests it isn’t.

Excerpt:

Researchers have studied the question of comprehension for decades, and “what you find is very high correlations of reading comprehension and listening comprehension,” Willingham said. As science writer Olga Khazan noted in 2011, a “1985 study found listening comprehension correlated strongly with reading comprehension — suggesting that those who read books well would listen to them well. In a 1977 study, college students who listened to a short story were able to summarize it with equal accuracy as those who read it.” Listeners and readers retain about equal understanding of the passages they’ve consumed, in other words.

Decoding, by contrast, is specific to reading, Willingham said; this is indeed one more step your mind has to take when reading a print book as compared to listening to the audiobook version. But by about late elementary school, decoding becomes so second-nature that it isn’t any additional “work” for your brain. It happens automatically.

According to the simple model of reading, then, you really can’t consider listening to a book to be easier than reading it.

For the record, though, I’d like people to know that I always listen to unabridged versions…

Thought for the day: talking to aliens

More great stuff from Neil deGrasse Tyson. Lots of good stuff in this collection of clips, but I like the 6-min section beginning at 9:53…

Freedom

20160806-13155527-Edit-900

Scene spotted at Aldeburgh last weekend. I have a feeling I should try selling this to a biking magazine…

Simply messing about…

Believe me, my young friend, there is nothing – absolutely nothing – half so much worth doing as simply messing about in boats.

Actually, I would recommend messing about in boats at breakfast time with a flask of freshly-brewed coffee and a bag of freshly-baked croissants.

20160814-09461904-900

Lovely clear water this morning on the Little Ouse between Brandon and Thetford.

20160814-10010909-900

The neighbours seemed friendly:

20160814-11465125-900

And even the Ship’s Dog had a good time.

20160814-09340502-900

Many thanks to CanoeDaysOut for suggesting the location.

Tips for using a private Docker registry

This is a geeky post for those Googling for relevant phrases. Sometimes a Docker Registry is referred to as a ‘Docker repository’; technically, they’re different things, but the terms are often used interchangeably.

It can be useful to have a private Docker repository for sharing images within your organisation, and from which to deploy the definitive versions of your containers to production.

At Telemarq, we do this by running:

  • a standard registry:2 container on one of our DigitalOcean servers
  • an nginx container in front of it, with basic HTTP auth enabled
  • a letsencrypt system to provide HTTPS certificates for nginx, so the communications are secure.

The registry container can, itself, handle both authentication and the certificates, but it’s easier for us to deploy it this way as part of our standard infrastructure. It all works very nicely, and we’re just starting to incorporate it into some of our more serious workflows.

So how do you make sure that the right images end up in your repository?

One practice we adopt for any deployment system, with or without Docker, is to require that things pushed to the servers should come directly from the git repository, so that they aren’t influenced by what just happens to be in the directory on some arbitrary machine at some time. Typically we might have a script that creates a temporary directory, checks out a known version of the code, builds and deploys it to the server, and then tidies up after itself. (If you use a continuous delivery system, this may happen automatically on a regular basis.)

In the Docker world, you can take advantage of the fact that the docker command itself understands git repositories. So you can build a container from the current master branch of your github project using something like:

docker build -t myproject git@github.com:quentinsf/myproject.git

and docker will do the necessary bits behind the scenes, assuming there’s a Dockerfile in the source. (More details here).

So, suppose you want to build version 1.6 of ‘myapp’ and upload it, appropriately tagged, to your Docker registry, you can do so with a couple of simple commands:

docker build -t dockerregistry.example.com/myapp:1.6 \
             gitrepository.example.com/myapp.git#1.6
docker push dockerregistry.example.com/myapp:1.6

I can run this on my Mac, a Windows machine, or any Linux box, and get a consistent result. Very nice. You could also tag it with the SHA1 fingerprint of the git commit, if wanted.

Listing the containers on your Docker registry

At present, there isn’t a convenient command-line interface for examining what’s actually stored on your registry. If I’m wondering whether one of my colleagues has already created and uploaded a container for one of our services, how would I know? There is, however, an HTTP API which will return the information as JSON, and you can then use the excellent jq utility to extract the bits you need:

curl -s -u user:password https://dockerregistry.example.com/v2/_catalog | jq .repositories[]

If you want to see the version tags available for mycontainer, you can use:

curl -s -u user:password https://dockerregistry.example.com/v2/mycontainer/tags/list | jq .tags[]

And you can of course wrap these in scripts or shell aliases if you use them often.

Hope that’s useful for someone!

It’s good to know somebody’s thinking about this…

When I woke up this morning, I wondered “How can I make the most of my sewerage services today?”

Fortunately, somebody at Anglian Water had predicted that many people were contemplating this very question, and so had posted a leaflet through our door about it.

IMG_2927

When 140 characters would be considered a luxury

My cousin found this among my late aunt’s effects recently… it’s the telegram she received in Sussex from the small town in Kenya where I was born. Phone calls were, of course, basically impossible.

telegram

How communications have changed in one lifetime!

My next electric vehicle?

I missed this when it came out nearly a year ago…

More information on their Indiegogo page and at Modobag.com.

© Copyright Quentin Stafford-Fraser