Skip to content

Instantly share code, notes, and snippets.

@timf
timf / .inputrc
Created January 23, 2013 15:53
~/.inputrc for OSX up and down arrow bash history completion (enter the beginning of a command and press up to scroll through matches)
"\e[B": history-search-forward
"\e[A": history-search-backward
.m2/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
.m2/repository/org/codehaus/plexus/plexus-utils/1.4.6/plexus-utils-1.4.6.jar
.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
.m2/repository/org/codehaus/plexus/plexus-utils/1.5.6/plexus-utils-1.5.6.jar
.m2/repository/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.jar
.m2/repository/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
@timf
timf / gist:4060041
Created November 12, 2012 15:39
Intellectual Honesty
In science it often happens that scientists say, "You know that's a really good
argument; my position is mistaken," and then they would actually change their
minds and you never hear that old view from them again. They really do it. It
doesn't happen as often as it should, because scientists are human and change is
sometimes painful. But it happens every day. I cannot recall the last time
something like that happened in politics or religion.
Carl Sagan
@timf
timf / gist:4040915
Created November 8, 2012 19:20
vagrant ramdisk (Linux)
cd /home/tim/VirtualBox\ VMs/
mv proxydev2_1351794515 tmp
mkdir proxydev2_1351794515
sudo mount -t tmpfs -o size=10G tmpfs /home/tim/VirtualBox\ VMs/proxydev2_1351794515
cp -a tmp/* proxydev2_1351794515/
# go back to vagrant directory and `vagrant up`
@timf
timf / jargrep.sh
Created November 5, 2012 15:45
jargrep
#!/bin/bash
if [ "$#" -lt 1 ]; then
echo "enter name to grep"
exit 1
fi
files=`find . -name "*jar"`
for file in $files ; do echo "----------"; echo $file; jar tvf $file | grep $@ ; done
"We know about as much about software quality problems as they knew about the Black Plague
in the 1600s. We've seen the victims' agonies and helped burn the corpses. We don't know
what causes it; we don't really know if there is only one disease. We just suffer -- and
keep pouring our sewage into our water supply."
Tom Van Vleck
curl http://api.twitter.com/1/statuses/show/240219598270640128.json | python -m json.tool
The EC2 and EBS APIs are implemented on multi-Availability Zone
replicated datastores. These datastores are used to store
metadata for resources such as instances, volumes, and
snapshots. To protect against datastore corruption, currently
when the primary copy loses power, the system automatically flips
to a read-only mode in the other Availability Zones until power
is restored to the affected Availability Zone or until we
determine it is safe to promote another copy to primary. We are
addressing the sources of blockage which forced manual assessment
and required hand-managed failover for the control plane, and
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! THIS SERVICE HAS NO HEALTHCHECKS. THIS MEANS YOU WILL NEVER KNOW IF IT !
! DIES IN PRODUCTION, WHICH MEANS YOU WILL NEVER KNOW IF YOU'RE LETTING !
! YOUR USERS DOWN. YOU SHOULD ADD A HEALTHCHECK FOR EACH DEPENDENCY OF !
! YOUR SERVICE WHICH FULLY (BUT LIGHTLY) TESTS YOUR SERVICE'S ABILITY TO !
! USE THAT SERVICE. THINK OF IT AS A CONTINUOUS INTEGRATION TEST. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@timf
timf / tweet-json.py
Created June 9, 2012 13:01
Use the long ID number in a Tweet URL as script argument
#!/usr/bin/env python
import json
import urllib
import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s [Tweet ID #]' % sys.argv[0])
url = "http://api.twitter.com/1/statuses/show/%s.json" % sys.argv[1]