My Storage Problem

Storage is cheap, or so we're told. Amazon will sell me storage for $0.055/GB/month in “the cloud”; 3.5" hard drives are hovering around $0.06/GB. However, my laptop has a little 250GB SATA drive that is (a) slow and (b) getting full. So I desire to replace it with a fast little SSD. But that raises the question of what to do with my stuff. I'm asking you, Internet. Details below the fold.

read more

60,000 scrobbles

I used to post these on Facebook as Notes, but since the Timeline refactor, I frankly have no idea how to use Notes; so I guess I'll just post on my own blog. I use last.fm (me) to track my music-listening habits (and sometimes for other things). As of some time recently, I've passed 60,000 scrobbled plays since 2006. Yay!

me

Here's a graph I made (click for ps version; gnuplot continues to be the best thing ever):

scrobbles

Cheers, all.

Merry 2012

I know I'm a bit late to the party, but Merry 2012. As a sort of celebration, here's my favorite animated GIF of all time (courtesy of Evan a long time ago):

a horse

Maybe I'll actually write some useful content this year.

Kindle vs. Kindle

Kindle 4

So, you might have heard about Amazon's new Kindles. They're kind of a big thing. There's even talk that Jeff Bezos is the New Steve Jobs, which is kind of silly, but serves to underscore the point that Amazon is big news these days. Anyway, you might also remember from an earlier post of mine that I have a Kindle 2. Well, when I saw the new Kindles, I couldn't resist. So now I also have a Kindle 4 (non-touch). It's pretty awesome. Let's start with some sexy comparison shots (flickr set):

Kindle vs Kindle

The most stunning thing about the new Kindle is, without a doubt, its size. My old Kindle 2 is 290g, my new Kindle is 160g. That's a very noticeable difference. I imagine that most of the weight savings comes from losing the useless keyboard. Which is, in turn, possible because the screen refresh is approximately 90,000 times faster. In my scientific opinion.

Aside from those hardware differences? It's still a Kindle. The software is the Kindle software (and now I know one of the guys who wrote it, so I have somebody to blame for java.lang.Integer errors), which is cool. There are some little tweaks, like the option to decrease inter-line spacing, but it's the same e-reader software that I know and love. I've gotten two and a half years of great use out of my Kindle 2, from reading the Times every morning on the subway from the 116th St. station to the 14th St. station in 2009 through reading the Times every morning while I ponder the San Francisco fog in 2011. Books are awesome, and eBooks are eAwesome. For $109 (without ads), how can you say no?

What about the other new Kindles, the Kindle Touch and Kindle Fire? Well, I think the Touch is pretty ridiculous. I've never had an urge to touch my Kindle's screen to change the page. Why would I pay $30 more for the privilege of touching the screen (and also the "privilege" of 50g extra mass)? And the Kindle Fire is cool hardware for an amazing price, but scary software. All the bad things I've said recently about Chrome breaking the internet (with 60-second socket timeouts and speculative prefetching) are nothing compared to the mess that is Amazon Silk. But that's all a post that can wait until the products are actually released next month. I have an iPad and a TouchPad, so I don't think I'm in dire need of any new tablet computers for a little while.

Now, if you'll excuse me, I think I should go read a book or something.

TouchPad!

TouchPad

So, I got one of the Internet-legendary $99 TouchPads (well, $149 actually, but whatever). As some of you may know, I was an enormous Palm fanboy during the 90's. So it was pretty inevitable that I would end up purchasing one of their WebOS products, even though there's not a lot in common between this and Jeff Hawkins' wooden cutout Palm Pilot. Anyhow, this is probably going to be the nerdiest review of the TouchPad posted on the Internet. It mostly is concerned with keyboard mappings. Enjoy!

read more

Rawr, Lion

