home

code snippets

important disclaimers

by language

java
perl
C
bash
ruby
python
awk
CSS
javascript (browser)
javascript (node)
misc

java


Luhn

An implementation of the Luhn check digit algorithm.
Useful for validating credit card numbers.
Usage: Edit Luhn.java.
View on GitHub

perl


fcpool-api-fetch

Fetches data from FCPool's JSON API given a user's API key.
Reads the API key from either a file or the command line.
Update: This service appears to be shut down.
Usage: fcpool-api-fetch <api-key>
View on GitHub

d2pool-api-fetch

Fetches data from ftc.d2.cc's JSON API given a user's API key.
Functions similarly to fcpool-api-fetch, but uses HTTPS.
Update: This service appears to be shut down.
Usage: d2pool-api-fetch <api-key>
View on GitHub

wtf-urban

Uses Urban Dictionary's API to find definitions matching the query word.
Inspired by NetBSD's 'wtf' acronym-expanding script. Now a full perl module!
Usage: wtf-urban <word> [-l number]
View on GitHub

grayscale

Grayscales a given image and stores it as "grayscale.png," all using ImageMagick.
Usage: grayscale <image>
View on GitHub

randomimage

Generates a pseudorandom image using perl's rand() and ImageMagick.
If dimensions are not provided, a 500x500 image is generated.
Usage: randomimage [WIDTHxHEIGHT]
View on GitHub

nycdoe-fetch-attendance

Checks the NYC DOE XML API for daily attendance statistics for a given school.
Update: This service appears to be shut down.
Usage: nycdoe-fetch-attendance <"school name" | DBN>
View on GitHub

mk-qrcode

Generates a QR code image based upon textual user input.
Uses Imager::QRCode.
Usage: mk-qrcode <module size> <text>
View on GitHub

twitter-fortune-bot

Uses the Twitter REST API (1.1) to tweet fortunes from the "fortune" utility.
Important: You must add your own application/API keys to your environment.
For an example, see robot_fortune on Twitter.
Usage: twitter-fortune-bot
View on GitHub

magnet-to-torrent

Converts magnet links to torrent files using magnet2torrent.com.
Important: Bulk transactions through this script may not be appreciated by magnet2torrent's owners.
Update: This service has changed, and this script may no longer work.
Usage: magnet-to-torrent <'magnet link'>
View on GitHub

puush-scraper

Scrapes images and other files off of puush using trial-and-error.
Uses MIME headers to detect the correct file extension, defaulting to ".other" if not a text file or common image.
Update: puush appears to be using a new URL schema, and has been IP banning clients that use this script.
Usage: puush-scraper <number of files>
View on GitHub

fetch-math-finals

Fetches PDFs of previous mathematics finals for the given course from UMD's MathNet Test Bank.
Capable of grabbing finals from MATH, AMSC, and STAT courses.
Update: UMD has migrated its database to Google Drive. This script no longer works.
Usage: fetch-math-finals <course code>
View on GitHub

hexchat-gmb-nowplaying

A HexChat plugin that interfaces with gmusicbrowser via DBus.
Grabs information about the current song and ACTIONs it to the channel.
Requires Net::DBus.
Usage: /gmb-nowplaying
View on GitHub

hexchat-rainbow

A HexChat plugin that rainbowifies text.
Usage: /rb <text>
View on GitHub

hexchat-homoglyph

A HexChat plugin that converts text into visually similar homoglyphs.
Usage: /hg <text>
View on GitHub

hexchat-spacing

A HexChat plugin that spaces text out.
Usage: /sp <text>
View on GitHub

hexchat-america

A HexChat plugin that makes text red, white, and blue.
Usage: /america <text>
View on GitHub

hexchat-ezfmt

A HexChat plugin that provides basic text formatting.
Usage: /fmt *italics*, _underline_, and +bold+
View on GitHub

hexchat-fullwidth

A HexChat plugin that provides fullwidth text conversion.
Usage: /fw <text>
View on GitHub

hexchat-latex

A HexChat plugin that provides LaTeX symbol substitution.
Usage: \forall x \in \mathbb{R}
View on GitHub

hexchat-clap

A HexChat plugin that emphasizes👏your👏point👏.
Usage: /clap <text>
View on GitHub

verhoeff

A table implementation of the Verhoeff check digit algorithm.
Can be used to validate a numerical string or generate a check digit for an existing one.
Usage: verhoeff <validate | generate> <number>
View on GitHub

