Identity Slippage, and what’s the weirdest thing you’ve been e-mailed by accident?

I have an old, short, and concise gmail address (my first initial and last name at gmail.com). There are many other hmasons in the world who have since signed up for gmail, with variations on the “hmason” theme. Every so often, they mistype the address, or someone mishears it. I now receive between four and ten pieces of e-mail per week meant for other hmasons. This was pretty amusing until someone opened an amazon account on that address (which I had to shut down). Poor Holly has never seen a single Citibank credit card statement (and Citibank won’t remove the e-mail address from the account when I call, since I’m not the account holder). Heidi hasn’t linked her Paypal account to her bank account, but I’m waiting for someone to send her money.

This sort of unwitting misattribution results in an identity slippage that could actually have some fairly interesting consequences. We’ve settled on e-mail as a unique identifier across platforms, but we increasingly cannot rely on that assumption.

I saw Chris Adam‘s comment on Twitter this morning and can’t agree more — it should become standard practice to confirm an e-mail address before sending personally identifiable or sensitive data. Now, please.


Going to Strata in Feb?

Are you planning to attend Strata in Santa Clara at the end of February? Reach out for a discount registration code.


Why do I miss google calendar invites?

I keep missing Google calendar invites on both my personal and work accounts. I’ve had my google account for years (since 2004?) and assumed it was some quirk of how I had configured something along the way.

Today I was following Google’s instructions for syncing calendars with an iOS device and discovered that if you click calendar settings (which means click the gear icon then ‘calendar settings’), then ‘calendar’, then ‘notifications’ next to the calendar that you care about, you can turn on e-mail and SMS notifications for any given calendar.

(I’ll save my ranting about the number of clicks to find and configuration anything on google’s properties right now for another time.)

I’m sharing this on the theory that I’m not the only one with this particular frustration. I hope it saves someone from missed opportunities and useless rage!


Happy Halloween

The meatpacking district in NYC has been particularly colorful today!

This post is a reminder to myself to have this shirt printed and wear it next Halloween so that I fit in:



Hacking the Food System: The Ultimate Chocolate Chip Cookie

liquid n2 ice cream

Food+Tech Connect is putting together a fun series of essays where technologists and foodies share their opinions on how to hack to the food system.

They also had a great party, with liquid nitrogen ice cream and other very cool foods.

I’m honored to have been asked to participate, especially since food and tech are two of my favorite things! I decided to write about a hack that I did about three years ago, where I wrote a parser and built a statistical model of chocolate chip cookie recipes that I crawled off of the web.

I’d like to tell you the story of the Ultimate Chocolate Chip Cookie Recipe.

This isn’t the Neiman Marcus $65,000 cookie recipe. Nor is it the classic Toll House Chocolate Chip Cookie recipe that we all grew up with (and, though the instructions are all the same, my Mom made the best). This is a recipe learned from thousands of bakers around the world, via love and math.

Read the rest of the essay on their site. I’d love to know what you think!

Special thanks to Matt LeMay for language-clarifying edits to the piece.


bash: get http response codes for a list of URLs

I had a file with a list of URLs, and I wanted to grab the HTTP response codes for each of them. I’m sure this quick bash script isn’t the best way to do it, but it works, and I’ll probably want to do this again someday, so here it is!

#!/bin/bash

while read line
do
    echo $(curl --write-out %{http_code} --silent --output /dev/null $line)
done <$1

What do you read that changes the way you think?

A friend asked me which of three startup business books she should read. Obama’s reading list since entering office has nothing surprising on it.

The most valuable books I read this year have been stories of things very different from what I spend most of my time thinking about.

One of my favorites was China Meiville’s The City & The City, which I loved for the ambition and artistry, and another was Simon Winchester’s The Meaning of Everything: The Story of the Oxford English Dictionary, which I loved for the descriptions of creating an analog, scalable information system.

What have you read recently that was really great?

Edit: Thanks for the recommendations! There are also a bunch over on Google Plus.


My Head is Open Source!

Last night I visited friends at Makerbot, where artist-in-residence Jonathan Monaghan scanned my head with a high-resolution laser scanner.

The model is available on Thingiverse and can be printed on your friendly neighborhood makerbot or other 3d printer.

There are lots of other awesome models of people and things to play with, including Stephen Colbert’s head.

I look forward to the emergence of plastic clone head armies!

Edit: Please note: thanks for asking, but brains are not included.


How to get a random line from a file in bash.

I work with a lot of data, and while I’d like to pretend it’s all in upside-down quasi-indexed b-tree rocket ships or some other advanced database, the truth is that much of it is in text files. I often find myself wanting to see a random line from one of these files, just to get a sense of what the data looks like.

I thought there must be an easy bash way to do this, but I couldn’t find it (‘shuf’ isn’t installed on my server), so I turned to twitter, and now I’m pleased to present more methods for finding a random line than you ever expected!

sort -R | head -n 1

If you can use this, do so! If it isn’t available, consider one of the following commands:

@andrewgilmartin suggests using awk:

awk 'BEGIN { srand() } rand() >= 0.5 { print; exit }'

@devinteske offered one of the easiest to solutions to read:

tail -$((RANDOM/(32767/`wc -l</etc/group|tr -d ' '`))) /etc/group|head -1

@terrycojones piped up with this gem:

split -l 1 < file; cat `for i in x*; do echo $RANDOM $i; done | sort -n | cut -f2 -d' ' | head -n 1`; rm x*

@FirefighterBlu3 does sed++:

file=/etc/passwd; lc="$(($RANDOM % $(wc -l $file|awk '{print $1}')))"; sed -n "${lc}p" $file

@burleyarch collects the whole set:

f=YOUR_FILE; n=$(expr $RANDOM \* `cat $f | wc -l` \/ 32768 + 1); head -n $n $f | tail -1

All of the options using $RANDOM should be used with the understanding that the max possible value is 32767, so it will only be random on files that have fewer than 32,767 lines.

@xn with an excellent use of cut:

awk 'BEGIN { OFS="\t"; srand() } { print rand(), $0 }' | sort -n | cut -f2- | head -1

@paulrbrown with a badass example of od:

echo `cat /dev/urandom | od -N4 -An -i `' % '`wc -l < file` | bc | sed 's/-//g' | xargs -I % head -n % file | tail -n 1

And finally, from @alexlines, who actually developed his solution into a blog post:

dd if=file skip=$(expr $(date +%N) \% $(stat -c "%s" file)) ibs=1 count=200 2>/dev/null|sed -n '2{p;q;}'

And, of course, @ceonyc brought some comic relief:

@hmason Good bash one-liner? Take my code, please.


Gitmarks: a peer-to-peer bookmarking system

Several months ago I was looking for a command-line solution for group bookmark sharing. I couldn’t find one, so I coded up a quick python script that runs on top of git. It’s very much a hack that takes advantage of git to manage users, preserve the URL, the tags, the description of the URL (in the commit message) and also includes the content itself (so it’s grep-able later). If you put it on github, you get the additional commenting and collaboration features. You can check out my original code here.

I’m very excited that Far McKon has picked up the project and has a great vision for where it can go. If you’re interested in hacking on it with him, let him know!


Folks: I’m working on a p2p bookmark sharing based on @hmason ‘s code. Python/git based. Want to help? #opensource @openhatchless than a minute ago via TweetDeck