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 / package_list_diff.py
Created June 16, 2010 20:22
Compares two text files and outputs the differing lines (like diff without the extra stuff)
#!/usr/bin/env python
from sys import argv,exit
def list_strip(list):
new_list = []
for line in list:
if not line.strip():
continue
else:
#!/usr/bin/env python
import pprint
from HTMLParser import HTMLParser
from urllib2 import urlopen
class Spider(HTMLParser):
line = []
output = []
# 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__":
@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
@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 / 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 / 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==
### 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 / chirp-arch.sh
Created June 25, 2014 17:43
Allow N1EA to start Chirp
python2 chirpw
@kd7lxl
kd7lxl / input.md
Created August 4, 2016 03:30
TOC skips items between HTML tags

One

Two

Three