Skip to content

Instantly share code, notes, and snippets.

prowl_api_key = [redacted]
[cackhanded]
password = [redacted]
skip_dm = 1
[pubstandards]
password = [redacted]
skip_mention = 1
#!/ports/bin/perl
# -*- Mode: Perl; tab-width: 4; indent-tabs-mode: nil; -*-
use Modern::Perl;
use CDDB;
use Config::Std { def_sep => '=' };
use FileHandle;
use Getopt::Std;
use Readonly;
@norm
norm / ec2-bin.sh
Created October 3, 2009 00:46
Silencing EC2 errors on Snow Leopard. Also see http://bit.ly/silencing-ec2
To stop being annoyed by Java errors when using the EC2 API tools
on Snow Leopard, apply the following patch:
--- /ports/bin/ec2-cmd 2009-10-03 01:44:04.000000000 +0100
+++ /tmp/ec2-cmd 2009-10-03 01:44:54.000000000 +0100
@@ -58,4 +58,13 @@
CMD=$1
shift
-"$JAVA_HOME/bin/java" $EC2_JVM_ARGS $cygprop -classpath "$CP" com.amazon.aes.webservices.client.cmd.$CMD "$@"
@norm
norm / checksoftwareupdate
Created February 24, 2010 23:49
wrapper around 'softwareupdate -l' to silence it when no updates exist
#!/bin/sh
#
# wrapper around 'softwareupdate -l' to silence it when no updates exist
# -- Mark Norman Francis <norm@cackhanded.net>
OUTPUT=`mktemp /tmp/checksoftup.XXXXX`
ERRORS=`mktemp /tmp/checksoftup.XXXXX`
# capture output to separate files
softwareupdate -l >$OUTPUT 2>$ERRORS
add_to_itunes = 0
install_encodes = 0
trash_directory = /home/norm/Downloads/DONE
trash_files = 0
[rationalise]
Castle (2009) = Castle
American Dad_ = American Dad!
American Dad = American Dad!
Star Wars_ The Clone Wars (2008) = Star Wars - The Clone Wars
# Reconstructed via infocmp from file: /usr/share/terminfo/78/xterm-color
xterm-color|nxterm|generic color xterm,
am, km, mir, msgr, xenl,
colors#8, cols#80, it#8, lines#24, ncv@, pairs#64,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, bold=\E[1m, clear=\E[H\E[2J, cr=^M,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,
speed 9600 baud; 50 rows; 80 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
-echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel iutf8
-ignbrk brkint -inpck -ignpar -parmrk
oflags: opost onlcr -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
-dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
javascript:var i=document.documentElement;var found=0;var ncn=[];var cn=(i.className).split(/\s+/);for(var c=0;c<cn.length;c++){if(cn[c]=='enable-grid'){found=1}else{ncn.push(cn[c])}};if(!found){ncn.push('enable-grid')};i.className=ncn.join(' ');
# Patch for mini_httpd to apply:
# a) X-Real-IP support; found at http://nginx.org/pipermail/nginx/2010-October/023255.html
# b) Fix "conflicting types for getline"; found at http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=7;bug=552844
# http://nginx.org/pipermail/nginx/2010-October/023255.html
--- mini_httpd.c 2009-11-20 12:10:55.000000000 +0300
+++ mini_httpd.c 2009-11-20 12:13:59.000000000 +0300
@@ -186,6 +186,7 @@
static char* pidfile;
static char* charset;
static char* p3p;
@norm
norm / etcstatic
Created March 27, 2011 22:28
Perl plackup script to serve up static content, used by dotjs.
#!/usr/bin/env perl
#
# Perl script to serve up ~/etc/static on localhost. I use this in
# conjunction with my fork of the "dotjs" Safari extension (found
# at https://github.com/norm/dotjs.safariextension) to serve up
# JS and CSS.
#
# Requires Plack and Plack::Middleware::Header. Best installed with cpanm
# ("sudo cpanm Plack Plack::Middleware::Header"). Cpanm, and instructions
# on installing it can be found at http://cpanmin.us/.