Fork and fix of https://wiki.ubuntu.com/gorun