London – Brighton Trek 2014 (British Heart Foundation)

Although I’m not walking to Brighton myself, I created a map to be able to find my friends on their way. You can browse the map in Google Maps.

Alternatively, if you have a GPS handheld (e.g. a Garmin eTrex or similar) or phone application (I recommend Maverick – it supports Ordnance Survey Explorer Maps), you can use either this KML file or this GPX file to import the map into your device.

London Brithon Trek 2014 (map detail)

London Brithon Trek 2014 (map detail)

Two-factor authentication for ownCloud using one-time passwords (OTP) from Yubikey

Yubikey NEO

NFC-enabled Yubikey NEO (source: Wikipedia)

I’ve been the proud owner of a Yubikey NEO for a couple of months now. It’s a small USB device (smaller than most USB flash drives) that identifies itself as a USB keyboard. Upon pressing the integrated button, the Yubikey generates a one-time password (OTP) following the popular HOTP standard (RFC4226), and sends it to your computer. Because it acts like a USB keyboard, the password is typed in for you. Chances are that it will be hidden by stars/dots of a password field, and you’ll never even see the password! Many applications support one-time passwords, this tutorial describes a method of using the Yubikey with ownCloud – a popular web service that allows you manage your files, contacts, and calendar in your own cloud (read: webserver). A bit like DropBox or Google Drive, but without handing your data over to big multinationals.

Continue reading

C++: implementing const_iterator and non-const iterator without code duplication

C++ 11

C++ 11

Over the last couple of weeks I’ve been working on a custom data structure that provides iterators (both const and “regular” non-const) that adhere to the STL C++ ’11 standards. Having these iterators would make my life easier, as it allows me to use standard STL algorithms (like std::find) on my data structures. However, implementing this data structure and the appropriate iterators made my life miserable for a few hours. Especially the implementation the two iterators without duplicating code wasn’t as straight-forward as I hoped. Here’s how I did it – it might help you (and me, when I want to do this again in the future)
Continue reading

Creating a simple Debian (.deb) package based on a directory structure

Sometimes you just want a quick way of installing a piece of software on multiple Debian (or Debian-based, e.g. Ubuntu) systems. Maybe a set of maintenance scripts you wrote (don’t we all?), or a binary you found somewhere. In those cases, it feels like quite a burden to use dpkg-buildpackage: the only thing you need is for a directory structure to go into a .deb archive, with some additional metadata. Here’s how you do that.
Continue reading

Manually running KVM on Ubuntu 12.10 (without virt-manager c.s.)

Did you have a running bridged networking KVM setup on your previous Ubuntu installation, but are things no longer working for you under Ubuntu 12.10 (Quantal)? Do you get:

/etc/kvm/kvm-ifup: could not launch network script
kvm: -net tap,vlan=0: Device ‘tap’ could not be initialized

Although it might be easier to start using virt-manager and friends to manage your virtual machines, a quick way to get things running again is simply create /etc/kvm/kvm-ifup with the following contents:

#!/bin/sh

switch=$(ip route ls | awk ‘/^default / { for(i=0;i sudo /sbin/ip link set dev "$1" up
sudo /sbin/brctl addif ${switch} $1

exit 0

Don’t forget to make it executable:

chmod a+rx /etc/kvm/kvm-ifup

And you’re ready to go! For more information about manually running KVM, please see the following documentation page on Ubuntu.com: https://help.ubuntu.com/community/KVM/Directly.

Email forwards: receiving and sending email from a different address

I manage the email setup for a number of organisations, and often get questions about how email forwarding works. This post explains how to email is configured to arrive in someone’s personal account (e.g., GMail), and how to set up your personal account to send messages from an address other than your personal email address.
Continue reading

Eclipse, C++ and Qt: use a C++ project as a library to another C++/Qt project

I’ve been developing C++ applications (using Eclipse CDT) for quite some time now, but recently I tried to link a previously developed C++ project as a library into a newly created C++/Qt project. The Eclipse Qt integration is a bit dated, but still works with Qt 4.8.1 on my Ubuntu 12.04 machine. However, it uses qmake, which is not configureable from Eclipse in a straightforward way. This post describes some tips and tricks – for my own future reference, but also for anyone out there experiencing similar difficulties.
Continue reading

SIGMOD 2011: A memory efficient reachability data structure through bit vector compression

During the last year of my Utrecht master’s degree, I worked on a research project at the University of Oxford with Prof. Oege de Moor: reachability queries on large directed graphs. This work eventually led to a paper at ACM SIGMOD 2011, one of the largest international conferences on management of data. In this post, I will endeavour to convey the intuition behind our approach: bit vector compression using a specially designed scheme called PWAH.
Continue reading

Replicating a Subversion repository into a subtree of another repository without admin access

A couple of months ago, I felt the need to replicate (a part of) a colleague’s Subversion repository. We were working on a rather large project and I wanted to have the exact revisions on my own SVN server as well. Just in case I need some history information in a couple of years, and also to be able to use my own patched WebSVN to browse the repository, publish an rss feed and keep track of changes. You’d think someone else has done this before. That turned out to be a false assertion – at least, in this particular case.
Continue reading