Evan A. Sultanik, Ph.D.

Evan's First Name @ Sultanik .com

Computer Security Researcher
Trail of Bits

Adjunct Professor
Drexel University College of Computing & Informatics
Department of Computer Science

Recent Content:

Walking to the Horizon

or, A Mathematical Argument for a Gastronomical Visit to Stockholm

I am subscribed to David Horvitz’s new project entitled IDEA SUBSCRIPTION in which he posts almost-daily simple instructions. Yesterday’s instructions read as follows:

I do not profess to have spent much time researching this in the past, but I had never heard of this approximation before. The approximation is so concise that I was curious as to its error. The approximation is obviously incorrect for very tall heights since it is unbounded:
$\lim_{h \rightarrow \infty} \sqrt{1.5 h} = \infty,$
vi&., in actuality an enormously tall person (whose eyes were almost an infinite distance away from the surface of the Earth) would only be able to see a quarter of the Earth’s circumference in front!

I therefore spent the last 5 minutes formalizing a bound on the error of this approximation. The results, which follow, were quite surprising.

Cycle Junkie Shirt

An esoteric shirt inspired by a slightly less esoteric conference.

In late July of 2006, Rob Lass and I decided to attend the HOPE conference in New York City. We were both living in Philadelphia at the time, being conveniently a little over 100 miles (~160km) from NYC. Earlier that year we had successfully piloted our bicycles from Philadelphia to Reston, Virginia, averaging over 100 miles each day. Therefore, we set upon to ride up to New York in one day.

The HOPE conference is attended, in large part, by geeks, mostly of the computer variety. From our interactions with the then burgeoning bicycle subculture in Philadelphia, we had noticed a large overlap with the computer geek subculture. An idea was thus born: We were to design and print a t-shirt—de facto uniform of bike- and computer-geeks alike—that would marry the two subcultures. We would then sell the t-shirts at HOPE to help fund our expedition.

Here is the design up with which I came:

There are three “cycles” referenced in the design:

  1. a bicycle (obviously);
  2. a CPU cycle; and
  3. a graph cycle.

The term “cycle junkie” was coined by Bill Gosper.

Although I am almost sold out of the first printing, if there is enough interest I might organize a second printing of the shirts. Contact me if you’re interested.

Sultanik’s Law of Wikipedia Authorship

Spoiler: Trolls always prevail.

$$\lim_{t \rightarrow \infty}P(a = \mbox{Expert} \vee a = \mbox{Troll}) = 1.0,$$

where $t$ is time and $a$ is the author of a new article on Wikipedia.

In other words, as time goes on it becomes more and more certain that authors of new Wikipedia articles will either be a very specialized expert or a troll.

Only π more hours to go…

In which I am trolled by a software utility.

This evening I finally got around to doing some forensic data recovery from a broken (i.e., horribly clicking) hard drive. Most of the data I had backed up, but there are a couple non-vital files for which it would be nice to recover. That, and I've never done something like this before and it's quite fun. It's especially fun that the partition I'd like to recover was formatted in ReiserFS, for which no free and few commercial recovery tools exist.

The first step to data recovery is making an image of the faulty disk on a healthy hard drive. The disk image can then be repaired and diagnosed without having to worry about hardware failures (i.e., the dreaded clicking). The tool of choice for this is ddrescue. For those that are familiar with the *NIX command dd, ddrescue works similarly except it skips over bad sectors. Once all of the good sectors are copied, it then goes back to all of the bad sectors and tries to read them again (in case the hardware malfunction is stochastic).