Mac OS X Lion If you've read any kind of tech news in the last few days, you might've noticed that Mac OS X 10.7 Lion is out. I wasn't going to upgrade for a while, but then it launched and I did. So I've been using Lion for a few days now, and I thought I'd join the endless ranks of people on the Internet talking about Apple's latest big cat. I'm not really going to be much competition for the real tech writers, so if you want to learn nearly everything about Lion, I recommend making a pot of tea and sitting down to John Siracusa's latest tome. Otherwise, read on to see what I think of the new features.

read more

n+1 years

One year ago tomorrow, I graduated from college. As my younger friends graduated today (thanks for the quasi-livestream, Skye), I actually realized this fact: it's been a year. A year as one of the dead. A year in the real world. It's bloody strange. On some level, it's unbelievable that I've been out for a whole year. Graduation was just a couple of weeks ago, wasn't it? I can still remember lectures good and bad, evenings in the muddhole, nights working in Platt, as though it were all just yesterday. On another level, though, it almost feels like I've been out forever. I have a life, and it fits me sort of like a glove. I sit in my apartment and I feel like I'm home, and I really don't know when that started. I can remember the details of life in college, but it no longer feels like I'm on a particularly protracted vacation.

Looking back with an iota of distance, Mudd was a really transformative place. I can look back on things I wrote a few years ago (hello first post), and it seems really weird. Mudd is a place that tears you down and builds you up in a shape that it finds amusing. Five years ago, about to graduate from high school, I wouldn't've been able to imagine pulling an academic all-nighter. Nor would I be able to understand the camaraderie of a research team, the bond of dorm-mates, or, well, you get the idea. By the time I crossed the stage last year, it would've been strange to me to go to bed on the same day I woke up.

And now? Things certainly have changed in the last year. Some for better, some for worse. I still have a lot of friends, which is nice. Some of them are even people who didn't go to Mudd with me. But gods know that nothing compares to having everybody you know or want to know living within a few hundred yards of you. Now I have roughly as much money as I could reasonably spend, which I suppose is a good thing. No more problem sets, which is both a blessing and a curse. Yes, I still have that dream sometimes where I'm in the exam for a class and I realize that I've never done any of the homework or the reading, and have no idea what the material is about. I know, it's clichéd.

My gods, dear reader, books! Mudd spent four years drilling into my head that books are those dense and mysterious things that you've got to read until you can't read any more just to keep on top of your classes. I've been working hard to get past that — nearly up to 100 books read since graduation, most of which are so light and irrelevant that you couldn't teach a class with them if you tried. That's a pretty wonderful part of the real world.

Looking out from the top of my building

Then, of course, there's the specifics of my situation. Working at Yelp is pretty good. It certainly has its moments of fun. And it provides me with plenty to do, although when I try to work sane hours, everybody says I'm working too much and should go home. Which is not necessarily wrong, but still rankles a bit. Living alone in the city, that's a more nuanced thing. I love my apartment, and my neighborhood is pretty cool, but there's no getting around the fact that it's pretty weird to live by yourself in the real world. You have to remember to vacuum. And no matter how delicious the food you cook is, there's always dishes afterward. And you have to work a bit to keep the antisocial factor from turning you into a caricature of yourself. On the other hand, there are no other people to bother you. Nobody complains if you play bad music, sleep weird hours, or let the windowsills get dusty. My view (right) certainly is a lot different than my view a few years ago.

The last year has had a lot of crazy things happen in it. It's also had a lot of perfectly humdrum things. It's life. Normal, plain, vanilla life. Who'd've thought?

This isn't a blog post that has a conclusion or a point. It isn't a guide or a manual. It's just an expression of how profoundly strange it is to be an adult, one year in.

Good night, reader.

*nix Tip of the Day: Unix Time

As the unix-savvy among you probably know, there is One True Way to tell the time: the number of seconds elapsed since midnight on January 1, 1970 +0000. It's an extremely convenient way for computers to represent the time, since it's just an integer that goes up. There's no parsing to be done, and arithmetic is just regular math. If you want a brain-numbingly-detailed overview, Wikipedia's article on unix time is, as usual, sufficient.

