Attached code

requires python, written against 2.7, but it's simple enough to work
with anything.