damm

A table implementation of the Damm check digit algorithm.
Can be used to validate a numerical string or generate a check digit for an existing one.
Usage: damm <validate | generate> <number>
View on GitHub

upc

A Universal Product Code (UPC) check digit validator.
Usage: upc <upc>
View on GitHub

sedol

A Stock Exchange Daily Official List (SEDOL) ID check digit validator.
Usage: sedol <sedol id>
View on GitHub

issn

An International Standard Serial Number (ISSN) check digit validator.
Usage: issn <issn>
View on GitHub

aba-rtn

An ABA Routing Transit Number (RTN) check digit validator.
Usage: aba-rtn <rtn>
View on GitHub

vin

A North American Vehicle Identification Number (VIN) check digit validator.
Usage: vin <vin>
View on GitHub

C


rot13

A tiny C99 implementation of the ROT13 Caesarian cipher.
Reads text from standard input.
Usage: rot13
View on GitHub

mersenne

A C99 implementation of the "Mersenne Twist" pseudorandom number generator.
Usage: Edit mersenne.c.
View on GitHub

mesg

A quick and dirty popup box for Batch scripts on Windows.
Usage: mesg.exe <message> [title].
View on GitHub

perm

A small utility for obtaining the permission bits of a file on Linux/Unix systems.
Outputs both standard string notation (i.e. 'rwxrwxrwx') and octal notation (i.e. '755').
Usage: perm <-s|-n <file>>
View on GitHub

battstat

Outputs system battery information obtained through sysfs.
Usage: battstat
View on GitHub

cond

A dumb conditional checker that makes asking for user confirmation simple.
Usage: cond [message]
Example: if cond "Continue?" ; then echo "Continuing..." ; fi
View on GitHub

eject

A minor nuisance, copied from the (discontinued) nuisances project.
Ejects disks (or just opens the drive) randomly and repeatedly. Relies on the Windows API.
Usage: eject.exe
View on GitHub

locks

A minor nuisance, copied from the (discontinued) nuisances project.
Randomly activates various control and modifier keys repeatedly. Relies on the Windows API.
Usage: locks.exe
View on GitHub

bf

A small C program that converts Brainfuck source files into C source files.
Uses a 30,000 byte stack, like the original implementation.
Usage: bf <input.bf> <output.c>
View on GitHub

tss

A tiny screenshot program.
Uses Xlib to dump the screen and libpng to save it as a PNG.
Usage: tss <filename>
View on GitHub

mntinfo

Gets information about the given filesystem from /etc/mtab and statvfs(3).
The output is formatted to ease parsing with grep and awk.
Usage: mntinfo <fs name>
Example: mntinfo /dev/sda1 | grep 'f_bsize' | awk '{ print $2 }'
View on GitHub

jellybean_trigger*

Monitors a Jellybean Button using ALSA's libesd.
When pressed, executes the supplied command (and arguments).
Modified from Rogach's Piano Pedal Driver (blog post).
Usage: jellybean_trigger <npeaks> <command [arg ...]>
Example: jellybean_trigger 64 echo "click!"
View on GitHub

fstrings

A "fast", naive implementation of the strings utility.
Doesn't care about executable formats, has no dependencies.
Usage: fstrings [-n size] [file]
Example: fstrings -n 15 /bin/ls
View on GitHub

bfdtargs

Dumps each target supported by BFD, one per line.
Usage: bfdtargs
Example: bfdtargs
View on GitHub

bash


collapse

Collapses the given directory into its parent directory.
Usage: collapse <directory>
View on GitHub

robot-ftp

Crawls a given list of IPs, FTPing into them and leaving a message.
Usage: robot-ftp <IP file> <message file>
View on GitHub

read-qrcode

Reads the provided QR image, outputting its comments.
Usage: read-qrcode <image>
View on GitHub

git-aliases

A set of aliases for common git SCM commands.
To install, either copy the git-aliases file into your shell's profile or include it with a command like source /path/to/git-aliases.
Usage: Call any of the aliases.
View on GitHub

pathconfusion

A minor nuisance, copied from the (discontinued) nuisances project.
Messes with the user's $PATH, placing fake programs or wiping the $PATH altogether.
Usage: pathconfusion
View on GitHub

cskel

Generate a skeleton C file containing a main function and some common includes.
Not very useful, except for quickly testing an idea.
Usage: cskel [filename]
Example: vim `cskel test` # opens test.c in vim.
View on GitHub

