Skip to content

Instantly share code, notes, and snippets.

Chris Agerton cagerton

Block or report user

Report or block cagerton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
cagerton /
Created May 15, 2019
Simple example for using udmx to control a monoprice rgbaw-uv dmx light
Simple rgb color fade tested with the monoprice rgbawuv
Requires python3.7 for the async coroutine syntax; should be trivial to backport though
cagerton / no_push_f_master.rb
Last active Mar 9, 2019
pre receive hook
View no_push_f_master.rb
#!/usr/bin/env ruby
# pre-receive hook to block 'push -f' on master
# For Phabricator, save this as:
# $REPO/hooks/pre-receive-phabricator.d/no_push_f_master.rb
# Remember to chmod +x
# Ref:
args = STDIN.readline.chomp.split(" ")
$oldrev, $newrev, $refspec = args
cagerton /
Created Aug 6, 2014
this saves 3 months of vpn setup
from flask import Flask, redirect, render_template, url_for, request
from flask_bootstrap import Bootstrap
import redis
import json
app = Flask(__name__)
r = redis.Redis()
cagerton /
Last active Aug 29, 2015
Simple script to fetch an ssh host key.
#!/usr/bin/env python2.7
"""Usage: <host> [<port>]"""
import paramiko, docopt
opt = docopt.docopt(__doc__)
host = opt['<host>']
port = int(opt['<port>'] or 22)
t = paramiko.Transport((host, port))
cagerton / hijack_touch.js
Created Dec 13, 2013
Generate click events on touchstart; kill the mouse events that the browser cooks 200+ms afterwards.
View hijack_touch.js
(function touchJack(){
var lastTouch = 0;
document.addEventListener("touchstart", function(e){
lastTouch =;
var touch = e.touches[0],
synth_event = document.createEvent("MouseEvents");
synth_event.initMouseEvent("click", true, true, window,
0, touch.screenX, touch.screenY, touch.clientX, touch.clientY,
View packages.sls
# Postgres 9.3 packages salt state
# Created 9/9/13
# author: Micah Hausler,
cagerton /
Last active Dec 25, 2015
Little python3.3 script to show information about ssh public keys from key files or known_hosts files.

SSH key info for pubkeys, known_hosts, and github users

Usage: hosts [<FILE>] key [<FILE>...] github <user>

$ github cagerton
cagerton /
Last active Dec 16, 2015
On storing password hashes

Upgrade sha1 => scrypt without user logging in/pw reset:


We hash passwords with one-way hash functions to reduce the impact of password database compromise. Passwords hashed with salted SHA or MD5 can ofen be brute forced. Newer password hashhing techniques like Scrypt/Bcrypt/PBKDF2 add computational work to make brute forcing prohibitively expensive.


Your service already has users with salted sha1 password hashes. Since you don't have their original passwords you can't upgrade to a modern password hash without getting each user to log in and enter their password.

You have (salt,sha(salt+password)), you want (salt, scrypt(salt,password))

cagerton /
Created Nov 12, 2012
Color fade test for PixelPusher
import socket
import time
from math import pi, sin
UDP_IP = ''
UDP_PORT = 9897
def Push(messages):
"""Stolen from:"""
assert type(messages) == list
cagerton / gist:1995257
Created Mar 7, 2012
Check your ssh public key fingerprint
View gist:1995257
# Run this command to check your ssh fingerprint.
ssh-keygen -l -f ~/.ssh/*.pub
You can’t perform that action at this time.