Skip to content

Instantly share code, notes, and snippets.

>>> import boto
>>> boto.set_stream_logger('foo')
>>> ec2 = boto.connect_ec2(debug=2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.6/boto/__init__.py", line 113, in connect_ec2
return EC2Connection(aws_access_key_id, aws_secret_access_key, **kwargs)
File "/usr/lib/pymodules/python2.6/boto/ec2/connection.py", line 79, in __init__
https_connection_factory, path)
File "/usr/lib/pymodules/python2.6/boto/connection.py", line 498, in __init__
@jlintz
jlintz / gist:1721082
Created February 2, 2012 02:46
parsing command line arguments in bash
function usage() {
echo ".$0 --argument=foo --argument-two=bar"
exit 1
}
while [ "$1" != "" ]; do
param=${1%=*}
value=${1#*=}
case $param in
--argument) argument=$value
@jlintz
jlintz / gist:1192247
Created September 4, 2011 04:19
Useful C debug macro
#ifdef DEBUG
#define _DEBUG(fmt, args...) printf("%s:%s:%d: "fmt, __FILE__, __FUNCTION__, __LINE__, args)
#else
#define _DEBUG(fmt, args...)
#endif
@jlintz
jlintz / c
Created March 18, 2011 03:11 — forked from terrycojones/c
#
# c - bash directory changing functions that maintain a
# most-recently used stack.
#
# Run with -help as an argument to see invocation options, or find the
# d_usage function below.
#
# To use these functions, store this in a file someplace and
# then execute
#
@jlintz
jlintz / focal_length.py
Created December 28, 2010 00:01
Print out a count of focal lengths from canon raw image files
#!/usr/bin/env python
# Author: Justin Lintz
# usage: ./focal_length dir
# Requiresments: dcraw http://www.cybercom.net/~dcoffin/dcraw/
import os
import sys
from subprocess import Popen, PIPE
from operator import itemgetter
focals = {}