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.

A word on dreams

We use the terms "bad dream" and "nightmare" almost synonymously. I contend that this is a frightfully naïve perspective. When we wake from a nightmare, we shortly realize that the floor isn't made of spiders, that all of the clowns are safely at the circus. But a dream in which we are happy... ah! Such a dream can color the real world world a darker shade long after the dreamer has awoken. These are truly the bad dreams.

Firefox 4 and Vimperator 3

firefox

I've been using Google Chrome's dev channel for the past year or so as my primary browser, but between some questionable aesthetic decisions and Chrome's tendency to segfault every hour or so for the last few dev releases, I decided that it's time to give up on the faster browser in exchange for the usable browser. Toward that end, I'm going back to Firefox. I hear that Firefox 4 is the next cool thing, so I set it up on my work machine (4.0b10pre, if you're interested). And, of course, since I am both a die-hard vim user and a big fan of the keyboard, I've gone back to my old friend vimperator.

I had used vimperator with Firefox 4 briefly a couple of months ago, but found it to be most unsatisfactory. I am happy to report that they have resolved all of the concerns I had with the version 3 alphas, and it's now way better than 2.x was under Firefox 3. Of course, their Design Goals for v3 are really scary and seem like they'd neuter the project in the name of making it more “friendly”. Bu, for now, it's pretty awesome. That said, it's not perfect out of the box, so I've been working on a nice ~/.vimperatorrc. You can find the latest version at this dropbox URL, but I thought I'd post an annotated version inline as well.

set act=addons,downloads,extoptions,help,quickmark
set cpt=slt
set go=br
set hlsearch
set stal=2

autocmd LocationChange .* js modes.passAllKeys = /mail\.google\.com/.test(buffer.URL)
autocmd LocationChange mail\\.google\\.com :set editor="gvim -f -c 'set ft=mail'"

command! -nargs=? -description="Pin the given tab" pin javascript config.tabbrowser.pinTab(tabs.getTab(<args>))
command! -nargs=? -description="Unpin the given tab" unpin javascript config.tabbrowser.unpinTab(tabs.getTab(<args>))
nmap gp :pin
nmap gu :unpin

The first block sets up some useful parameters: it disables auto-focusing new tabs, it disables completion of local filenames (which is still dog-slow under Firefox 4), it disables the bulky, ugly toolbar, it turns on search highlighting, and it forces the tab-bar to always be shown.

The middle block ensures that I can still use keyboard shortcuts on Gmail, and that the file-type is set correctly when editing mail in an external editor from Gmail. Both of these lines are ganked from the Vimperator documentation.

The last block sets up commands to use the new “App Tab”s in Firefox 4. These behave like pinned tabs in Chrome, and I use them a lot.

By the way, if you anticipate working a lot on a ~/.vimperatorrc, you may find it useful to install the vim syntax file. It's a little out of date (doesn't have all of the Vimperator 3 configuration options), but it's better than nothing. To install it, drop the linked file into ~/.vim/syntax/ and add the following to your ~/.vimrc:

au BufRead,BufNewFile \.vimperatorrc set filetype=vimperator
au Syntax vimperator source $HOME/.vim/syntax/vimperator.vim

Cheers!

*nix Tip of the Day: Waiting in Scripts

Scripting is what makes Unix-like operating systems great. Every *nix, be it Linux, BSD, OS X, AIX, Solaris, or whatever other random distribution you can come up with, comes with a capable shell (or three) and a good set of basic utilities. Where a Windows administrator has to either fall to the horror that is Batch files, write code in a big, heavy programming language language, or submit to the terrible dominance of “management utilities”, a Unix system administrator has tons of the tools at his disposal to fix and automate things. I could talk about scripting forever (it is a substantial portion of my job), but today I'm just going to talk about one small facet: waiting for things to happen.

read more