jskel

cskel, but for java skeleton files.
Usage: jskel [filename]
Example: vim `jskel test` # opens test.java in vim.
View on GitHub

haste

A tiny script for posting files/standard input on Hastebin.
Lighter than haste-client, and more versatile than its recommended shell alternative.
Update: This script no longer works.
Usage: haste [file]
Example: my_program | haste.sh # or haste myfile.
View on GitHub

upload

Attempt to upload a file to a few different online filesharing services in sequence.
Currently tries pomf.se and teknik.io before bailing out.
Usage: upload <file>
View on GitHub

sscc

Attempt to take a fullscreen or selection screenshot by cascading through common screenshot utilities.
Currently tries gnome-screenshot and scrot before bailing out.
Usage: sscc [-s] <file>
View on GitHub

imgs2pdf

Converts a directory of images to a single PDF document.
Uses convert from ImageMagick.
Usage: imgs2pdf <directory> <output.pdf>
View on GitHub

flac2mp3

Converts FLAC files into MP3s in bulk.
Uses ffmpeg or avconv to perform the conversions.
Usage: flac2mp3 [-sdvh] [-j jobs] [directory]
View on GitHub

poomf*

Upload to sr.ht and teknik.io.
Heavily modified from Joe Schillinger's poomf.sh (now uguu).
Usage: poomf <-i | -f | -s | -u <file> | -h>
View on GitHub

play

Plays a URL or file, leveraging youtube-dl and livestreamer if installed.
Usage: play <file or URL>
View on GitHub

mp3art

Adds album artwork to MP3s in bulk.
Usage: mp3art [-svh] [-f artfile] [-j jobs] [directory]
View on GitHub

flacart

Adds album artwork to FLACs in bulk.
Usage: flacart [-svh] [-f artfile] [-j jobs] [directory]
View on GitHub

mdmath

A basic preprocessor for LaTeX math equations in Markdown.
Reads LaTeX math formatting between @@...@@, converting it into embedded images.
latex.codecogs.com is used to perform the LaTeX to image conversion.
Known problems: Multiple blocks on the same line won't work (thanks, sed).
LaTeX commands that begin with an escape character will also not work (like \texttt).
Usage: mdmath <file> > output.md
View on GitHub

notify

Notifies the user with a popup message in X.
Does so by cascading through various notification programs.
Currently supports xmessage, zenity, and notify-send.
Usage: notify <message>
View on GitHub

radio

Stream various radio stations, identified by callsign.
Stations are loaded from ~/.radiorc. Example here.
Usage: radio <station | list>
View on GitHub

rip

Quick rip an audio CD into a specified format using abcde.
Usage: rip <flac | mp3>
View on GitHub

xontop

Adds or removes the 'above' property from an X11 window.
Usage: xontop [-b | -h] # -b removes the property
View on GitHub

tal

Stream This American Life by episode number.
Usage: tal <episode #>
View on GitHub

pid2xid

Prints the X Window ID (xid) associated with a process ID.
Known problem: xwininfo is stupid and may not be reporting correct window IDs.
Usage: pid2xid <pid>
View on GitHub

watch-thunderbird

Watch a Thunderbird profile for new emails, running a command whenever a new one appears.
Known problems: "New email" events are guesses based on inbox writes.
Only works when the user only has one profile.
Usage: watch-thunderbird <cmd>
View on GitHub

normalize-gifs

Normalize the supplied GIFs to the resolution specified by DIMS.
Usage: normalize-gifs <gifs ...>
Example: DIMS=500x500 normalize-gifs 1.gif 2.gif 3.gif
View on GitHub

git-fetch-pr

Fetch and check out a pull request from GitHub.
Usage: git-fetch-pr <PR #>
Example: git-fetch-pr 123
View on GitHub

git-move-commits

