Version 4 SHEET 1 1260 680 WIRE -224 -208 -448 -208 WIRE -48 -208 -224 -208 WIRE 208 -208 -48 -208 WIRE 320 -208 320 -240 WIRE 320 -208 208 -208 WIRE 944 -208 320 -208 WIRE -48 -192 -48 -208 WIRE -448 -176 -448 -208
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
### Keybase proof | |
I hereby claim: | |
* I am mathew-hall on github. | |
* I am mat_h (https://keybase.io/mat_h) on keybase. | |
* I have a public key ASD6Rk7RQ-JiVEaOJv4g13dnsqH_5VLK3pVvz6vwkhdV1Ao | |
To claim this, I am signing this object: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/env bash | |
pv enwiki-20151102-pagelinks.sql.gz | zcat | ./sql.pl | sudo -u postgres psql wiki >psql_err.log 2>&1 |
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/env bash | |
(echo "digraph g{"; grep -rh module js | grep -v '[\S+]' | sed 's/.*module(//;' | tr -d " (')[];" | tr , " " | awk '{if($1!="" && $1 != " "){for(i = 2; i <= NF; i++){ print "\"",$1,"\"","->", "\"",$i,"\""; }}}'; echo "}") > /tmp/deps.dot | |
dot -Tpdf /tmp/deps.dot -o/tmp/deps.pdf && open /tmp/deps.pdf |
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
xxd -c 1 $1 | cut -d " " -f 2,3,4 | sort | uniq -c | perl -p -e 's/^\s+//; $_ =~ /(\d+)\s+([a-f\d]{2})\s+(.+)/; $_="$2 $3"."*"x$1."$1\n";' |
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
colours=('#dd0000' '#00dd00' '#0000dd') | |
colours=('#e41a1c' '#377eb8' '#4daf4a' '#984ea3') | |
for type in humidity temperature; do | |
i=0 | |
for host in 10.0.0.100 10.0.0.101 10.0.0.102 10.0.0.103; do | |
for sensor in DS18B20 DHT11; do | |
rrdtool graph temperature/$host-$sensor-$type-1d.png \ |
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
for host in 10.0.0.100 10.0.0.101 10.0.0.102 10.0.0.103; do | |
for sensor in DS18B20 DHT11; do | |
filename="$host-$sensor.rrd" | |
if [ ! -f $filename ]; then | |
rrdtool create $filename --step 15 \ | |
--start 1415577600 \ | |
DS:humidity:GAUGE:600:10:80 \ | |
DS:temperature:GAUGE:600:5:40 \ | |
RRA:AVERAGE:0.5:1:40320 \ |
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/env python | |
import socket | |
import json | |
import datetime | |
import sys | |
import MySQLdb | |
import os | |
# create database sensors: | |
# |
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
#Example of a Kalman filter for estimating a fixed value with | |
#measurement error from the Welch and Bishop's "An Introduction | |
#to the Kalman Filter" University of North Carolina at Chapel Hill, | |
#Department of Computer Science TR 95-041 | |
#Code ported from: Andrew D. Straw's implementation | |
# at: wiki.scipy.org/Cookbook/KalmanFiltering | |
NewerOlder