This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def load_module(url): | |
import urllib.request | |
from os.path import splitext, basename | |
from types import ModuleType | |
u = urllib.request.urlopen(url) | |
sourcename = url.split('/')[-1] | |
modulename = splitext(basename(sourcename))[0] | |
sourcecode = u.read().decode('utf-8') | |
code = compile(sourcecode, url, 'exec') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pulled from http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/ | |
# expanded via http://superuser.com/questions/690060/how-to-enable-network-with-a-raspberry-pi-emulated-on-qemu | |
# tested with 2015-02-16-raspbian-wheezy.zip on OSX Mavericks | |
# OSX terminal | |
brew install qemu | |
# kernel-qemu is a linux kernel compiled with ARM1176 support. | |
# learn more here: http://xecdesign.com/compiling-a-kernel/ | |
curl -OL http://xecdesign.com/downloads/linux-qemu/kernel-qemu | |
curl -o raspbian_latest.zip -L http://downloads.raspberrypi.org/raspbian_latest |