Ported to linux (properly commited this time)