Category Archives: Documentation

RPi @ QUB (Raspberry Pi Wireless at Queen’s University Belfast)

Raspberry Pi’s are great but there can be some limitations in the cut-down GUI utilities they come with. One of these is joining of enterprise/corporate WiFi networks, the sort that require username/password authentication rather than a single pre-shared key.

Luckily there’s quite a lot of guides out there for different networks here and there (including eduroam) but it took me a few goes to get a Pi with a nano network adaptor working on the QUB WiFi (_QUB_WiFi), so here’s the configuration you need (note this works for me, it could well be I don’t need all the options – but with this it auto-connects in about 15 seconds).

You need to edit the /etc/wpa_supplicant.conf file and add a network section as follows:

To test this you can run: sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf

And have a look at the output – note on another terminal you’ll have to run: sudo dhclient wlan0

Once it’s connected to get an IP address (on normal login after bootup it’ll do all that for you).


C/C++ CGI File Upload

A long time ago when I still had (some) hair and hadn’t bitten the PHP bullet I played around with C++ CGIs. Owing to a lack of then available HOW-TO docs I went on to write a (badly written and error-filled) CGI in C/C++ HOW-TO and also a CGI Variable Wrapper. The HOW-TO did what it said on the tin and the wrapper provided an easy API to read/write GET and POST variables as well as cookies.

Surprisingly both the HOW-TO and the wrapper are still in use and I get contacted form time to time with queries. The most common query regards file upload which the wrapper doesn’t support. To illustrate a simple file upload I cobbled together a quick and dirty C example which I’ve provided via email ever since.

So here, for general reference, is my demonstration C code. Please note this is very untested and unrobust, even dodgier than my usual fare. I keep meddling with the idea of finding time to do a proper job either of a standalone file upload API or integrating support into the CGI wrapper. All of this is really just for kicks though as there are better solutions available.