forked from http://lacklustre.net/projects/ems-flasher/