The 57North Hacklab Planet

July 30, 2014

Tom Jones

GPGME with Mutt on OS X

I found it quite difficult to get GPGME working with Mutt in OS X, I was using Homebrew to install mutt. I could see the option in the brew build file to use GPGME, but it was set as an optional dependency. I fought with it for a while then jumped across to #homebrew on freenode to get an answer.

I had to force brew to build mutt from source to get the dependency included. You will have to uninstall mutt if you have already installed it.

brew install mutt --build-from-source --with-gpgme

You will need to add the correct bits to your .muttrc to get mutt to use.

set crypt_use_gpgme = yes
set crypt_autosign = yes
set pgp_sign_as = 0xYOURGPGKEYGOESHERE*****

July 30, 2014 12:00 AM

July 28, 2014

Robert McWilliam


I sat down to try and catch up with processing photos then got somewhat distracted and wrote a primitive static gallery generation system (thing). This might be why things take a long time to get off my TODO list.

gallerygen takes a CSV (like this one) with filenames for the images that should make up each row in the gallery. It resizes the images as needed and builds an HTML page to display them.

I made an example gallery from my photos from Berlin last summer.

The code is on github.

There are a few things to fix/improve.

by ormiret at July 28, 2014 12:17 AM

July 14, 2014

Tom Jones


I found a tool called pv via a Hacker News thread. pv or pipe viewer allows you to view data as it is pulled out of a Unix pipe. This is really helpful when dealing with long running commands. I used it today to check on the progress of encrypting a large tar archive.

$ pv archive.tar.xz | gpg --sign --symmetric - > archive.tar.xz.gpg
6.51GiB 0:08:52 [6.23MiB/s] [======================>       ] 70% ETA 0:03:47

While pv is running you get a progress, time elapsed, speed, a progress bar, 70% complete and an estimation of time until complete.

July 14, 2014 12:00 AM

July 13, 2014

Iain R. Learmonth

Installing MediaGoblin on FreeBSD

GNU MediaGoblin is a web application for hosting and sharing media. At 57North Hacklab, we currently have a Flickr group but to post to Flickr it is necessary to have a Yahoo! account and this seems like an unreasonable requirement to impose on members that want to share photos. This led to me setting up MediaGoblin. Hopefully it will also be useful for sharing other forms of media beyond photos too.

The instructions for installing MediaGoblin only cover Linux environments so here is my documentation of an installation on FreeBSD.

Start off by installing some dependencies (as root):

# pkg install git python py27-lxml py27-imaging py27-virtualenv

Then install some postgresql things (as root):

# pkg install postgresql92-server postgresql92-client py27-psycopg2

Do some setup of postgresql to initialise it and make it start on boot (as root):

# echo 'postgresql_enable="YES"' >> /etc/rc.conf
# /usr/local/etc/rc.d/postgresql initdb
# /usr/local/etc/rc.d/postgresql start

Create the new postgresql user and database (as root):

# su pgsql -c "createuser mediagoblin"
# su pgsql -c "createdb -E UNICODE -O mediagoblin mediagoblin"

Create the system user (as root):

# adduser
Username: mediagoblin
Full name: MediaGoblin Unprivileged User
Uid (Leave empty for default): 201
Login group [mediagoblin]:
Login group is mediagoblin. Invite mediagoblin into other groups? []:
Login class [default]:
Shell (sh csh tcsh bash rbash zsh rzsh git-shell nologin) [sh]:
Home directory [/home/mediagoblin]: /usr/local/srv/mediagoblin
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]: no
Lock out the account after creation? [no]:
Username   : mediagoblin
Password   :
Full Name  : MediaGoblin Unprivileged User
Uid        : 201
Class      :
Groups     : mediagoblin
Home       : /usr/local/srv/mediagoblin
Home Mode  :
Shell      : /bin/sh
Locked     : no
OK? (yes/no): yes
pw: mkdir(/srv/mediagoblin): No such file or directory
adduser: INFO: Successfully added (mediagoblin) to the user database.
Add another user? (yes/no): no

The next step is to actually fetch the MediaGoblin sources (as root):

# su mediagoblin
# cd ~
# git clone git://
# cd mediagoblin
# git submodule init && git submodule update

Then build the MediaGoblin virtualenv (as mediagoblin):

$ (virtualenv --system-site-packages . || virtualenv .) && ./bin/python develop

To deploy with FastCGI, flup is apparently useful (as mediagoblin):

