The 57North Hacklab Planet

September 24, 2014

Tom Jones

urtwn on FreeBSD ARM

This weekend I got FreeBSD on my Chromebook Snow in a usable state. Getting wifi going was a bit of a bother. I have an Edimax Wifi Adapter, but the default kernel config builds out support for wifi and the urtwn device driver.

The Beaglebone Black page on the FreeBSD wiki has a kernel config that includes the drivers I need. I took the wifi config and added them to a CHROMEBOOK-WIFI config so I could build a kernel for the Chromebook with support.

#USB WiFi
# Wireless NIC cards
device          wlan            # 802.11 support
options         IEEE80211_DEBUG
device          wlan_wep        # 802.11 WEP support
device          wlan_ccmp       # 802.11 CCMP support
device          wlan_tkip       # 802.11 TKIP support
device          wlan_xauth

device          firmware        # Required to load firmware
device          urtwnfw         # Firmware for RTL driver below
device          urtwn           # Realtek RTL8188CU/RTL8192CU

After building the new kernel and moving it over to the USB stick I use for the Chromebook I needed tell FreeBSD to accept the license terms for the wifi firmware.

Add to loader.conf
legal.realtek.license_ack=1

After that it was pretty norm wifi setup.

# ifconfig wlan0 create wlandev urtwn0
# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B
# dhclient wlan0

September 24, 2014 12:00 AM

September 12, 2014

Robert McWilliam

Russian doll

Brewdog have released a new experimental range exploring the differences between different styles of beer. Russian doll varies the strength of the beer between a pale ale and a 10.0% ABV barley wine.

I like the idea but unfortunately at every point I've tried Russian doll disappoints. The IPA can't hold a candle to punk. The double IPA is lousy compared to hardcore and the barley wine isn't a patch on clown king.

I don't know if this is a reflection of the effort put into the different beers (the ones I like are regularly produced so should have received more effort) or if this means the different styles require different approaches and Russian Doll was doomed to failure from the outset.

More data is required; I will have to drink more beer.

by ormiret at September 12, 2014 11:05 PM

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

Gallerygen

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

pv

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
Goodbye!

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

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

Then build the MediaGoblin virtualenv (as mediagoblin):

$ (virtualenv --system-site-packages . || virtualenv .) && ./bin/python setup.py 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 jabber.ccc.de’s server instead I went for the easier option of just sending messages to a MUC for now.

Check out xmpp:aprs-aberdeen@conference.jabber.ccc.de?join 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 d@vehibberd.com ( 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