Skip to content

Instantly share code, notes, and snippets.

if len(self.args) != 1:
#print >> sys.stderr, "You must specify one file name, or maybe you need --help?"
#sys.exit(1)
self.stdin_mode = True
self.xml_string = i.read()
else:
self.stdin_mode = False
self.file = self.args[0]
@bonnieking
bonnieking / gist:5427019
Last active December 16, 2015 11:19
beaglebone USB
http://lazarenko.me/2013/03/04/python-in-trading/
# opkg update
# opkg install python-setuptools
path is wrong in `which easy_install`
# okpg install python-ctypes
# git clone http://github.com/walac/pyusb.git
# cd pyusb
@bonnieking
bonnieking / gist:5427575
Created April 20, 2013 21:54
beagle tweet
File found, taking pic
debug: stacheMessage = {"tweet":"New BeagleStache captured!","filename":"/home/root/stache/tmp/captured003.jpg"}
info: stacheMessage = {"tweet":"New BeagleStache captured!","filename":"/home/root/stache/tmp/captured003.jpg"}
info: LED on
info: contents.length = 278
info: --0.ed429920.3836aa6d
Content-Disposition: form-data; name="status"
New #BeagleBone BeagleStache image captured! @BeagleBoardOrg
@bonnieking
bonnieking / gist:5428715
Created April 21, 2013 06:42
beagle bone history
root@beaglebone:~/newstache/stache# ntpdate pool.ntp.org
21 Apr 06:41:10 ntpdate[680]: step time server 206.212.242.132 offset 419798972.484756 sec
root@beaglebone:~/newstache/stache# history
1 mkdir stache
2 cd ..
3 rmdir stache
4 cd ..
5 cd
6 cd
7 rmdir stache
from django.core.cache import cache
from django.utils.hashcompat import md5_constructor as md5
from RHEL_scrape.rhlistupdates import RHListUpdates
import updateinfo
from consumers.xml_web.import_entry import ImportEntry
LOCK_EXPIRE = 60 * 5 # Lock expires in 5 minutes
Welcome to minicom 2.3
OPTIONS: I18n
Compiled on Nov 23 2010, 13:27:13.
Port /dev/ttyUSB1
Press CTRL-A Z for help on special keys
wattsused = 0
whused = 0
for history in sensorhistories.sensorhistories:
wattsused += history.avgwattover5min()
whused += history.dayswatthr
wattsused = {}
whused = {}
for history in sensorhistories.sensorhistories:
wattsused[history.sensornum] = history.avgwattover5min()
whused[history.sensornum] = history.dayswatthr
@bonnieking
bonnieking / bbb rcn bb-kernel am33x-v3.8
Last active November 2, 2015 05:38
bbb rcn bb-kernel am33x-v3.8
#################################################################
[bonniek@featherfall bb-kernel]$ git checkout am33x-v3.8
Already on 'am33x-v3.8'
Your branch is up-to-date with 'origin/am33x-v3.8'.
[bonniek@featherfall bb-kernel]$
[bonniek@featherfall bb-kernel]$ ./build_kernel.sh
+ Detected build host ["Fedora release 22 (Twenty Two)"]
+ host: [x86_64]
@bonnieking
bonnieking / bbb rcn bb-kernel am33x-v3.8: part 2
Last active November 2, 2015 05:38
bbb rcn bb-kernel am33x-v3.8: part 2
[bonniek@featherfall KERNEL]$ git diff
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index a0c757a..fbbb7cc 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -15,6 +15,8 @@ config SH_MIPI_DSI
config SH_LCD_MIPI_DSI
bool
+source "drivers/video/fbtft/Kconfig"