$ ./bin/easy_install flup

From here, you can follow the official documentation. Just start at “Deploying MediaGoblin Services”. Do remember though that your configuration files for web servers are going to be in /usr/local/etc not /etc

by irl at July 13, 2014 04:32 PM

July 12, 2014

Iain R. Learmonth

Streaming APRS data over XMPP

I’ve recently started playing with radios again and I’ve been looking mainly at packet radio. APRS is a system which uses amateur radio to transmit position reports, weather reports, and messages between users. There is an Internet backbone for APRS called APRS-IS that can be used to access a filtered feed of APRS broadcasts. I thought it would be nice if such a feed were also available via XMPP so set about building a gateway.

This was not as easy as I’d hoped it would be. All the libraries I tried to use to access APRS-IS data either were in a language I didn’t want to touch (i.e. Perl) or wouldn’t run on my system without segfaulting. Luckily, it is quite easy to talk to the APRS-IS servers as it turns out. Opening a TCP connection and sending:

user MM6MVQ-1 pass -1 vers testsoftware 1.0_05 filter r/57.1526/-2.1100/50\r\n

caused the server to begin sending me all the APRS packets broadcast within 50km of Aberdeen.

Next up was the XMPP bit. I really wanted to get a pubsub service going, but I had no idea how they worked, and after fighting with libraries again and even giving up on the server software and using’s server instead I went for the easier option of just sending messages to a MUC for now.

Check out to see the messages being broadcast around me.

by irl at July 12, 2014 09:49 PM

June 25, 2014

Ed Watson

June 23, 2014

Dave Hibberd

Design Notes on Satellite Stations

CampGND Draws closer, and I’m worried about ’the project’.

Having got really excited about SATnogs, it’s been really frustrating to learn that the project is currently just a shell of what it could be. As far as I can see, there’s some STL files describing items to be printed, some software and some other things, but a complete lack of documentation. Poking through other branches of the main software, I did find what looked like a kind-of-incomplete bill of materials.

Before I go through with any 3D printing I’m going to have to know more details. Things like what materials the ’rest’ of it is made of, what materials would be required for antenna construction, what model stepper motors have been tried and tested. Even just the order that things go together on the antennas (there is a nice exploded view of the gearing box).

As such, I’m putting that project on hold. I’m going to still do satcom and I’m going to still build things, but my antenna builds and the like will be on location and held together in sketchy and interesting ways.

Current plans:

  • Build Yagis

I’m going to build at least 1 yagi for 2m, and potentially a second for 70cm. These will be simple and rustic as hell - my current design has numbers pulled from here and will be built from plumbing tube and possibly coathanger material.

  • Make Data Work

This is going to require some thought. I need to get audio from a computer of some sort into the back of the radio. With the current target being the FT-7900, this shouldn’t be too difficult, just sourcing the parts might be a panic and for V1 I may need to bypass using audio transformers. Safety is overrated.

  • Find Satellite

For this kind of thing GPredict will be required. And a good sense of direction. Prototype #1 is going to be very much “Point there! I can’t hear it! Point there now!"

  • Cook Bacon

Because, quite simply, why wouldn’t you when you’re camping.

Hopefully it’ll all come together. Failing that, I’m going to get hilariously drunk and embarass myself to my lovely new friends at 57North

by ( Hibby ) at June 23, 2014 12:00 AM

June 21, 2014

Iain R. Learmonth

Code the City Aberdeen – Day One

CodeTheCity is an event that I was loosely involved in organising that we’re now half way through. It’s all about rapid prototyping of services for the community. While the event is structured as a hackathon, many of those invited were not coders at all and a few times I heard mix ups like confusing Windows with Office and anti-virus software with a firewall. You would think that at an event where the aim is to produce a prototype these people might hold hacks back but it became apparent quickly that the domain knowledge they had could help jumpstart a project. The developers in the teams seemed to code with more confidence knowing they’d got the requirements directly from the person that would be using the system.

Unfortunately, my team did not have any potential end users. I did have a look around the other projects happening but I had basically already decided before attending the event that I was going to work on indexing and making searchable Freedom of Information Act disclosure logs. My team consists of myself and Johnny McKenzie.

Aberdeen City Council publish a FOI disclosure log but it is not searchable and rather difficult to navigate.

