Skip to content

Instantly share code, notes, and snippets.

View jathanism's full-sized avatar
🍕
See below.

Jathan McCollum jathanism

🍕
See below.
View GitHub Profile
,_ ,_ _, _,
| '. '. .' .' |
\ \ \ / / /
'.__\_|_ _|_/__.'
/` '. .' `\
/ dt) (mb \
/ __.' '.__ \
.' (_ _) '.
.' \'-._.===========._.-'/ '.
@jathanism
jathanism / commanduo.py
Created January 16, 2013 02:01
A ``ReactorlessCommando`` subclass that allows for running multiple Commando instances in the same program under the same reactor by preventing the instances from doing it themselves.
# commanduo.py - Running multiple Commando's in the same script
from trigger.cmds import Commando as CommandoBase
from twisted.internet import defer, task, reactor
from twisted.python import log
import sys
# Uncomment me for verbose logging.
#log.startLogging(sys.stdout, setStdout=False)
@jathanism
jathanism / aimfight.sh
Created February 13, 2013 22:46
AIM Fight CLI version (http://aimfight.com)
#!/bin/sh
if test $# -eq 2
then
response=`curl -s "http://www.aimfight.com/getFight.php?name1=$1&name2=$2"`
noamp=`echo $response | tr '&' ' '`
noeql=`echo $noamp | tr '=' ' '`
echo $1 = $(echo $noeql | awk '{ print $4 }')
echo $2 = $(echo $noeql | awk '{ print $6 }')
else
echo Usage aimfight [screenname1] [screenname2]
@jathanism
jathanism / shon.py
Last active December 13, 2015 18:18
Shon testing.
# shon.py - Shon test for Graphite debugging...
def eval_graphite_data(data, seconds):
"""Get the most recent correct value from the data"""
_name = "eval_graphite_data"
print _name, ' DATA:', data
print _name, ' SECONDS:', seconds
sample_period = int(data.split('|')[0].split(',')[-1])
all_data_points = data.split('|')[-1].split(',')
@jathanism
jathanism / highborg.py
Created March 6, 2013 14:56
Implementations of the Highlander (Singleton) and Borg (Monostate) patterns for keeping globally accessible data.
"""
highborg.py - Highlander vs. Borg.
Implementations of the Highlander (Singleton) and Borg (Monostate) patterns for
keeping globally accessible data.
New-Style Highlander credit:
http://code.activestate.com/recipes/66531-singleton-we-dont-need-no-stinkin-singleton-the-bo/#c22
New-Style Borg credit:
@jathanism
jathanism / textmonster.py
Last active December 14, 2015 14:18
Chainable regex objects.
# textMonster 1.0.0
# by Mark Christian
# http://markchristian.org/projects/textmonster
#
# textMonster is licensed under a Creative Commons
# Atttribution 3.0 license:
# http://creativecommons.org/licenses/by/3.0/
import re
@jathanism
jathanism / config
Created May 21, 2013 20:13
privoxy config
# Sample Configuration File for Privoxy v3.0.19
#
# $Id: config,v 1.98 2011/12/26 17:04:50 fabiankeil Exp $
#
# Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/
#
####################################################################
# #
# Table of Contents #
# #

found at: http://fascinated.fm/post/2379188731/getting-a-motorola-sbg6580-into-bridge-mode-on

Getting a Motorola SBG6580 into “Bridge” mode on TimeWarner Wideband

  1. Unplug coax cable from Motorola
  2. Hold down the white reset button on the back panel with a pen for 30s.  This resets all settings to factory defaults. The modem will be auto-reconfigured once you plug in the coax cable.
  3. When modem is back on plug in a computer with an Ethernet cable into the modem.
  4. Connect to http://192.168.0.1 and login with “admin” / “motorola”
  5. Now you will make some changes:
 
  • Wireless -> Primary Network -> Disabled
@jathanism
jathanism / chkconfig
Created June 29, 2013 20:07
Enclosed please find code and man page of a bash+sed script that uses update-rc.d to emulate the behavior of the IRIX/Red-Hat chkconfig tool Try a few invocations with --dryrun to see exactly what it does -- that switch makes it print the generated commands rather than executing them. | Author: Eric S. Raymond | Source: https://lists.ubuntu.com/…
#!/bin/bash
#
# chkconfig -- list, enable, and disable system services by runlevel
#
# By Eric S. Raymond, May 2007. Released under BSD license.
#
# This is an emulation of the IRIX chkconfig tool to run over Debian/Ubuntu
# (it calls update-rc.d, the native tool, to do the actual work). Also
# requires sed(1) and runlevel(8).
#
@jathanism
jathanism / chkconfig.8
Created June 29, 2013 20:09
Man page for the `chkconfig` bash script by Eric S. Raymond. | Author: Eric S. Raymond | Source: https://lists.ubuntu.com/archives/upstart-devel/2007-May/000415.html | Script code: https://gist.github.com/jathanism/5892482
.TH CHKCONFIG 8 "Wed Oct 8 1997"
.UC 4
.SH NAME
chkconfig \- updates and queries runlevel information for system services
.SH SYNOPSIS
\fBchkconfig\fR \fB--list\fR [\fIname\fR]
.br
\fBchkconfig\fR [\fB--dryrun\fR] \fB--add\fR \fIname\fR
.br