February 2012
1 post
Changing Android emulator's /etc/hosts
If you’re trying to Wireshark to observe SSL traffic (for example, to see if connections are being reused and SSL sessions being resumed), you’ll find yourself needing to filter by ip.addr = XXXX. Unfortunately, Amazon Route 53 appears to pretty aggressively vend different IP addresses every time you ask, which means you’ll want to pick one and throw it in your /etc/hosts so that...
Feb 9th
January 2012
1 post
Dear Google, Please Stop Hitting Yourself
I’m really rooting for Google. I believe in Android as a bulwark against iPhone’s greedy closed system of iTunes and its hypocritically Orwellian “freedom from porn” (and its “we’ve already solved podcasts” (and its love of Hitler (and its intolerance for satire))). (Plus Android’s Gmail, Maps, Calendar, OTA syncing, nimble navigation, and fast app...
Jan 12th
17 notes
November 2011
1 post
How Netflix runs on AWS →
Nov 21st
October 2011
3 posts
Oct 14th
1 note
Why is Google squeezing developers?
There have been a lot of crazy prices coming out of Google lately. App Engine Pricing (since revised to be less insane) Maps pricing Analytics (not exactly a developer-focused product, and the prices aren’t that crazy for the target tier) Here are some things I don’t understand about this Given the number of overpaid MBAs at Google, how did nobody evaluate this pricing against...
Oct 12th
2 notes
Two fun performance talks
These were making the rounds at work http://www.parleys.com/#st=5&id=2662&sl=0 http://www.infoq.com/presentations/Scale-at-Facebook
Oct 11th
January 2011
2 posts
App Engine Receiving Email Caveat
The sample code makes this totally non-obvious, but the sender is actually a noisy string like “Joe Blow <joeblow@example.com>”. You need to parse it using email.utils.parseaddr(message.sender)[1]
Jan 10th
Copying files as root
rsync -avz —rsync-path=’sudo rsync’ FILE SERVER:REMOTE_FILE
Jan 8th
December 2010
1 post
Tweaking the git post-receieve-email hook
For whatever reason, Git’s post-receive email hook is a hassle to configure, and ugly. How we do it. cd ~git/repositories/XXXX/hooks locate post-receive-email cp YYY/post-receive-email . emacs post-receieve-email change recipients=YOUR MAILING LIST change describe=$(git describe $rev 2>/dev/null) to describe=$(git log -1 —pretty=%s $rev) change  Subject:...
Dec 14th
November 2010
2 posts
http://stackoverflow.com/questions/4139379/http-kee... →
Nov 13th
19 notes
What are some useful tips for tuning programs... →
Nov 1st
October 2010
6 posts
Java: a rough guide to character encoding →
Oct 25th
Installing Sun JDK on Ubuntu
$ sudo add-apt-repository “deb http://archive.canonical.com/lucid partner” $ sudo apt-get update $ sudo apt-get install sun-java6-jdk   from http://www.botskool.com/forum/computer-programming/linuxunix/install-sun-java-6-ubuntu-1004-jdk-jre
Oct 19th
cheat sheet for scala syntax →
Oct 11th
1 tag
MongoDB ids can be anything
Even an object! Bananatown. > db.x.insert({‘_id’: {‘a’: 123, ‘b’: 456} }) > db.x.find({‘_id’: { $lte: {‘a’: 124 } } })      { “_id” : { “a” : 123, “b” : 456 } } (Caveat, keys have to be in same order. For example, in Python, construct your ids...
Oct 5th
4 notes
Grand Unified Language Cross-Reference
https://spreadsheets.google.com/pub?key=0AkV6W8Td7jGwdFJEU0JiRkttS1UyYzRFNWRoZk9uYXc&hl=en&output=html This would probably work better as a web page. Some day, when I have time.
Oct 4th
1 tag
Mongo DB upserts and _ids
Mongo gives some confusing errors if you upsert incorrectly. The trick is that you need to repeat the id in the update clause if and only if you are not using modifier operations. So you end up with either 1) foo.update({‘_id’: ‘X’}, {‘_id’: ‘X’, ‘bar’: ‘baz’}, true) or 2) foo.update({‘_id’: ‘X’},...
Oct 4th
3 notes
Inside MongoDB: the Internals of an Open-Source... →
Pretty good slides about Mongo internals! Wish there was a video or more detail, though.
Oct 1st
September 2010
6 posts
Installing gitweb
There are a bunch of instructions on the Internets, but http://serverfault.com/questions/72732/how-to-set-up-gitweb/82047#82047 worked for me. I’m still a bit interested in trying http://hjemli.net/git/cgit/ but it doesn’t seem to support search over the files themselves, and it looks slightly harder to install?
Sep 28th
OS X Terminals hang on opening?
Fix (thanks Jason!) is 30 12 * * 3 rm -f /private/var/log/asl/*.asl >/dev/null 2>&1 in crontab
Sep 23rd
3 notes
The Absolute Minimum Every Software Developer... →
Sep 16th
3 notes
Z →
Awesome tool that tracks “frecency” for quickly jumping around directories.
Sep 16th
1 tag
Yahoo's Yconalyzer and You →
Sep 7th
August 2010
5 posts
“When an error is raised the server responds by returning an HTTP error code and...”
– urllib2 - The Missing Manual
Aug 31st
Mnemonic for comparison functions in Scala
Scala comparison functions return boolean instead of a signed number, which is confusing for those of us deeply entrenched the C/Java family of languages, or as I call it, The Real America. Anyway, Jason has a handy mnemonic for remembering what true means .sort({_ < _}) produces 1 < 2 < 3 .sort({_ > _}) produces 3 > 2 > 1 Or you can remember {_ < _} as an upside-down...
Aug 18th
3 notes
Under the covers of OAuth 2.0 at Facebook | Social... →
One of the more clear OAuth 2 explanations out there.
Aug 13th
3 notes
Git post-receive hook that submits code to Review...
Took a bit of fiddling to figure this out from the various docs. Create a checkout of the repo owned by the git user, e.g. ~git/myrepo, and git config reviewboard.url http://XXX Create a shell script, submit-post-review.sh owned by the git user that does #!/bin/bash cd ~git/myrepo unset GIT_DIR git pull HOME=~git post-review --guess-summary --guess-description --target-groups=Everyone --publish...
Aug 9th
4 notes
Properly uploading files to Amazon S3 «... →
Aug 4th
July 2010
8 posts
Compleat: Bash completion for human beings →
Jul 28th
Format XML on the command line
Hot. curl http://something/xml | xmllint —format - And to format JSON on the command line curl http://something/json | python -mjson.tool
Jul 28th
50 notes
I always have to look up the magic to get timing...
Why isn’t there a single flag that just does this? Lame. curl -w " \ time_total %{time_total} \ time_connect %{time_connect} \ time_namelookup %{time_namelookup} \ time_pretransfer %{time_pretransfer} \ time_starttransfer %{time_starttransfer} \ time_redirect %{time_redirect}\n" http://google.com
Jul 28th
A few git tips you didn't know about →
git pull —rebase is the new hotness
Jul 26th
“”
– ImperialViolet - Overclocking SSL
Jul 22nd
Not strictly related to coding
But I have to dig this awesome heat map out of my chat history every couple weeks - should be easier to find here. :) from http://www.wired.com/magazine/2010/02/ff_ug99_fungus/all/1
Jul 16th
Git diff colors and moving into a new Mac
% git config —global color.diff true WHY is that not on by default? Speaking of settings and defaults, I’ve been trying to use Terminal instead of iTerm, mainly because of the fun color schemes. :) A few things I had to configure in the keyboard tab of my scheme: -> Use option as meta handy for word-level cursor movement when combined with following .emacs changes ...
Jul 14th
1 note
MongoDB Gotchas | Vance Lucas →
Jul 7th
June 2010
8 posts
harryh: Lift 2.0! →
Big congrats to David Pollak and the rest of the Lift team on getting the 2.0 release out the door. I first started diving into Lift back in April of 2009 when I was doing some deep thinking about what platform to rewrite foursquare on. I was already moderately familiar with, and very…
Jun 30th
Group shell →
Jun 30th
fucking amazing network monitoring tool (thanks... →
Jun 29th
How To Safely Store A Password | codahale.com →
Why Not {MD5, SHA1, SHA256, SHA512, SHA-3, etc}?….
Jun 28th
Checking out http://sass-lang.com/ and http://lesscss.org/docs
Jun 24th
Handy Jeff Dean talk →
Jun 24th
Cryptic app engine talk →
Update: Thanks to Jason, it becomes less cryptic with this video http://www.youtube.com/watch?v=tx5gdoNpcZM
Jun 24th
My favorite Javascript pattern
Often in Javascript you want to assemble some parts of the page using string operations or string-based templating or server-side code, all of which are more efficient and less wordy than DOM operations. But, in doing so, it becomes difficult or tedious to attach or maintain listeners on elements within that HTML. (How do you locate each needed node in the DOM and associate it back to the data it...
Jun 3rd
May 2010
4 posts
Is Google Closure's History module giving you a...
Then you probably skimmed over the documentation like I did and missed the part where it says “This object should be created from a script in the document body before the document has finished loading.” Oops. The module uses document.write, so it needs to be called inline! You can’t construct history from, say, a body onload handler. But if you change <script...
May 25th
What I shared at MongoNYC (and what I learned!)
MongoNY was an awesome event. Although it was a bit beginner-focused, it’s worth going to a Mongo event if you’re thinking of using MongoDB. Of course, I’m biased, since I was speaking. :) Tumblr won’t let me embed the iframe of my slides, but they’re at http://bit.ly/chartbeatmongo Also, hopefully, the video will be up at http://www.10gen.com/event_mongony_10may21...
May 24th
New diagrammr feature: boxes in boxes!
One thing I really wanted in diagrammr, given the number of times I’m talking about logical services living inside of physical machines, is the ability to put boxes in boxes. This turned out to be harder than I thought, and as my boss admits, I got overwhelmed by my work at chartbeat (which is awesome, you should use it, I even use it to watch diagrammr), and left it alone for a few...
May 8th
Log your pythons better
Alex found an awesome little thing that dumps your logs into a database http://code.google.com/p/django-remotelog/ The hardest part was figuring out that you apparently have to serve the Django admin media files from nginx, e.g.     location /media {                          root /usr/lib/python2.5/site-packages/Django-1.1-py2.5.egg/django/contrib/admin;                 } I do wish it kept...
May 6th
Wish I had known about SSH Tunnel Manager a long... →
May 1st
April 2010
11 posts
Party Chat (s/t$/pp/) →
gbattle: Persistent chat rooms in Jabber.  This is the best little work tool you can use for your startup today.  If this were the only thing I learned from the betaworks crew of bit fiddlers, legal eagles, miscreants, visionscaries, circumnavigators, drama mamas, professor strangeloves and code monkeys, I’d be quite happy. +1 Props to the creators. -1 Props to the namers. ==== Create...
Apr 28th