ddrescue prints out a handy list of statistics, including the average transfer rate. My rate is currently at 7120 kB/s (it's so slow because I am copying the image to my network file server over 100BaseT to a Pentium-III box running software raid). The hard drive I am recovering is 76.8 GB in size. I did some quick calculations to figure out how long I'd have to wait before this thing finishes.

$\frac{76.8\ \mbox{GB}}{7120\ \mbox{kB/s}} \approx 3.141\ \mbox{hours} \approx \pi.$


In which I blatantly offend yet another group of people.

I’d like to begin with a simple analogy that expresses my feelings on the subject at hand:

aborted llama fœti : Perestroika :: Flexitarianism : this analogy.

In other words, flexitarianism makes as much sense as grooming one’s pubic hair with a rusty vegetable peeler. I fail to see how flexitarianism is any different than, oh, say, being an omnivore. “I am a vegetarian… except for when consumption of animal products is required socially, nutritionally, culturally, or pragmatically.” STFU. In other words, you’re a normal omnivore who cannot always stomach eating meat for some reason, most likely due to moral dissonance. I have no problem with vegetarianism—or any other diet, for that matter—as long as its practitioners do not proselytize. I don’t care if you deprive yourself of certain foods on moral, religious, or nutritional grounds. What does offend me is the addition of a new word to our vernacular that adds little or nothing semantically. Also, it is concerning that those in moral conflict about eating meat are given a new term to legitimize their ethical limbo, thus postponing their decision about whether or not to give up being an omnivore.

I only drink to excess when it is socially acceptable.

The flexoholic.

I only cheat on my spouse pragmatically.

The flexadulterer.

Dictionary and Thesaurus Lookup in Emacs

Or, adding a feature to a piece of software that already has too many features.

Emacs is my preferred tool for editing LATEX documents. A few years ago I got tired of switching back and forth to a terminal or web browser every time I wanted to look up a word in the dictionary or thesaurus. To remedy this, I wrote a simple, 100-line Emacs Lisp plugin to look up words using the DICT protocol.

One can simply cut/paste this into their .emacs file or make it a separate file in their elisp directory.

; -*-Emacs-Lisp-*-
; File:         dict.el
; Description:  Dict access functions
; Author:       Evan Sultanik
; Created:      Sun Aug 14 15:44:57 2005
; Modified:     Thu Nov 15 08:45:48 2007
; Language:     Emacs-Lisp
; Package:      N/A
;; *******************************************************
;; ***** THIS IS AN ALPHA TEST VERSION (Version 0.2) *****
;; *******************************************************
;; dict.el
;; Copyright (C) 2005 Evan Sultanik (http://www.sultanik.com/)
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 1, or (at your option)
;; any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

(defvar dict-protocol-client “dict”
  “This is the name and/or path to the local copy of the DICT protocol client.”)

(defconst dict-scratch-buffer-name “*dict*”
  “This is the name of the buffer in which the dict output is displayed.”)

(defun dict-extract-word ()
  “From the current buffer, extract and return the word under the cursor.”
  (let (start word)
      (forward-char 1)
      (backward-word 1)
      (setq start (point))
      (forward-char 1)
      (if (not (re-search-forward “\\b”))
	  (error “Can’t find end of word”))
      (buffer-substring start (point))

(defun dict-lookup-word (word dict)
  “Look up the word WORD using the client, given by
`dict-protocol-client’.  The results will be displayed in the buffer
given by `dict-scratch-buffer-name’.  If DICT is nil, WORD is looked
up from a thesaurus only.”
  (interactive “sWord to lookup? \nP”)
  (let ((dict-buffer (get-buffer-create dict-scratch-buffer-name)))
      (buffer-disable-undo (set-buffer dict-buffer))
      (setq buffer-read-only nil)
      (setq disable-point-adjustment t)
      (display-buffer dict-buffer)
      (if (null dict)
	  (call-process dict-protocol-client
			nil ;; no infile
			t   ;; put output in the current buffer
			t   ;; re-display as we get more output
			“-P” “-” “-d” “moby-thes” word)
	  (call-process dict-protocol-client
			nil ;; no infile
			t   ;; put output in the current buffer
			t   ;; re-display as we get more output
			“-P” “-” word)
      (setq buffer-read-only t)
      (goto-char (point-min))

(defun thesaurus-lookup-word (word)
  (dict-lookup-word word nil))

(defun dictionary-lookup-word (word)
  (dict-lookup-word word t))

(defun thesaurus-lookup-word-in-text (exact)
  “Like `dict-lookup-word’, but uses the word under the cursor.”
  (interactive “P”)
  (thesaurus-lookup-word (dict-extract-word)))

(defun dictionary-lookup-word-in-text (exact)
  “Like `dict-lookup-word’, but uses the word under the cursor.”
  (interactive “P”)
  (dictionary-lookup-word (dict-extract-word)))

This code assumes that you have the command dict available.

You can set a keyboard shortcut as follows:

(global-set-key (quote [f7]) ‘thesaurus-lookup-word-in-text)
(global-set-key (quote [f8]) ‘dictionary-lookup-word-in-text)

Pressing the F7 and F8 keys will then look up the word under the cursor in the thesaurus or dictionary, respectively.

Orþography for Dental Fricatives

A Proposal

Ðis is a proposal (petition?) to reinstate phonetic orþography for dental fricatives in written English. Ðe letter “t”—ðe most common consonant and second-most common letter in ðe English language—has at least six possible phones (depending on dialect). Complicating matters is ðat ðe proper phone is dependent on context; digraphs like “th” can dictate phoneme, as can ðe position of ðe letter within a word and position in relation to ðe stressed syllable (dictating aspiration, as in “tomato”). Ðe phone for “t” is sometimes even word-dependent (þree examples: “connection” vs.time” vs. “rotting”). Special cases abound.

Ðe “th” digraph alone can represent þree different phones: ðe voiced dental fricative (e.g., “this” and “the”), ðe unvoiced dental fricative (e.g., “thing” and “with”), or sometimes even ðe voiceless alveolar plosive (e.g., “Thailand” and “lighthouse”).

By reinstating ðe letters “ð” (Eth) and “þ” (Thorn) into ðe English alphabet (for, respectively, ðe voiced and unvoiced dental fricatives) we can eliminate much ambiguity.

Mr. Mint

Or, how I bought myself a US passport.

While recently writing an article on the AAMAS conference, I was reminded of an incident back in 2002 that, in retrospect, is quite amusing. Although I have publicly recited the story in the past, I have never done so on my website. That, and enduring my incoherent scribblings of six years back makes me want to thrust unsharpened pencils into my eyes.

The prologue is a rather boring and, I must say, embarrassing story, the only pertinent details of which are that I am left in need of a US passport, posthaste.

It’s Saturday. My flight bound for Italy leaves Monday afternoon.

Philadelphia, the city from which I was to embark, has a 24/7 passport-related toll-free telephone hotline, which conveniently plays a recorded message on a loop stating, among other things, that the only possibility of getting a passport (forget a same-day passport) is to have an appointment, and the appointments are booked at least two weeks in advance. In order to book an appointment, there is an automated system available through a separate 1-900 (non-toll-free) number. It stated that it was impossible to speak to a human without an appointment.

Thank the lords for the Internets. There is one company that guarantees same-day passports: itseasypassport.com (the website doesn’t appear to work anymore). I call their 1-800 24/7 emergency hotline. The number just plays me a recording telling me to call a different number, this time in the 212 area code (New York City). I call the second number and am greeted by woman. Mind you, she does not pick up as if she were a receptionist; she greets me as if I had called her personal residence. Which, it turns out, I had. I ask for Its Easy Passports, prompting her to yell to her husband to pick up the phone.

The proprietor of this well-oiled establishment picks up the phone and immediately asks me, “Do you have a valid driver’s license? If so I can get you anything.” I explain my situation and tell him that I need a passport. “Do you want a Visa, too?”

Here are the instructions he gave me:

  1. Go to a building in NYC at 07:00 on Monday morning (he gave me the address);
  2. Call a guy named Mr. Mint (he gave me his cell phone #);
  3. Mr. Mint will alert the guards at the entrance to the building to let me in;
  4. Go in and go directly to the 10th floor (all of the other floors are “prisoner holding cells”);
  5. Get out of the elevator and across the hall there will be a room with a bunch of forms and a phone;
  6. Fill out the forms and when you are done call Mr. Mint again;
  7. Mr. Mint will come in and take the forms and he will give you a ticket;
  8. Pay Mr. Mint $100 cash; and
  9. Come back at 10:30 and you will get your passport.

As you might imagine, by this point I am very skeptical, so I ask the mystery man how his company ensures same-day passports (without being so rude as to directly ask if the resulting passport will be a forgery). He claimed that his company buys slots of appointments from the passport office and sells them to his customers. I look up the address the guy (whose name turns out to be Dave) gave me and it appears to be the address of the real NYC passport office, so the story checked out.

I decide to try this, as it’s my only hope. Sunday night I take the train up to NYC and stay at the Chinatown Holiday Inn. The next morning I walk to the passport office and there was already a line encircling the building. No one in the line spoke English. I enqueue and call Mr. Mint, but he does not answer. Without any other option, I walk to the front of the line and tell the guard that I am here for Its Easy Passports, and by this magic password he steps aside and lets me in. I take the elevator to the 10th floor and, sure enough, Mr. Mint is waiting. Everything went as planned and I hop on a train back down to Philly, got to the airport, and caught my flight at 17:00.

When did you get this passport‽

British Airways attendant

I just had it printed today.


Edit (10-08-2009): I’d like to clarify that, although It’s Easy Passport seemed sketchy at first, it turns out to be a legitimate company that provides an excellent service. I would recommend them to anyone in a similar situation to mine.

Cycling from Philadelphia, PA to Reston, VA

In which I once again make poor life decisions fueled by stubbornness.

A couple days ago, Rob Lass and I embarked on an epic journey from Philadelphia to Reston, VA (just outside of Washington, D.C.)… by bicycle. We had a business meeting in Reston—which is only about 160 miles away—so we figured we’d give cycling a shot. Deep down neither of us thought we could make it, but neither of us were man enough to admit that, so we tried anyway. One puncture, one bike-to-bike collision, one hail storm, weird sunburn, too many bad directions, and many, many hills later, we made it there and back in one piece. Overall, it was a very positive experience for the both of us.

Pictures are available here.

Lessons learned:

  • For anyone that is reasonably in shape, long distance touring is 85% mental.
  • Touring gear (e.g., racks and panniers) add a lot of weight, and weight makes a huge difference. I used a rack trunk and a handlebar bag, which made my bike top heavy and made steering awkward. It also prevented me from pulling a Natty Fab.
  • Even if you wear sunscreen, you’ll get sunburn and tanned in the weirdest places (see the pictures linked above).
  • Even though I used a fixed gear, I’m really glad I at least had a front brake; it was essential on the huge hills around the PA/MD border.
  • Route 1 is the best way to get from Philadelphia to Baltimore. Much of Route 1 is a four lane highway, but there’s a huge shoulder that allows for two bikes to ride abreast. It’s also legal for bikes to ride along the shoulder.
  • There is nothing between Kenett Square and the suburbs of Baltimore. Literally. We had to make an 8 mile detour just to get some lunch.
  • GPS is invaluable, especially for finding the nearest restaurant, hotel, or convenience store when in the middle of nowhere, vi&., between Kenett Square and Baltimore.
  • Never underestimate your appetite. All-you-can-eat places are great.
  • You probably don’t want to ride further than White Marsh, Maryland after dark. This is coming from someone who lives in West Philly. White Marsh is really nice, though, and has a lot of great places to stay/eat, especially around to I-95.
  • We were told that the Bike Washington cue sheet was the best way to get from Baltimore to D.C. It was great, however, it was originally written by people going the opposite direction (i.e., from D.C. to Baltimore). Therefore, some of the directions were wrong; for example, at mile 14.6 you really want to make a right onto Park Circle. Also, the warning about a big hill at mile 30.9 was really a downhill for us; we got really confused and thought we were lost because we never got to a big climb.
  • Getting across D.C. from Union Station to the Francis Scott Key Bridge took a lot longer than expected.
  • The Custis and W&OD trails are amazing.
  • Taking a lot of turns on small roads takes a lot of time; it took us the same amount of time to get from Philly to Baltimore (~100 miles down Route 1) as it did to go from Baltimore to Reston (~65 miles on dozens of different roads).
  • Riding through a hail storm is not fun.

Nathan Fabian

In which an innocent cyclist is rudely introduced to the Internet.

Fixed Gear Gallery (FGG) is a daily-updated website that has a photo gallery of… you guessed it… fixed gear bicycles. Last Friday, a fellow by the name of Nathan Fabian submitted these pictures to the FGG. You might notice that the second picture on the page features Mr. Fabian executing a no-handed track stand, whilst making a lewd gesture at the camera. This is interesting, since the FGG discourages (and sometimes even disallows) pictures of bikes’ owners.

A thread on the Single Speed/Fixed Gear sub-forum on bikeforums.net was created complaining about the submission to FGG, simultaneously making fun of Mr. Fabian for the lewd gesture and ridiculous pose. The thread is available here. Photoshopping of the original images naturally ensued. This thread now has the potential to become like the now-famously epic, ~500-page-long, so-called “Sherdog Guido thread” (note: the thread was deleted, but a good recap video can be found here).

Here are some of my contributions to the Fabian thread:

                  .JUz?++Jw0!`                                              ..&aex+.
                 J0C+`..+XC:                                 .jgggaa&J....JdHMNNMHkwz+.....++..
               .+UI++^.dXC!                             ...JdXMHHNN#MNmmXWHMN##NMMMNNNNNNNHNNmc`
            ..uXV1+!.JzZk&++                          dwXWNMMMNMH#MMNNMNMMMMM##NNMMMMMMNN##NNMk?+.
         .JJvCwv!``.?zUUWM8:                          jWMMMMMNMNNHMMMMNN###MMNNNMMMMMH#MMNNNMNNQQmo..
      .&XYC+JzI!..+zwwzzwwI                           dMMMMNN#NMMMMMMMMMMHMMMNMMMMNMNNNMMN#NM#H#NMNme+.
     jXC:+1wZ!`.?+OOz++1dHc                         .JdMMMMMN#NNMMNNMMN##NMMMMMNNMMN##NN#NNMMNNNMNNMMNc
    `dHkwz+ztl=?++++zz1?+jW0.               .zXMNMMNNNMMMNNNMN#NNMN#NMNNNN#MN#HHNM#NMMNMMMMMH#NNNNNNMM0!+.
     `XHWkwwO+:;;?==zz;+zzyI`               `jMN#MNNNNNNNN#NN#HHHHHHMNNNNNMMMMmMMNMMMM#N#NMN##H#NNN#MNk+1z.
       ?WkHkOz+++++++;+zwdWC                .JM######NNMMMNNNNM#HH#NNN##NM@MMHqHM#HMM@HMNNHNMM@HNMNHHNMNHmx?+
          ZWXZZZXOttI+:;1O:                 jXMMMMN#HH#NMHMMNMMMM#H@@mHHWXZl????;+!!????UUVOz=zlrXHHN####NMR.
           ?Xyuuuzrl=;;+=z!                 ?jWNNNMM#MNMMMMMMNMMM#MHH@gmHXvO=?=?;;+:`^^`+++;??=ltXWM#######HI
          ..dyyXuvrlzz?=lv                  .?WNMMMMMNNMM##NNM##NNNNNMMHHWXO=?????+:^^^:.;;;??=OvXWMNNNNN#MK:
          `XbWXuXv1zOOOwOl                  `?dMMMNNNNNNMMNMMMHM##MMNMMHXXVv???=??++::;:?;;???ztrXWMNN####NC`
          .dpSztOz+!++zOI!                   .dMMMMNMN##MMHMWHMMMMMMNMMHHSl====?++;;::^.:;;;??=lrXHMN###N##:`
         .dWHWXOz;;+++zwI                     jHMMNNN#NNMMNHM96!?OWMMHMkXZz=lzzzzzz&+?+;++???=zwqHMMNNHHNMD+
         .dHHbWZz;;+1OwI!                     `1XMNNMMMMNMNNNx++J+.vHMHH0z==ztrrvZwXWHHHkOzzzwWUWMNMM#MMNMk.
         ?WH@HH0z?;??zZl                      `jWNNHMNMMNNNMMNm+?+?zXgH0I???+1OXwOzzwkvzVI++dWHWHH#MMNNMMM0`
        .dMHMHWXOzzlzzI!                       jHNNMMNMM##NMMMMNs,.jXHH0l=?+;^`?OWWUUC11??+`zUVwWMMNMMMNNNl
        JXMMHSuuzrttrw0!                       `WMNMN#MMHHNMMMHMMkZ1XfWkll=+;+.^:.:!``+;;;+^+wuXMNMMNMMNMH:
       .dMMHWXvzvtrrwXk+.                       ?WMNN#MMMHH###HMMMS1dWWWw==????;;;::^.+?;?;:?zXHMNMMNNMMM6!
      .dH@HHWuzzzvrvzXHkOtOz+...                 `vMMNNNNN#M@HHHMSIzzWkWOl=??;;?;;;;;??=??+!?1XMNMMMMMMBC`
     .dMH@HHWXvrtttrvXkHZl==????+..                ?TMMMMN#NMMMMHZzz?OWkwOz??;;;??;;;++=z+++?;!?7????!`^`
     .dMMHHWXztlllltwXqRI1+?;;??;1=z+.               +??7WH9!jXWWZ???+wWkwzz?????++zz+1zwwwAdI.
    .dMMHqkfWXvrtllrwWHk=?;;???;???lOw&.                  `.z0rwzO=?;;+vWHkwwzz?=zZ0VOOwwwwXU:
   .dMMMqHWXuzvOlttwXWHS??;?;????+zOtwXI`                  `1=zOrI??;;??zWHkXuOzzlz??zOOwzXS!
   JdMMHkpfZuuzwtttwXpH0?;;?;???zlllwZl`                    `+1ll=??;;;??zZWWkkXwOl==lzzOXuI
 ..dHHHHpVyZuzzrrrruyWW0???????==ztOZl`                      `+????;;;;;??==ZWHHkkAz++++lOWI
 .jWMMHpVyyZuzrrrrrzZWfk?????=lllwzwv`                        `++?;;?;;;??;?zOwXWHHHkmAwXU=
 .dMMMqWZZZZuuvrtttwZWHkl=====ztwuZv`.                         `+:;;;;??;????===trwU=!
`.dMMHHWZuuuzrrrrttzZWbkOOl=ltrzXZC!`                           ``::;;??????=lttrwZ!
`?WHMHfyyZuvrtttrtrzuXbHXXOltrwXW0:``                            ``?;;;;???zztttOv
`JWHHHyyyZXrrvrtlttvvwWHWXrrrwXWC!`                                 `++;++1zOIz?!
 dMMHWVyyuuzvrttlltrvXWkHkuXwdHD!`                                   `