I hereby claim:
- I am RyanBalfanz on github.
- I am balfanz (https://keybase.io/balfanz) on keybase.
- I have a public key whose fingerprint is 7A83 C820 DCA9 470B F140 9C93 02EE DA51 A78E E78E
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| ''' | |
| Taken from: | |
| http://stackoverflow.com/users/1074592/fakerainbrigand | |
| http://stackoverflow.com/questions/15401815/python-simplehttpserver | |
| ''' | |
| import sys | |
| import os | |
| if sys.version_info < (3,): | |
| import SimpleHTTPServer as server |
| """ | |
| Fix for some issues with the original code from Heroku: | |
| https://devcenter.heroku.com/articles/s3-upload-python | |
| This example is also designed for use with Django, not Flask as in the original. | |
| """ | |
| import base64 | |
| import hashlib | |
| import hmac |
Prepare the SD Card:
➜ Downloads time sudo dd bs=1m if=ArchLinuxARM-2014.06-rpi.img of=/dev/rdisk1
1870+0 records in
1870+0 records out
1960837120 bytes transferred in 132.563127 secs (14791723 bytes/sec)
sudo dd bs=1m if=ArchLinuxARM-2014.06-rpi.img of=/dev/rdisk1 0.01s user 0.90s system 0% cpu 2:12.58 total
Update and Install Additional Packages
| profile: | |
| python -m cProfile foo.py < board_3.txt |
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| from optparse import OptionParser | |
| import sys | |
| usage = """%prog infile [options] | |
| Reads an ICO file and writes a CUR file. The ICO file should contain a single | |
| image. If no outfile name is provided, the infile name is used to create an |
| import pip | |
| from subprocess import call | |
| for dist in pip.get_installed_distributions(): | |
| try: | |
| call("pip install --upgrade " + dist.project_name, shell=True) | |
| except Exception as e: | |
| print "Caught Exception: {error}".format(error=e) | |
| print "Dunzo" |
| html { | |
| height: 100%; | |
| -webkit-box-shadow: inset 0 0 20px 0 rgba(0,0,0,0.2); | |
| -moz-box-shadow: inset 0 0 20px 0 rgba(0,0,0,0.2); | |
| -webkit-font-smoothing: antialiased; | |
| padding: 0; | |
| margin: 0; | |
| font-family: 'HelveticaNeue', Helvetica, Arial Sans-serif; | |
| font-size: 13px; | |
| color: #555555; |
| import logging | |
| import random | |
| import sys | |
| import time | |
| from arduino import Arduino | |
| logging.basicConfig(level=logging.DEBUG) | |
| def setup_board(device=None, outputPins=None): |
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| """ | |
| FileChunker.py | |
| Created by Ryan Balfanz on 2009-11-19. | |
| Copyright (c) 2009 Ryan Balfanz. All rights reserved. | |
| """ | |
| import fileinput |