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.

Hillary Blofeld?

Wow! I thought Hillary Clinton was just an American politician. But according to Donald Trump last night, she’s some kind of global potentate: a villain that would be rejected by Bond film producers as far too implausible:

After four years of Hillary Clinton, what do we have?

ISIS has spread across the region, and the world.

Libya is in ruins, and our Ambassador and his staff were left helpless to die at the hands of savage killers.

Iraq is in chaos.

Iran is on the path to nuclear weapons.

Syria is engulfed in a civil war and a refugee crisis that now threatens the West.

After fifteen years of wars in the Middle East, after trillions of dollars spent and thousands of lives lost, the situation is worse than it has ever been before.

This is the legacy of Hillary Clinton: death, destruction, terrorism and weakness.

What’s really shocking is that, on top of doing all that, she also used the wrong SMTP server!

You don’t need just one Mount Olympus

The London 2012 Olympics was, in my opinion, the biggest waste of taxpayers’ money to have occurred in my lifetime. For the amount it cost, we could have employed 500 teachers for nearly 1000 years. I’m not saying that the games shouldn’t have happened — there seem to be lots of people who enjoy watching other people jump into piles of sand — I simply think that it should have been funded entirely from the ticket prices and TV advertising.

It is, of course, entirely predictable — the Olympics is a financial disaster for almost every country that hosts it — but it’s less of a disaster for countries like the UK who have enough cash that they can take it in their stride. But when countries like Brazil, who have much more trouble funding their health services than we do, take it on, it probably moves from being stupid to being downright immoral.

So Paul Christesen’s article, Making the case for a new Olympic model, makes a lot of sense to me, and should not only dramatically cut costs, but should also reduce the large number of (essentially abandoned) stadia — I’ve visited quite a few of them — still standing around the world as monuments to the folly of politicians past. Actually, follies is a good word for them! Understandable follies, perhaps — Panem et circenses and all that, if you’ll excuse my mixing of classical references — but follies nonetheless.

It would be good for the Olympics to continue to exist, but for heaven’s sake, let’s do it in a way that makes sense in the modern world.

What’s in a name?

Many years ago, I was helping a local church with a project which involved a database of the participating parishioners. This was stored in the columns of a spreadsheet, and occasionally printed out strange things in the lists of names – like ‘1/6’, or ‘1/5/05’. Most bizarre.

I eventually uncovered the problem: one of the members of the congregation was named ‘June’. Another was called ‘May’. And when they had been imported into the spreadsheet, it was being far too clever for its own good! I found out just before adding a nice lady whose name was ‘April’…

Even my simple double-barrelled surname causes some problems: a surprising number of systems can’t cope with hyphenated names. For a while I seemed to be undergoing a lot of security checks at airports, which one member of staff suggested might be because my passport had a hyphen in my name, but the airline systems invariably did not, so I never matched up as expected. The US Patent Office gets similarly confused, and in some search engines, a ‘minus’ indicates an exclusion, so if you search for ‘Stafford-Fraser’ you are guaranteed never to get me because I have a ‘Fraser’ in my name. Sigh. I don’t envy those who have names with more complicated punctuation…

Unusual initials, while general handy, also have their downsides. I could never get a good personalised license plate for my car, for example, because Qs are deemed to be too easily confused with Os or zeroes in the UK and are not allowed (except in a few very specific circumstances). My friend Brian Robinson told me about an occasion when his son Xavier was excluded from something at school, if I remember correctly, because they mistook his initial, ‘X’, as a cross indicating he was crossed off the list!

So it’s appropriate that it was Brian who forwarded a Wired article by someone with a problem I hadn’t previously considered: his surname causes much more confusion for many computer systems than mine, because his name is Christopher Null.

Optimising the size of Docker containers

Or ‘Optimizing the size of Docker containers’, in case people from America or from Oxford are Googling for it…

For Docker users, here are a couple of tricks when writing Dockerfiles which can help keep the resulting container images to a more manageable size.

Also available on Vimeo here.

Things you thought you knew

Neil deGrasse Tyson is just superb. This video has (a) some ads that pop up that you’ll want to dismiss and (b) a microphone glitch early on so you’ll need to wait until he swaps mics. But trust me, it’s worth the effort.

The Cabinet of Dr Addenbrooke

John Addenbrooke, founder of the famous Cambridge hospital, was a fellow of St Catharine’s College around the start of the 18th century. One of the treasures in the college’s collection is his medicine cabinet, which has 27 drawers of assorted shapes and sizes.

20160621-180458142-Edit-900

If you open these, in the rather gloomy lighting of the room, you see some dusty items under dusty glass, and it’s hard to make out anything of much interest.

However, the college now has some funding to get the contents properly catalogued, and, since I’ve been doing a bit more professional photography recently, they hired me to take some photos of the interior. I set up a lighting rig, and the librarian and I carefully removed the glass panels covering most of the drawers. Under proper lighting, the contents came alive.

Addenbrooke Drawer 5

Addenbrooke Drawer 4

There are seeds, powders, bones, fossils, stone axe-heads; even a wooden clog in one of them!

Addenbrooke Drawer 20

Addenbrooke Drawer 26

The full details will appear on the college website once the experts have done their job identifying the contents. My thanks to the college for permission to publish a few images here.

Addenbrooke Drawer 4

I can’t wait to find out what some of these are, and where they came from!

Addenbrooke Drawer 8

Anyone recognise anything?

Addenbrooke Drawer 1

One thing I realised, when I got home, is that I needed to wash my hands thoroughly, since, for all I knew, I’d been spending the afternoon dusting my fingers in 300-year-old arsenic, or worse!

© Copyright Quentin Stafford-Fraser