Move the last N commits on the current Git branch to a new branch.
Usage: git move-commits <branch> [# of commits]
Example: give move-commits foo-feature 2
View on GitHub

git-open-all

Opens all of the files changed in the current branch for editing in $EDITOR.
Usage: git open-all [base branch]
Example: EDITOR=vim git open-all upstream/master
View on GitHub

git-takeout

Take one or more files out of the last commit and re-commit it.
Usage: git takout <file> [file ...]
Example: git takeout src/oops.c
View on GitHub

git-clang-format-changed

Run clang-format on all changed C/C++ files.
Usage: git clang-format-changed
View on GitHub

git-unws

Remove all whitespace changes from the unstaged tree.
Usage: git unws
View on GitHub

git-dwtb

Be "done with this branch" by checking out to master and deleting the original branch.
Usage: git dwtb
View on GitHub

git-fork-remote

Create a remote from a GitHub fork, given a GitHub user's username.
Usage: git fork-remote <user>
Example: git fork-remote some-user
View on GitHub

clocbadge

Turns a cloc(1) linecount into a pretty badge.
Usage: clocbadge <FILE|DIR> ...
Example: clocbadge src/ test/
View on GitHub

fftitle

Adds a centered title to the first 10 seconds of a video.
Usage: fftitle <input> <title> <output>
Example: fftitle my_video.mp4 "my title" my_video_titled.mp4
View on GitHub

fftimelapse

Turns a video into a (soundless) 10x timelapse.
Usage: fftimelapse <input> <output>
Example: fftimelapse my_video.mp4 my_fast_video.mp4
View on GitHub

ffnicegif

Create a compact GIF from an input file.
Usage: ffnicegif <input> <output>
Example: ffnicegif my_video.mp4 my_gif.gif
View on GitHub

ffcat

Concatenate a bunch of inputs into a single output.
Usage: ffcat <output> <input [input ...]>
Example: ffcat my_big_video.mp4 *.mp4
View on GitHub

ffflagflip

Rotates an input by 180 degrees (a vertical flip) by setting the rotation flag in the metadata.
Usage: ffflagflip <input> <output>
Example: ffflagflip upside_down.mp4 rightside_up.mp4
View on GitHub

ffwatermark

Places a watermark image in the center of a video.
Usage: ffwatermark <input> <watermark> <output>
Example: ffwatermark original.mp4 my_logo.png watermarked.mp4
View on GitHub

ffautocrop

Auto-crops a video.
Usage: ffautocrop <input> <output>
Example: ffautocrop original.mp4 cropped.mp4
View on GitHub

ffclip

Extract a clip (start to end timestamps) from a video.
Usage: ffclip <input> <start> <stop> <output>
Example: ffclip input.mp4 00:00:10 00:00:15 output.mp4
View on GitHub

ffpreclip

Remove the beginning of a video.
Usage: ffpreclip <input> <timestamp> <output>
Example: ffpreclip input.mp4 00:00:10 output.mp4
View on GitHub

ffpostclip

Remove the end of a video.
Usage: ffpostclip <input> <timestamp> <output>
Example: ffpostclip input.mp4 00:00:10 output.mp4
View on GitHub

ffmono

Combines one or more stereo channels into a single mono channel.
Usage: ffmono <input> <output>
Example: ffmono left_channel_only.mp4 mono.mp4
View on GitHub

ffmonochrome

Converts a color video into a monochromatic one.
Usage: ffmonochrome <input> <output>
Example: ffmonochrome color.mp4 monochrome.mp4
Demo: YouTube
View on GitHub

ffreverse

Reverses a video (and its audio).
Usage: ffreverse <input> <output>
Example: ffreverse original.mp4 reversed.mp4
Demo: YouTube
View on GitHub

ffboxblur

Turn a vertical video into a 16:9 video with blurred sides.
Usage: ffboxblur <input> <output>
Example: ffboxblur original.mp4 blurred.mp4
View on GitHub

ffgolapse

Convert a sequence of GOPRO folders (containing images) into a timelapse.
Usage: ffgolapse <output>
Example: ffgolapse timelapse.mp4
View on GitHub

ffdeshake

Attempt to de-shake a video.
Usage: ffdeshake <input> <output>
Example: ffdeshake shaky.mp4 smooth.mp4
View on GitHub

ffstill

Create a video from a still image.
Usage: ffstill <input> <duration> <output>
Example: ffstill image.png 00:10:00 still.mp4
View on GitHub

ffdialtone

Generate a US (North American) dialtone with the given duration.
Usage: ffdialtone <duration> <output>
Example: ffdialtone 10 tone.wav
View on GitHub

ffsbs

Place two videos side-by-side.
Usage: ffsbs <left> <right> <output>
Example: ffsbs foo.mp4 bar.mp4 foobar.mp4
View on GitHub

fffaceblur

Attempt to blur faces within a video.
Important: The face detection in this script is rudimentary. Review the output for completeness.
Usage: fffaceblur <input> <output>
Example: fffaceblur input.mp4 blurred.mp4
Demo: YouTube
View on GitHub

ffdtmf

Generate a sequence of DTMF tones corresponding to the given number.
Usage: ffdtmf <number> <output>
Example: ffdtmf 5558675309 jenny.wav
Demo: YouTube
View on GitHub

ffspectrum

Generate a spectrograph video from an audio clip.
Usage: ffspectrum <input> <output>
Example: ffspectrum input.wav spectrum.mp4
View on GitHub

ffaudiovis

Create a video containing a few visualizations for an audio clip.
Usage: ffaudiovis <input> <output>
Example: ffaudiovis input.wav vis.mp4
Demo: YouTube
View on GitHub

ffnegate

Convert an input video into negated output video.
Usage: ffnegate <input> <output>
Example: ffnegate input.mp4 negated.mp4
Demo: YouTube
View on GitHub

ffmirror

Horizontally mirrors the input video.
Usage: ffmirror <input> <output>
Example: ffmirror input.mp4 mirrored.mp4
Demo: YouTube
View on GitHub

ffspin

Create a spinning animation of a still image or directory of stills.
Usage: ffspin <input> <output>
Example: ffspin still.png spin.gif
View on GitHub

ffsubshot

Take a screenshot at the given timestamp, with subtitles.
Usage: ffsubshot <input> <timestamp> <output>
Example: ffsubshot input.mkv 00:10:00 cap.png
View on GitHub

ffframes

Extract the frames from a video, at the specified rate.
Usage: ffframes <input> <output-dir>
Example: ffframes input.mkv frames/
View on GitHub

ffbake

Bake the subtitles in a subtitle stream into the main video stream.
Usage: ffbake <input> <output>
Example: ffbake input.mkv baked.mkv
View on GitHub

ffdetitle

Remove the title metadata from one or more inputs.
Usage: ffdetitle <input> [input ...]
Example: ffdetitle *.mkv
View on GitHub

vboxssh

Set up a temporary port forwarding rule to a VirtualBox VM and ssh through it.
Usage: vboxssh <vmname> [user]
Example: vboxssh ubuntu-vm root
View on GitHub

image-artifact-progression

Create a progression video of the quality degradation of an image.
Usage: image-artifact-progression <image> <output> [level]
View on GitHub

texbox

Reads lines of LaTeX from stdin, and renders centered them in a square PDF.
The generated PDF is saved as box.pdf in $PWD.
Usage: texbox
Example: texbox <<< $'this is\na test'
View on GitHub

imgresize

Resizes an image to the requested percentage.
Usage: imgresize <input> [scale%] [output]
Example: imgresize foo.png 25 small_foo.png
View on GitHub

partyhard

Create a hard-partying version of an image.
Usage: partyhard <input> <output>
Example: partyhard foo.png input.png output.gif
View on GitHub

docker-shellin

Use selecta to select a running Docker container to shell into.
Usage: docker-shellin
Example: docker-shellin
View on GitHub

quotecard

Generate a "card" image for a quote, with an optional author.
Usage: quotecard <quote> [author] <output>
Example: quotecard "tempus fugit" "Horace (Odes)" quote.png
View on GitHub

mupdf-prompt

Open a PDF using mupdf, prompting for a password if necessary.
Uses yad for the password dialog.
Usage: mupdf-prompt ARGS
Example: mupdf-prompt foo.pdf
View on GitHub

x509dump

Quickly dump an X.509 input (PEM or DER).
Usage: x509dump INPUT
Example: x509dump cert.pem
View on GitHub

asn1dump

Quickly dump an ASN.1 encoded input (PEM or DER).
Usage: asn1dump INPUT
Example: asn1dump cert.der
View on GitHub

ruby


git-contrib

Generates CONTRIBUTORS files for git repositories.
Capable of generating Markdown, CSV, and plain text.
Usage: git-contrib [--markdown | --csv]
View on GitHub

grabzit-screenshot

Takes a screenshot of a given website and saves it to the given file.
Uses Grabzit's API to do so.
Spoiler: Grabzit's API sucks and only takes thumbnails without a paid account. Don't use it.
Usage: grabzit-screenshot <url> <file>
View on GitHub

twitter-github-bot

A dumb Sinatra-based server that listens for repo release callbacks from GitHub.
Upon receiving an (authenticated) post, sends a digest to twitter.
For an example, see woodrufw on Twitter.
Usage: twitter-github-bot
View on GitHub

smtp-spoof-ruby

A line-by-line translation of the smtp-spoof python script.
Usage: smtp-spoof-ruby
View on GitHub

git-https2ssh

An awful script that haphazardly converts HTTPS remotes in git repositories into SSH remotes.
Only works half the time, and isn't very smart. Don't use it.
Usage: git-https2ssh
View on GitHub

cloud2butt-irc

A tiny Cinch bot that matches messages containing 'cloud' and substitutes all 'cloud's for 'butt's.
Inspired by the similar 'Cloud To Butt Plus' Chrome plugin.
Usage: cloud2butt-irc <irc.someserver.net> <'#chan1,#chan2,...'>
View on GitHub

haiku-critic

Another tiny Cinch bot that makes sure every message is in the form of a 5-7-5 haiku.
If the message does not match the syntax 5 // 7 // 5, the user is kicked.
Usage: haiku-critic <irc.someserver.net> <'#chan1,#chan2...'>
View on GitHub

xdcc*†

An Cinch XDCC file fetcher, modified from Mahdi Bchetnia's xdcc.
Released into the public domain.
Update: This script is old and buggy. Use the version linked instead.
Usage: xdcc <irc.someserver.net> <bot_name> <pack_number> [-c channel] [-d directory]
View on GitHub

ibip-check

A Cinch bot that scans a channel for IBIP compliant bots and reports information about them.
Usage: ibip-check <irc.someserver.net> <'#channel'>
View on GitHub

phishbot

A Cinch bot and control script that spawn a bunch of phishing bots that look like 'NickServ'.
When messaged privately, each bot reports the contents of the message back to a designated channel.
Usage: run # should be edited to change server/channels
View on GitHub

socketdump

Dumps a file into a socket, base64 encoded and headed by a hash and name.
Useful for quickly shooting data between two machines.
Complemented by socketslurp.
Usage: socketdump <port> <file>
View on GitHub

socketslurp

Reads a base64 encoded file from a socket, validating it using a SHA1 hash.
Useful for quickly shooting data between two machines.
Complemented by socketdump.
Usage: socketslurp <hostname> <port>
View on GitHub

image-glitch

'Glitch' an image by compositing it over itself at various coordinates and with various operations.
Creates the appearance of a corrupted image without damaging the file's integrity.
To glitch multple images together, see images-glitch.
Usage: image-glitch <image> [glitch level]
View on GitHub

images-glitch

'Glitch' multiple images together by repeatedly compositing them at various coordinates and with various operations.
Creates the appearance of a corrupted image without damaging the file's integrity.
To glitch only a single image, see image-glitch.
Usage: images-glitch <glitch level> <file1 file2 [file3 ...]>
View on GitHub

image-bork

Bork an image by repeatedly applying various filters and effects to it.
Creates the appearance of a corrupted image without damaging the file's integrity.
Usage: image-bork <image> [bork level]
View on GitHub

alexa500

Scrapes the Alexa.com 'top sites' ranking for the 500 most trafficked websites.
Uses Nokogiri and dumps the output to stdout.
Usage: alexa500 > output
Update: Alexa appears to have changed their HTML; this script no longer works.
View on GitHub

fortune500

Scrapes the Fortune 500 companies from uspages.com for their company websites.
Uses Nokogiri and dumps the output to stdout.
Usage: fortune500 > output
Update: uspages.com appears to have changed their HTML; this script no longer works.
View on GitHub

validate_sites

Reads a newline-delimited stream of website addresses from stdin, testing each's markup validity with the Nu HTML Validator.
Uses vnu.jar and formats the output as <site> <warning count> <error count>.
Usage: cat sites | validate_sites > results
View on GitHub

nypd-crime-data

Fetches aggregated crime data from each NYPD precinct in PDF format.
Usage: nypd-crime-data
View on GitHub

image-artifact

Exacerbate artifacts in an image by repeatedly opening and writing it at varying low JPEG qualities.
Creates the appearance of a corrupted image without damaging the file's integrity.
Usage: image-artifact <image> <count>
View on GitHub

sdate

Prints today's Eternal September date in asctime format.
Inspired by (and much shorter than) the original sdate.
Usage: sdate
View on GitHub

email-fwd

A quick and dirty raw email forwarder.
Reads addresses and credentials from ~/.email-fwd. Example config here.
Usage: email-fwd
View on GitHub

umd-dining-balance

Fetch UMD dining plan balance data for a given student, by Directory ID.
Usage: umd-dining-balance <username> <password>
View on GitHub

umd-incident-logs

Fetch UMD crime and incident logs for the given month and year and dump them as JSON.
Usage: umd-incident-logs <month> <year>
View on GitHub

umd-arrest-ledger

Fetch UMD arrest records for the given year and dump them as JSON.
Usage: umd-arrest-ledger <year>
View on GitHub

sms

Send SMS/MMS messages using SMTP gateways provided by cellular companies.
Supports most large (US) cellular providers and reads from stdin.
Reads SMTP credentials and information from ~/.smsrc. Example config here.
Important: Your email provider may not appreciate the volume of mail produced by this script.
Usage: sms <phone number>
View on GitHub

uspatent

Fetches a filed US patent by number in PDF format.
Usage: uspatent <patent number>
View on GitHub

canvas-grades

Get a student's current term grades from Canvas.
Tested on UMD ELMS. Requires an access token (/profile/settings).
Usage: canvas-grades
View on GitHub

albumart

Fetch an album's cover art using Last.fm's search API.
Only retrieves large and extralarge images.
Images are saved as cover.png in $CWD.
Usage: albumart <query>
View on GitHub

liferea-yt-feed

Adds a YouTube channel to Liferea.
Works with both old (/user/) and new (/channel/)-style YouTube channels.
Important: This script uses liferea-add-feed, which is known to segfault on some versions of Liferea.
Usage: liferea-yt-feed <channel url>
View on GitHub

newsbeuter-yt-feed

Adds a YouTube channel to newsbeuter.
Works with both old (/user/) and new (/channel/)-style YouTube channels.
Important: newsbeuter is no longer maintained. newsboat is a maintained fork. See newsboat-yt-feed below.
Usage: newsbeuter-yt-feed <channel url>
View on GitHub

newsboat-yt-feed

Adds a YouTube channel to newsboat.
Works with both old (/user/) and new (/channel/)-style YouTube channels.
Usage: newsboat-yt-feed <channel url>
View on GitHub

ssqdb

A tiny static quote DB, inspired by QDB.
Usage: ssqdb </path/to/quotes.txt> [output directory] [options]
Demo: Favorite Quotes
View on GitHub

ffmpeg-mosaic

Composes a list of videos into an NxM "mosaic" of specified dimensions.
Usage: ffmpeg-mosaic [--throttle] <dim> <NxM> <output> <file1 file2 ...>
Example: ffmpeg-mosaic 1920x1080 2x2 mosaic.mp4 source{1..4}.mp4
View on GitHub

gif-length-groups

Given N GIFs, compose them into random groups such that each group has the given total length.
Then, combine each group of GIFs into a single a single large GIF and save it.
Usage: gif-length-groups [-n <groups>] [-l <len>] [-i <len>] [-d <dir>] <gifs ...>
Example: gif-length-groups -l 60 -d groups *.gif
View on GitHub

giphy-fetch

Fetch animated GIFs from Giphy and save them to a directory.
Usage: giphy-fetch [--directory <dir>] <query>
Example: giphy-fetch --directory dogs "cute dogs"
View on GitHub

forecast

Fetch the weather forecast from Wunderground.
Update: Wunderground seems to be slowly breaking their API.
Usage: forecast <query>
Example: forecast washington dc
View on GitHub

rubyvm-dump

Dumps a Ruby script as a compiled sequence of (YARV) instructions.
Usage: rubyvm-dump [--marshal] <file>
Example: rubyvm-dump.rb my-script
View on GitHub

git-gem-release-tag

Tags, builds, and pushes a new RubyGem based on a gemspec in $PWD.
Usage: git-gem-release-tag [--dry-run]
Example: git-gem-release-tag
View on GitHub

git-shard-release-tag

Create a git tag for a Crystal shard's version.
Usage: git-shard-release-tag [--dry-run]
Example: git-shard-release-tag
View on GitHub

msmtp

A tiny terrible SMTP server that pipes emails into a given command.
Usage: [sudo] msmtp <cmd>
Example: msmtp 'cat'
View on GitHub

git-lint-commit

A small Git commit message linter.
Usage: git-lint-commit [commit|-]
Example: git-lint-commit HEAD~1
View on GitHub

fetch-bbc-sfx

Fetch the entire BBC Sound Effects Archive.
Important: All sound effects are copyrighted by the BBC and are licensed under the RemArc license.
Usage: fetch-bbc-sfx
View on GitHub

urlgrep

Read input files and print lines that contain valid URIs/URLs.
Usage: urlgrep [-p PROTOS] [FILE ...]
Example: urlgrep -p http,https <(curl example.com)
View on GitHub

vbnla

Read an nginx access.log from stdin and dump some quick statistics.
Usage: vbnla < /path/to/logfile.log
Example: vbnla < /var/log/nginx/access.log
View on GitHub

freeotpp2qr

Reads a FreeOTPPlus JSON backup from stdin and presents each OTP key as a QR for importing into another authenticator.
Requires qrencode, feh, and the base32 gem.
Usage: freeotpp2qr < /path/to/your/otp/backup.json
View on GitHub

ronnpp

A crappy preprocessor for ronn.
Usage: ronnpp < input.ronnpp > output.ronn
View on GitHub

reorient

Extracts orientation flags from images and reorients them.
Usage: reorient <input> [input ...]
Example: reorient *.jpg
View on GitHub

hexchat-emoji-replace

Generates a HexChat-style text-replacement file for using :short-name: emoji.
Usage: hexchat-emoji-replace >> ~/.config/hexchat/replace.conf
Example: hexchat-emoji-replace >> ~/.config/hexchat/replace.conf
View on GitHub

python


smtp-spoof

Spoofs SMTP transactions with raw sockets.
Allows the user to send email from any address (but not any IP).
Usage: smtp-spoof
View on GitHub

panix-numbers

Get Panix dialup numbers for a given area code.
Numbers are scraped from Panix's public numbers.
Usage: panix-numbers <area code>
View on GitHub

pandora-mpv*

Stream a Pandora station into mpv.
Uses Pithos to acquire a stream and Lars Gustäbel's python-mpv to control mpv.
Pandora credentials are read from the environment as PANDORA_EMAIL and PANDORA_PASSWORD.
Usage: pandora-mpv ['station'] # uses QuickMix by default
View on GitHub

reddit-mpv*

Stream a subreddit into mpv.
Uses reddit's RSS API to acquire links and Lars Gustäbel's python-mpv to control mpv.
RSS feeds are parsed with feedparser.
Usage: reddit-mpv <subreddit>
Example: reddit-mpv videos # /r/videos
View on GitHub

citibike-export

Export the ride history for a Citi Bike account in JSON format.
Uses the selenium Python module and Firefox's geckodriver.
Usage: citibike-export -u USERNAME -p PASSWORD -o OUTPUT
View on GitHub

ffmpeg-srt-scene

Given a scene index, render that scene with the subtitles baked in.
Uses the srt Python module.
Usage: ffmpeg-srt-scene <input> <srt> <index> <output>
Example: ffmpeg-srt-scene input.mp4 subs.srt 3 scene-3.mp4
View on GitHub

rainbowtext

Renders some text in rainbow colors.
Usage: rainbowtext <input> <output>
Example: rainbowtext "hello there" hello.png
View on GitHub

awk


linecheck

Checks each line in each provided file for length.
If the length exceeds 80 characters, spits out a warning for that line.
Usage: linecheck <file1 file2 ...>
View on GitHub

awkbot

A tiny IRC bot that shows that (GNU) awk can be used as a general-purpose language.
Currently only responds to .bots, but can be easily extended.
Usage: awkbot <nick> <server> <chan1,chan2,...>
View on GitHub

CSS


stylish-deepdark-hack

A stylish style to fix input and textarea elements that Firefox's DeepDark theme makes invisible or difficult to see.
Usage: Install by URL or by copying into stylish.
View on GitHub

javascript (browser)


gsearch-neutralizer

Removes the onmousedown event from URLs in Google Search results, preventing rewrites.
Compatible with Greasemonkey; install from Greasy Fork here.
View on GitHub

javascript (node)


webshot-screenshot

Takes a screenshot of a given website and saves it to the given file.
Uses node-webshot to do so.
Usage: webshot-screenshot.js <url> <file>
View on GitHub

misc


homebrew.mxcl.smbd

A basic property list file for using launchd on Homebrew's Samba formula.
Now merged with the actual Samba formula, and therefore no longer needed in stand-alone form.
Usage: Install homebrew.mxcl.smbdist to a directory watched by launchd.
View on GitHub