Skip to content

Instantly share code, notes, and snippets.

# 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
#!/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
#!/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
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'
:0
*^content-Type:
{
:0fw
| /usr/local/bin/scanner_cache.py | mail -s "Scanner Cache" me@mydomain.com 2>&1
}
#!/usr/bin/env python
import os
import sys
import datetime
import email
import mimetypes
# attachment root directory
#!/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:
# tmux for non-root user
wget 'http://downloads.sourceforge.net/project/tmux/tmux/tmux-1.2/tmux-1.2.tar.gz?use_mirror=cdnetworks-us-1'
wget http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz
tar zxvf libevent-1.4.13-stable.tar.gz
tar zxvf tmux-1.2.tar.gz
cd libevent-1.4.13-stable
./configure --prefix=~/opt/libevent-1.4.13-stable
make -j 5
make install
directory = /download/queue
. . .
schedule = watch_directory_1,5,5,"load_start=/download/torrents/tracker1.com/*.torrent,d.set_custom1=/download/tracker1.com/"
schedule = watch_directory_2,5,5,"load_start=/download/torrents/tracker2.com/*.torrent,d.set_custom1=/download/tracker2.com/"
system.method.set_key =event.download.finished,move_complete,"d.set_directory=$d.get_custom1= ;execute=mv,-u,$d.get_base_path=,$d.get_custom1="
. . .