Skip to content

Instantly share code, notes, and snippets.

View kd7lxl's full-sized avatar

Tom Hayward kd7lxl

  • Infoblox
  • Tacoma, WA
View GitHub Profile
@kd7lxl
kd7lxl / generate_email_robot.py
Created January 11, 2017 00:49
Generate A records for a network for the AMPR DNS robot
#!/usr/bin/env python
#
# Usage: ./generate_email_robot.py NETWORK
#
# Setup:
# virtualenv env
# source env/bin/activate
# pip install ipaddr
#
# Example:
@kd7lxl
kd7lxl / hexdiff.sh
Created September 12, 2016 20:12
Compares two binary files
#!/bin/sh
A=`mktemp`
B=`mktemp`
hexdump -C "$1" > $A
hexdump -C "$2" > $B
diff -U 0 --label "$1" --label "$2" $A $B | less
rm $A $B
@kd7lxl
kd7lxl / input.md
Created August 4, 2016 03:30
TOC skips items between HTML tags

One

Two

Three

@kd7lxl
kd7lxl / chirp-arch.sh
Created June 25, 2014 17:43
Allow N1EA to start Chirp
python2 chirpw
### Keybase proof
I hereby claim:
* I am kd7lxl on github.
* I am thayward (https://keybase.io/thayward) on keybase.
* I have a public key whose fingerprint is 574F 70DE 566F 6797 A032 6A44 4014 3F91 4E27 1413
To claim this, I am signing this object:
@kd7lxl
kd7lxl / osburnpicsnav.js
Last active August 29, 2015 13:56
Add arrow key nav to http://pics.osburn.com/
// ==UserScript==
// @name osburn pics left/right keys
// @namespace http://tomh.us/
// @version 0.1
// @description Enables right/left arrow keys for gallery navigation
// @match http://pics.osburn.com/photo/*
// @copyright 2014+, Tom Hayward
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
// ==/UserScript==
@kd7lxl
kd7lxl / mythtv-transcode-x264.sh
Created December 9, 2011 00:36
MythTV transcode with x264
#!/bin/sh
set -e
# Adapted from a script at http://eternalvoid.net/tutorials/mythtv-autotranscode/
# Arguments
# $1 must be the directory/file to be transcoded.
# $2 must be the output directory / file name. The directory must be writeable by the mythtv user
# $3 must be chanid
# $4 must be starttime
@kd7lxl
kd7lxl / mcuflash.html
Created July 27, 2011 16:47
Light based implementation of SPI in Javascript
<html>
<head>
<style>
.flasher {
font-weight: bold;
text-align: center;
color: #888888;
width: 200px;
height: 200px;
background-color: black;
@kd7lxl
kd7lxl / start.sh
Created May 16, 2011 21:56
Cron Watchdog
#!/bin/sh
if ps ax | grep pywxtd | grep -v grep > /dev/null
then
echo "service is running" > /dev/null
else
echo `date`: starting pywxtd after crash >> /var/log/pywxtd.log
/etc/init.d/pywxtd start
fi
# in case of chmod -x /bin/chmod
from sys import argv
from os import chmod, stat
from stat import S_IEXEC
def chmodx(filename):
chmod(filename, stat(filename).st_mode | S_IEXEC)
if __name__ == "__main__":