This file contains hidden or 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 sys | |
import os | |
import re | |
from syslog import syslog | |
temperatureRegex = r't=(-?\d+)' | |
sensorNames = { |
This file contains hidden or 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
#!/bin/bash | |
cd .. | |
GIT_DIR='.git' | |
while read oldrev newrev ref | |
do | |
if [ "$ref" != "refs/heads/dev" ] | |
then | |
echo -e "\e[33mPushed branch isn't 'dev'. Skipping rebase dev->master.\e[0m" |
This file contains hidden or 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
#!/bin/bash | |
# This script will make a local SNMP server accessible on a remote system by | |
# forwarding its UDP traffic over an SSH connection. | |
# To do this, the following port forwardings are applied (in this order): | |
# - local TCP port 42061 (arbitrary) to local UDP port 161 (SNMP) | |
# - remote TCP port 42061 to local TCP port 42061 (via SSH connection) | |
# - remote UDP port 42061 to remote TCP port 42061 |
This file contains hidden or 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
git commit-tree dev^{tree} -p master -p dev <<'MESSAGE' | |
Replace master with dev branch. | |
MESSAGE |
This file contains hidden or 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
% Lorenz curve | |
% by n.st, originally created on 2014-02-08 | |
% based on | |
% - http://www.texample.net/tikz/examples/line-plot-example/ | |
% - http://tex.stackexchange.com/a/51766 | |
\documentclass[crop,tikz,convert={outext=.svg,command=\unexpanded{pdf2svg \infile\space\outfile}},multi=false]{standalone} | |
\usepackage[utf8]{inputenc} |
This file contains hidden or 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
#!/bin/bash | |
mkdir /tmp/bootDebian | |
mount /dev/mmcblk1p1 /tmp/bootDebian | |
cd /tmp/bootDebian/dtbs | |
dtc -O dts -I dtb -o am335x-boneblack.dts am335x-boneblack.dtb | |
cp am335x-boneblack.dts am335x-boneblack.dts.ORIG | |
grep heartbeat am335x-boneblack.dts |
This file contains hidden or 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
#!/bin/bash | |
# Uncomment the next line to start any pending updates automatically: | |
#yes="--yes" | |
for host in host1 host2 # etc. | |
do | |
echo -e "\e[0;33m$host\e[0m" | |
ssh "$host" -t " |
This file contains hidden or 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
Usage: | |
./tardis-bell.sh [ clock | <number of chimes> ] | |
This script requires the 'play' command and accompanying mp3 format plugin from | |
Sound eXchange (sox). | |
The sound used is a shortened version of the Doctor Who TARDIS Cloister Bell | |
from http://dannystewart.com/2009/09/01/doctor-who-ringtones. |
This file contains hidden or 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 | |
# intcat = interval cat: | |
# Prints a human-readable character for every n-th character received on stdin. | |
# Throughput depends heavily on n (faster for larger n). | |
n = 1000000 | |
import sys, os |
This file contains hidden or 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
#!/bin/bash | |
# Modify the following line for your system and add it to your pianobar config | |
# (usually ~/.config/pianobar/config): | |
# event_command = /home/johndoe/bin/pianobar-event.sh | |
[ "$1" = "songstart" ] || exit 0 | |
while read line | |
do |
OlderNewer