Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
SESSION_DIR = '/path/to/.sessions'
# ^ should match session_path from .rtorrent.rc
MV_DIR = '/downloads/complete/tracker1.com'
# ^ Change this to path these files should have been moved to
import os
import sys
\documentclass[12pt]{article}
\usepackage{fullpage}
\usepackage{fontspec}
\setromanfont{Liberation Serif}
\begin{document}
hello world
\end{document}
#!/bin/zsh
while [[ $# -gt 0 ]]; do
filename=$(basename $1)
new_filename=''
year=$(echo $filename | sed -n -e 's/.*\([0-9]\{4\}\).*/\1/p')
if [[ ! -z $year ]]; then
new_filename=$year
@noah
noah / sshrc
Created July 14, 2011 04:26 — forked from anonymous/sshrc
#!/bin/bash
# /etc/ssh/sshrc
# watchfile
ip=$(echo $SSH_CONNECTION | awk '{print $1}')
reverse=$(dig -x $ip +short)
echo $(date) | mutt -s "ssh login: $USER@$HOSTNAME from $reverse ($ip)" noahktilton@gmail.com
#!/bin/zsh
# simplify gnupod_addsong.pl syntax
#
# point it at a directory to add all .mp3 recursively
if [ $# -eq 0 ]; then
echo "$0 <dir>"
exit -1
fi
@noah
noah / mylsusb
Created February 11, 2012 02:30
Bus 002 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
@noah
noah / ga
Created March 13, 2012 14:50
#!/bin/zsh
# simplify gnupod_addsong.pl syntax
#
# point it at a directory to add all .mp3 and .flac recursively
# - encodes flac to V0 (-x mp3 -e 0 flag)
if [ $# -eq 0 ]; then
echo "$0 <dir>"
exit -1
#!/usr/bin/env ruby
# encoding: utf-8
#
require 'bencode'
# print the list of files which are in a given directory, but not currently seeding in rtorrent
#
# This script answers the question / problem:
# "I have a ton of stuff downloading in rtorrent, and it's all going
# into one directory. What stuff from that directory can be safely
#!/usr/bin/python2
# rtorrent_xmlrpc
# (c) 2011 Roger Que <alerante@bellsouth.net>
# (c) 2013 Noah K. Tilton <lists@tilton.co>
#
# Python module for interacting with rtorrent's XML-RPC interface
# directly over SCGI, instead of through an HTTP server intermediary.
# Inspired by Glenn Washburn's xmlrpc2scgi.py [1], but subclasses the
# built-in xmlrpclib classes so that it is compatible with features
@noah
noah / rtomv
Created October 31, 2013 11:24
mv(1) for rtorrent(1)
#!/usr/bin/env python2
print "ohai"