http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/
List USB Devices
lsusb
Find serial number of a USB device
| sudo apt-get install w3c-markup-validator | |
| nano /etc/w3c/validator.conf | |
| # Whether private RFC1918 addresses are allowed. | |
| Allow Private IPs = yes | |
| <VirtualHost *:81> | |
| ServerAdmin [email protected] | |
| DocumentRoot /usr/share/w3c-markup-validator/html/ |
| function fireEvent(element,event){ | |
| if (document.createEventObject){ | |
| // dispatch for IE | |
| var evt = document.createEventObject(); | |
| return element.fireEvent('on'+event,evt) | |
| } | |
| else{ | |
| // dispatch for firefox + others | |
| var evt = document.createEvent("HTMLEvents"); | |
| evt.initEvent(event, true, true ); // event type,bubbling,cancelable |
| # Load Json into a Python object | |
| import urllib2 | |
| import json | |
| req = urllib2.Request("http://localhost:81/sensors/temperature.json") | |
| opener = urllib2.build_opener() | |
| f = opener.open(req) | |
| json = json.loads(f.read()) | |
| print json | |
| print json['unit'] |
http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/
List USB Devices
lsusb
Find serial number of a USB device
Use this command to get the UNIX time
date +%s
Create a gauge RRD with a 60 second heartbeat
rrdtool create temperature.rrd --step 60 \
DS:temp:GAUGE:600:-273:5000 \
RRA:AVERAGE:0.5:1:1200 \
| date +%s |
sudo apt-get install rrdtool python-rrd
###References
| convert -resize 133x100 -extent 133x100 -gravity center annualClimateSummary2011.jpg | |
| convert -resize 300x225 -extent 300x225 -gravity center annualClimateSummary2011.jpg |
| git config --global alias.graph 'log --graph --all --oneline --decorate --color --date-order' | |
| git graph |
| Open a terminal window after plugging the Numato device into your usb port. | |
| > screen /dev/ttyACM0 | |
| > relay on 0 | |
| > relay off 0 |