Our first aim was to see what data could easily be extracted from the website and from this we developed a Information Request Ontology that could be used to represent the data. I then set about transforming this into the RDF/XML schema, creating a database schema and a D2RQ mapping while Johnny looked at using Python’s BeautifulSoup to scrape the web pages.

I finished quicker than I anticipated I would and looked at BeautifulSoup too, this time for scraping the East Lothian Council’s log to aggregate into the same database. At the end of day one, we had D2RQ serving linked data and allowing SPARQL queries of the East Lothian disclosures and the code in place to start scraping in the Aberdeen City disclosures.

Depending on how I feel tomorrow, another scraper may be added or maybe an interface for human-friendly search (SPARQL is fine for me, not so much for those that are confusing Windows and Office). An interesting challenge would be to run OCR on the rasterised PDFs to get some bags of words for a better search.

by irl at June 21, 2014 10:48 PM

June 19, 2014

Tom Jones

campGND network

One of the facilities at campGND is going to be a wireless network. The hope is to have the network running for the majority of the time. I have built a wireless network at a campsite before, that was made easier by having guaranteed bandwidth from a satellite terminal.

The plan is to have a wireless network for the campsite served by a MikroTik. Using a wireless bridge to reach to the farmhouse. The farmhouse is out of site of the fields we are planning to use. Instead of having wifi doing the full jump I am going to run ethernet as far as possible.

At campGND we are depending on a few things that could be fickle.

  • BT Home Broadband
  • A long run of ethernet
  • Solar Cells and a battery for network power.

Our final back haul is the BT network the site is pretty off the grid for phone reception so we are stuck with BT. We have to be able to make a long hop form the farmhouse before we can do a wireless link down to the site. The solar cells will provide enough to run wireless access points during the day. I think at night we might be a little drunk to care.

I still need to do some testing of the wireless hardware but the plan is to use the following.

  • 100M run of Ethernet.
  • Injected POE, then split POE.
  • 2x WRT54G's.
  • A MikroTik access point.
  • Solar Cells for with battery backing for night time.

June 19, 2014 12:00 AM

June 17, 2014

Dave Hibberd

campGND Inbound

So, campGND is about to happen and I’m beginning to look forward to it.

Unfortunately for me, Tom’s told me I should have a project - I can’t just turn up and be a gin fuelled rocket for the duration. I mean, that’s going to happen anyway, but whatever, I can be productive too.

Given that my favourite toy is radios and space, I figured I should do spaceradio stuff. I’ve had the half-idea of doing a portable satellite tracking unit for a while. I want to get back into nerdy radio again, and it’s a pretty good way of doing it. Searching, stumbling and coming across things lead me to SatNOGS - A modular, open ground station built around VHF/UHF. The target platform is, of course, rtl-sdr, arduino and, surprisingly, a TP-Link WR703N.

All the structural hardware is 3D printed, and the files are available. The design work, in effect is done - all I’ve got to manage to do is assemble it in my predictably incapable state.

New things

So there are a few things I’ve never touched in the process. First and foremost, 3D printing. This is a something I’ve genuinely got no clue about, so I’m going to have to learn about it quickly. I’ve got printer access, it apparently takes about 8 hours - I just need to perform a thumb-rectal removal manouver and get down to Make Aberdeen and print the stuff off. I’ve never dealt with OpenWRT, which has to go onto the TP-Link. I’ll need to work those out before arriving at the campsite.

Shopping List

I’ll need to get hold of:

  • Stepper Motor
  • Stepper Driver
  • TP-Link WR703N
  • 3D Printed Kit
  • Anythink else that happens to cross my mind.

If it all works together, it’ll be pretty groovy. If it doesn’t work, the following few weeks will be lots of work working it out!

by ( Hibby ) at June 17, 2014 12:00 AM

Tom Jones

It is actually

Rocket Science

campGND is coming up and it is time to start talking about my projects for the weekend. With our remote location I thought it would be fun to play with something flaming and dangerous.

Rockets were the first thing that came to mind, I haven't done much with rockets beyond launching fireworks a couple of times. Doing my first launches at campGND would probably slow everything down somewhat. I got myself a starter kit from Model Rocket Shop and some extra motors, for a bigger bang.

Iain and myself went out to Balmedie Beach to have a test run with my new toy. We got a couple of videos of the rockets going up, excuse the portrait slow-mo.

On the first launch the recovery canopy got slightly melted by the rocket motor. This meant we didn't really have any recovery mechanism for the rest of the launches. The beach was pretty deserted in the dunes so this wasn't a big deal. At campGND loosing recovery could make things a little tricky.

