Add isup.py

This file is a modified version of https://gist.github.com/andrix/1423960#file-isup-py