Skip to content

Instantly share code, notes, and snippets.

View dhgwilliam's full-sized avatar

David Gwilliam dhgwilliam

View GitHub Profile
ip javascript:function%20iprl5(){var%20d=document,z=d.createElement('scr'+'ipt'),b=d.body;try{if(!b)throw(0);d.title='(Saving...)%20'+d.title;z.setAttribute('src','http://www.instapaper.com/j/nijrvpmNKlkV?u='+encodeURIComponent(d.location.href)+'&t='+(new%20Date().getTime()));b.appendChild(z);}catch(e){alert('Please%20wait%20until%20the%20page%20has%20loaded.');}}iprl5();void(0) Read Later
ip! http://instapaper.com/u Instapaper
read javascript:(function(){readStyle='style-newspaper';readSize='size-medium';readMargin='margin-wide';_readability_script=document.createElement('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_readability_script);_readability_css=document.createElement('LINK');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_reada
@dhgwilliam
dhgwilliam / IISY.rb
Created November 25, 2010 08:23
is it shabbos yet microsite
require 'sinatra'
require 'date'
require 'icalendar'
require 'net/https'
get '/' do
is_it_shabbos_yet
end
#!/usr/bin/env bash
# /home/david/.dropbox-dist/dropboxd &
gsynaptics-init &
urxvtd -q -o -f &
#urxvtc -e screen -R -d &
wicd-client &
export DISPLAY=:0.0 &
xsetroot -cursor_name left_ptr &
volwheel &
caker: dhgwilliam: I *think* /proc/xen/ will only ever exist in dom0 (or at maybe any privileged domain)
caker: HTH
caker: at least, it doesn't exist in pv_ops domUs kernels that I just checked
caker: grep control_d /proc/xen/capabilities <-- dom0 test, looks like
@dhgwilliam
dhgwilliam / gist:3171227
Created July 24, 2012 17:05
Install Guide for Puppet Open Source

Converting Puppet Open Source Edition to Puppet Enterprise

Installing OSE - Ubuntu 10.04.4 LTS - Master

master# echo "10.16.1.2 master master.puppetlabs.lan" >> /etc/hosts
master# echo "master" > /etc/hostname
master# hostname -F /etc/hostname # log out & in
master# wget http://apt.puppetlabs.com/puppetlabs-release_1.0-3_all.deb
master# dpkg -i puppetlabs-release*.deb
master# apt-get update

master# vi /usr/sbin/policy-rc.d # paste the following

@dhgwilliam
dhgwilliam / _Vagrantfile
Created July 25, 2012 23:13
vagrantfile include for centos-5.5 box
Vagrant::Config.run do |config|
config.vm.provision :shell, :inline => "iptables -F; wget http://mirror.symnds.com/distributions/fedora-epel/5/i386/epel-release-5-4.noarch.rpm && yum localinstall epel*.rpm --nogpgcheck -y"
end
#!/bin/bash
NEW='/tmp/certlist.new'
OLD='/tmp/certlist.old'
touch $NEW $OLD
puppet cert list --all > $NEW
NEWHASH=`md5sum $NEW | cut -f1 -d " " `
OLDHASH=`md5sum $OLD | cut -f1 -d " " `
if [ "$NEWHASH" != "$OLDHASH" ]
@dhgwilliam
dhgwilliam / gist:3759741
Created September 21, 2012 04:41
top 100 words in my SMS conversations
30752.0 i
24063.0 you
21905.0 to
15916.0 the
13894.0 a
12980.0 and
9284.0 im
8593.0 in
8380.0 that
7954.0 it
# Colors vary depending on time lapsed.
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
# Determine the time since last commit. If branch is clean,
# use a neutral color, otherwise colors will vary according to time.
function git_time_since_commit() {
if git rev-parse --git-dir > /dev/null 2>&1; then
#!/bin/bash
find . -name "*.pp" -print0 | xargs -0 puppet-lint --no-80chars-check --no-2sp_soft_tabs-check --with-filename --no-trailing_whitespace-check --no-hard_tabs-check --no-arrow_alignment-check > puppet.lint
grep "WARNING" puppet.lint | cut -d ":" -f 1 | sort | uniq -c | sort -gb > puppet.lint.warnings
grep "ERROR" puppet.lint | cut -d ":" -f 1 | sort | uniq -c | sort -gb > puppet.lint.errors