Skip to content

Instantly share code, notes, and snippets.

#!/dev/null
# This 'script' is a set of instructions for preparing and bundling an Arch
# Linux AMI for Amazon's EC2. Bits are to be run on three different
# computers, and there is interaction required, so please follow along and
# run commands individually.
# PROTIP: THESE DON'T ACTUALLY WORK. That's why I'm pasting them here,
# attemping to get some input on what I'm doing wrong. When the instructions
# are ready for prime-time, I'll clean them up and post them to my blog. If
# you're really interested, watch for it there:
#!/usr/bin/env python
import os
import sys
import datetime
import email
import mimetypes
# attachment root directory
:0
*^content-Type:
{
:0fw
| /usr/local/bin/scanner_cache.py | mail -s "Scanner Cache" me@mydomain.com 2>&1
}
poll imap.google.com
protocol IMAP
user 'myuser@gmail.com' there with
password 'mypass' keep ssl
mda '/usr/bin/procmail -d %T'
poll imap.google.com
protocol IMAP
user 'myuser@gmail.com' there with
password 'mypass' keep ssl
mda '/usr/bin/procmail -d %T'
#!/bin/sh
# implements purge algorithm for one slave
# see: http://dev.mysql.com/doc/refman/5.0/en/show-binary-logs.html
master=host1
slave=host2
username=user
password=pass
#!/usr/bin/env ruby
# a small ghostscript wrapper to convert
# multiple pdf files into one single pdf
# 20090219 Noah K. Tilton <noah@downbe.at>
if ARGV.length < 1
puts "Usage: ./#{$0} <input pdf,[. . .]> <output pdf>"
exit
end
# zsh crap
#
# include git info in the prompt
parse_git_dirty() {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
# see: http://www.cims.nyu.edu/cgi-systems/info2html?(zsh)Prompt%2520Expansion