Skip to content

Instantly share code, notes, and snippets.


David Wittman DavidWittman

View GitHub Profile
View gist:1390013
function mixInto(object, mixIn) {
forEachIn(mixIn, function(name, value) {
object[name] = value;
DavidWittman / youtube_couch_mode.user.js
Created Jan 9, 2012
Greasemonkey Script to add "Couch Mode" to YouTube
View youtube_couch_mode.user.js
// ==UserScript==
// @name YouTube Couch Mode
// @author David Wittman <>
// @namespace nowhere
// @description Adds a full-screen "Couch Mode" button to YouTube
// @include*
// ==/UserScript==
// iframe detection
DavidWittman /
Created Feb 22, 2012
A Brief Introduction to Fabric

A Brief Introduction to Fabric

Fabric is a deployment management framework written in Python which makes remotely managing multiple servers incredibly easy. If you've ever had to issue a change to a group servers, this should look pretty familiar:

for s in $(cat servers.txt); do ssh $s service httpd graceful; done

Fabric improves on this process by providing a suite of functions to run commands on the servers, as well as a number of other features which just aren't possible in a simple for loop. While a working knowledge of Python is helpful when using Fabric, it certainly isn't necessary. This tutorial will cover the steps necessary to get started with the framework and introduce how it can be used to improve on administering groups of servers.

DavidWittman / hubot.conf
Created Mar 6, 2012
Hubot Upstart Script
View hubot.conf
# hubot
description "Hubot Campfire bot"
author "David Wittman <>"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
# Path to Hubot installation
env HUBOT_DIR='/opt/hubot/'
View .vimrc
set t_Co=256
colors molokai
syntax on
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
set tabstop=4
set shiftwidth=4
set smarttab
set expandtab
set softtabstop=4
View gunicorn-upstart.conf.template
# %(mysite)s - run %(mysite)s instances (default is the prod instance)
# This runs gunicorn-django for %(mysite)s; to install:
# * sudo ln -s <this file> /etc/init/%(mysite)s
# * sudo initctl reload-configuration
# it expects the following directory layout:
# /home/%(mysite)s/public_html
# \-env -> virtualenv
DavidWittman /
Created Apr 5, 2012
MS12-020/CVE-2012-0002 Vulnerability Tester
#!/usr/bin/env python
MS12-020/CVE-2012-0002 Vulnerability Tester
based on sleepya's version @
import socket
import struct
import sys
DavidWittman / http-get.nse
Created Apr 6, 2012
Nmap HTTP GET request script
View http-get.nse
description = [[
Issues an arbitrary HTTP GET request
-- @usage
-- nmap --script http-get [--script-args http-get.path=/status] -p <port> <host>
-- @args http-get.path The path to request (defaults to /)
-- http-get.match String to match in the HTTP response (incl. headers)
-- @output
DavidWittman / .bashrc
Created May 16, 2012
boot - openstack-compute/nova wrapper for building Cloud Servers
View .bashrc
# boot
# openstack-compute/nova wrapper for building Cloud Servers
# usage: boot <image> <flavor> <name>
function boot() {
# API Credentials
local APIKEY=${OPENSTACK_COMPUTE_APIKEY-"8b843e51cecdae209efd541b6dd52c04"}
# Boot specifics
local FLAVOR=3
DavidWittman / default.vcl
Created Jun 1, 2012
Varnish VCL to detect and redirect file uploads
View default.vcl
backend default {
.host = "";
.port = "8080";
backend master {
.host = "10.x.x.x";
.port = "80";
sub vcl_recv {
# Any uploads or restarts should go to the master backend