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 | |
# Check if all changed zone files have had their SOA serial incremented. | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 |
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 | |
tunservers="Hong_Kong,_HK:216.218.221.6 Singapore,_SG:216.218.221.42 Tokyo,_JP:74.82.46.6 Amsterdam,_NL:216.66.84.46 Berlin,_DE:216.66.86.114 Budapest,_HU:216.66.87.14 Frankfurt,_DE:216.66.80.30 London,_UK:216.66.80.26 Paris,_FR:216.66.84.42 Prague,_CZ:216.66.86.122 Stockholm,_SE:216.66.80.90 Warsaw,_PL:216.66.80.162 Zurich,_CH:216.66.80.98 Ashburn,_VA,_US:216.66.22.2 Chicago,_IL,_US:184.105.253.14 Dallas,_TX,_US:184.105.253.10 Denver,_CO,_US:184.105.250.46 Fremont,_CA,_US:72.52.104.74 Fremont,_CA,_US:64.62.134.130 Kansas_City,_MO,_US:216.66.77.230 Los_Angeles,_CA,_US:66.220.18.42 Miami,_FL,_US:209.51.161.58 New_York,_NY,_US:209.51.161.14 Seattle,_WA,_US:216.218.226.238 Toronto,_ON,_CA:216.66.38.58 Winnipeg,_MB,_CA:184.105.255.26" | |
tunserver_array=($tunservers) | |
tunserver_count=${#tunserver_array[@]} | |
i=1 | |
( | |
echo -e "Location\tIP\tmin\tavg\tmax\tmdev" | |
( |
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/zsh | |
# usage: $0 <path being scrubbed> | |
set -e | |
# adapted from my own oneliner script at http://www.commandlinefu.com/commands/view/12621/ | |
format_filesize () { | |
printf "%d" $1 | awk 'function hr(bytes){hum[1024**4]="TiB";hum[1024**3]="GiB";hum[1024**2]="MiB";hum[1024]="kiB";for(x=1024**4;x>=1024;x/=1024){if(bytes>=x){return sprintf("%8.3f %s",bytes/x,hum[x]);}}return sprintf("%4d B",bytes);}{print hr($1) "\t" $2}' | |
} |
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 |
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
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
#!/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
#!/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
% 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
git commit-tree dev^{tree} -p master -p dev <<'MESSAGE' | |
Replace master with dev branch. | |
MESSAGE |