However, what I'd like to talk about here is converting back and forth between unix time and meatware time. I imagine that when your beard gets long and grey enough, you are actually able to think in unix timestamps. However, for those of us who have not yet reached that level, there's the traditional unix command date. (Forewarning: some of the examples I will give here may only be applicable for the date that is part of GNU Coreutils. Mea culpa.)

The simplest thing you might want to do is find out what the current time is as a unix timestamp:

% date '+%s'
1299476266

As you can see, we haven't run out of 32-bit integer space yet.

However, what about going the other way? Sure, you could write a C/perl/python/etc. program that uses some variant on `ctime(time(NULL))`, but that's cheating. There must be a builtin? Maybe something that's not really documented? Lo, there is!

% date -d @1299476266
Sun Mar  6 21:37:46 PST 2011

It's not in the man or info pages, but there it is. The trusty @-sign solves your problem.

Cheers!

sietchtabr reboot

I have a VM slice that I use to run DNS, a bzflag server, and a few other incidental things. This is what I see on it right now:

% uptime
12:05:13 up 450 days, 15:17,  5 users,  load average: 1.93, 1.35, 0.60

It's currently running Debian lenny, but I decided that I wanted to get with the times and upgrade it to squeeze. As expected the upgrade was fairly painless (took me a bit to figure out that booting by label was broken and I needed to boot by disk UUID), but it's kind of disheartening to see this:

% uptime
12:48:44 up 3 min,  1 user,  load average: 0.30, 0.27, 0.11

Linux Tip of the Day: SystemTap

The other day, one of my co-workers, Evan, presented an interesting problem to me. Every day, at some point, a file named ] gets created in his home directory. He assumes that it is being created by a script with a typo in it... somewhere. But how to find out? It's a hard thing to grep for.

My initial solution was to use inotify (which you might remember from a previous post) combined with libnotify to alert him if it happens while he was at his computer. It looked like the following:

$ inotifywait -t 0 --exclude='.*[^]]$' $HOME && notify-send "something just created ]"

This is an okay solution (especially in that it took almost no time to write), but it doesn't actually give any useful information unless you're sitting at the computer and can do some manual debugging (to try and find what processes are in cron for that time, maybe do an lsof). I could add those things to the script, but there's still enough of a race condition inherent in shell programming that it's unlikely they'd be successful. How to solve this problem?

Enter SystemTap. SystemTap is like Solaris's DTrace: a tool for monitoring and acting on events a the kernel level, without the added bulk of a debugger. Except SystemTap is cooler. It uses the really neat kprobes functionality to tap into the kernel (which I encourage any of you familiar with systems-level programming to read up on, because they're a lovely hack), it has a clean and typesafe compiled language, and it has a decent standard library.

Installation of SystemTap varies based on distribution, but it's described in pretty good detail on the SystemTap wiki. Generally, you install debugging symbols for your kernel and the userspace systemtap compiler and runtime. Once you have it installed, you can probably add yourself to a group in order to be able to run stap scripts, or just do it as root. Either way.

So, what did my solution look like in SystemTap? Behold:

probe syscall.open {
    if ((filename == "]") || (filename == "/home/evan/]")) printf("%s by %s (pid %d), parent %s (ppid %d)\n", filename, execname(), pid(), pexecname(), ppid())
}

Run that under stap and you get a nice summary of the what is creating the files. Straightforward, and without crippling overhead (just two strcmps per open call). Cool beans!

Of course, this is just the tip of what you can do with SystemTap. For example, Debian Developer/Mozilla Contributor Mike Hommey wrote up a good summary on tracking disk I/O with SystemTap. And SystemTap provides a good base of example scripts for your tracing pleasure.

Feel free to let me know if y'all find any other cool ways to use this technology.