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
import subprocess | |
import signal | |
import platform | |
class RaidMonitor: | |
def __init__(self, agentConfig, checksLogger, rawConfig): | |
self.agentConfig = agentConfig | |
self.checksLogger = checksLogger | |
self.rawConfig = rawConfig | |
# removes any Filesystem with Filesystem of none in df |
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
from fabric.api import * | |
import fabric | |
env.hosts=["ec2-23-22-191-90.compute-1.amazonaws.com"] | |
env.user="ec2-user" | |
def hostname_check(): # hostname_check is just a task name, replace with anything | |
run("hostname") | |
def install_agent(key, url): |
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
# Connect to an Arduino attached to a moisture sensor. The code below is | |
for the Arduino | |
""" | |
const int pin = A0; // Analog input pin | |
unsigned long duration; | |
void setup() | |
{ | |
Serial.begin(9600); // initialize serial communications at 9600 bps | |
pinMode(pin, INPUT); |
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
import webapp2 | |
import cgi | |
from google.appengine.api import urlfetch | |
import json | |
import logging | |
class MainHandler(webapp2.RequestHandler): | |
red = 'http://www.blinkstick.com/d/<ID>/red.json' | |
green = 'http://www.blinkstick.com/d/<ID>/green.json' |
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
http://bildr.org/2011/07/ds18b20-arduino/ - Temperature sensor | |
http://bildr.org/2012/11/photoresistor-arduino/ - Light sensor | |
http://www.ebay.co.uk/itm/Soil-Hygrometer-Detection-Buzzer-Alarm-Module-Moisture-Sensor-Cable-For-Arduino-/390643155171?pt=UK_BOI_Industrial_Automation_Control_ET&hash=item5af42580e3 - In analog mode just read straight from the analog input | |
www.maplin.co.uk/amazing-h2o-pump-228295 - Water pump | |
http://www.ebay.co.uk/itm/360626244581?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649 - Irrigation system | |
http://www.ebay.co.uk/itm/Nano-V3-0-ATmega328P-Arduino-Compatible-/171078373098?pt=LH_DefaultDomain_0&hash=item27d510ceea - Nano |
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
pi@neptr ~ $ uname -a | |
Linux neptr 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux | |
pi@neptr ~ $ curl -O http://nodejs.org/dist/v0.11.7/node-v0.11.7-linux-arm-pi.tar.gz | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 4843k 100 4843k 0 0 816k 0 0:00:05 0:00:05 --:--:-- 939k | |
pi@neptr ~ $ tar zxf node-v0.11.7-linux-arm-pi.tar.gz | |
pi@neptr ~ $ node-v0.11.7-linux-arm-pi/bin/node -e 'console.log("hello")' | |
-su: node-v0.11.7-linux-arm-pi/bin/node: No such file or directory | |
pi@neptr ~ $ ldd node-v0.11.7-linux-arm-pi/bin/node |
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
execve("node-v0.11.7-linux-arm-pi/bin/node", ["node-v0.11.7-linux-arm-pi/bin/no"...], [/* 17 vars */]) = -1 ENOENT (No such file or directory) | |
dup(2) = 3 | |
fcntl64(3, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE) | |
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 | |
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f07000 | |
_llseek(3, 0, 0xbead3308, SEEK_CUR) = -1 ESPIPE (Illegal seek) | |
write(3, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory | |
) = 40 | |
close(3) = 0 | |
munmap(0xb6f07000, 4096) = 0 |
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
$ npm install i2c | |
npm http GET https://registry.npmjs.org/i2c | |
npm http 304 https://registry.npmjs.org/i2c | |
npm http GET https://registry.npmjs.org/bindings | |
npm http GET https://registry.npmjs.org/underscore/1.2.4 | |
npm http GET https://registry.npmjs.org/coffee-script/1.3.3 | |
npm http GET https://registry.npmjs.org/repl/0.1.3 | |
npm http 304 https://registry.npmjs.org/coffee-script/1.3.3 | |
npm http 304 https://registry.npmjs.org/bindings | |
npm http 304 https://registry.npmjs.org/underscore/1.2.4 |
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
var BMP085 = require('bmp085'), | |
barometer = new BMP085( | |
{ | |
'mode' : 0, | |
'address': 0x77, | |
'device': '/dev/i2c-0' | |
} | |
); | |
barometer.read(function (data) { | |
console.log("Temperature:", data.temperature); |
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
#!/usr/bin/python | |
""" | |
Download this script and run it as | |
``` | |
python thenameofthefile.py | |
``` | |
or |