For campGND I am planning on adding some telemetric data to the rockets, using an Arduino and some sensors. I also want to try adding a camera to the nose cone on a rocket.

June 17, 2014 12:00 AM

June 13, 2014

Tom Jones

Minimal R plots

For my new business cards I wanted to impose data from an experiment onto the background of an image. For the best results I wanted to render the plot of data onto a transparent png without any axis, values or the standard box.

After a while I got to

> png(filename="transplot.png",width=900,height=400,bg="transparent")
> plot(timestamp[0:1000],snd_cwnd[0:1000],type="h",yaxt="n",xaxt="n",ann="F",frame.plot="F")

Which generates the following image.

Alt text

June 13, 2014 12:00 AM

June 07, 2014

Robert McWilliam

Some cameras may be harmed

CampGND is fast approaching so we've started to seriously look at what we can get up to over the weekend.

When I've been involved in running events before the running of the event has left little time for messing around with my own projects. I am hopeful that CampGND will be different - there is a pretty low ratio of visitors to organisers and the organising isn't much more than "Here's a field, have at it."

So, I am planning to work on some stuff.

First off I'm going to be pointing cameras at everyone else if they look like they're doing anything interesting. This should give a few short videos documenting what we get up to over the weekend.

On a similar vein I'd like to get some more interesting shots than can be achieved by me holding the camera so I have plans to make things to mount cameras on to get them to move in ways, and get to places, I can't. These plans are still a bit vague but include kites, and a dolly to climb/follow string that can be strung up to give nice panning shots. First tests of these contraptions will be with a cheap little video camera. If they look safe I'll move onto using an android phone. If I get brave (or drunk) enough I might even try putting my DSLR on them.

I have some plans to try making pizza on the BBQ. This might take a few minutes and produce beautiful pizza or lots of trial, error, burnt dough and many hours. We shall see.

57 North needs a flag. I am going to get some fabric and make one. I might also make a banner from our coat of arms.

I would like to have a go at doing some persistence of vision stuff. If I get through the other projects (or get fed up with them not working...) then I will be looking at making some LEDs spin with control logic to have them make pretty patterns. A bike speedometer thing may be sacrificed to achieve this.

by ormiret at June 07, 2014 05:27 PM

June 06, 2014

Tom Jones

Announcing Builds

I have been building kernels on my imac in virtual machines. This can take a while and I wanted notifications when the build had finished running.

On my imac

$ while true 
    nc -l 4000 | say

This makes netcat(1) wait in a loop for any connections then pipes the output into say(1).

On the vm

$ make buildkernel; echo "Build Complete" | nc -N imac 4000

Replace imac with the hostname or ip of your machine.

I have seen the build side hang and not close the connection until killed, I am not sure why.

June 06, 2014 12:00 AM

June 04, 2014

Tom Jones

May 03, 2014

Tom Jones

Use tcpdump to save wireless bridge

For campGND we need to extend a wireless network about 500m from the farm down to the site. We have been trying to salvage some equipment but where having trouble getting control of a pair of Senao wireless bridges (Senao Long Rage Multi-Client Bridge).

Wireless Bridge

The devices has previously been configured by someone else to bridge a network between two buildings. Problem being we have no idea how these boxes have been setup. Looking online there was nothing helpful about factory resetting these boxes unless you already had access.

I decided to put a box on our ethernet and use tcpdump to scan for any traffic coming from the MAC Address on the bottom of the bridge.

# tcpdump -e -i en0 ether src 00:02:6F:45:C9:83

After a reboot of bridge the following appeared in my terminal.

115:48:15.741750 00:02:6f:45:c9:83 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: Request who-has tell, length 46

Bingo, exactly what I was looking for. That arp request tells us where the bridge thinks it is .

Now I could navigate to the bridges web interface, but I was still locked out. I read through the manufactures guide for the bridge, but I still couldn't see anything that looked like a factory reset. The guide did mention that the default ip for the bridge was and it used a admin:admin as the login.

I decided to try powering on the bridge with the hardware button held down. I left tcpdump running so if there was any change on the bridges interface. I held down the reset switch and powered the bridge on, counting to 30 seconds. I then toggled the power and finally saw

15:48:17.750222 00:02:6f:45:c9:83 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: Request who-has tell, length 46

The bridge had reset to the factory default.

May 03, 2014 12:00 AM