Dan Phiffer Dan Phiffer is an Internet enthusiast based in Troy, NY

Escape from distractionland

I recently added some scripts to my work laptop designed to help me break out of my reflexive “cmd-T, T, enter” keyboard habit. That keyboard sequence loads up my Twitter timeline in a new tab before I’ve even realized what’s happening. I’m untraining myself out of habitual social media grazing by enforcing a rigid schedule.

Based on Mike Rugnetta’s excellent write-up, I basically hijack my Mac laptop’s /etc/hosts file on a daily interval from 10am to 6pm, with a one hour lunch break at noon. I’ve modified his approach slightly, since I tend to edit my /etc/hosts file regularly for web development, and can’t be bothered to maintain two separate copies of it. Instead of swapping between two different hosts files, I use sed to modify the file in place.

In my hosts file I have a couple lines that look like this at the beginning of the day:

# distractionland

The rule starts the day commented out, so up until 10am it’s still open season on my wandering attention. Notice that you can stack up a bunch of hostnames after the IP address, there’s no need to make a separate line for each one. I recently deactivated my Facebook, so I don’t need that one in the mix any more.

My first script /usr/local/bin/disable-distractions blocks access to Twitter, et al by uncommenting the line:

sudo sed -i .bak -E 's/^# ($/\1/' /etc/hosts

The script creates a backup file hosts.bak and then removes the comment like this:

# distractionland    

The second script /usr/local/bin/enable-distractions comments the line back out, unblocking the websites:

sudo sed -i .bak -E 's/^\s*($/# \1/' /etc/hosts

The -i flag for sed is for “inline” editing, and the -E activates extended regular expression syntax. The edit command uses the form 's/.../.../', which basically reads as “search for … and replace it with …” The first … is a regular expression matching the line, and the second … either prefixes the line with # or removes the #.

I use the launchd daemon to call these scripts using four .plist files according to a daily schedule:

  • 10am: disable-distractions
  • 12pm: enable-distractions
  • 1pm: disable-distractions
  • 6pm: enable-distractions

Note that the computer must be running at each transition time, or the scripts won’t fire. But I can always just invoke one or the other from the command line if needed.

The launchd configuration is handled by four .plist files saved in my /Library/LaunchDaemons folder. Once everything was set up I activated them like this:

sudo launchctl load /Library/LaunchDaemons/org.phiffer.workday-start.plist
sudo launchctl load /Library/LaunchDaemons/org.phiffer.workday-end.plist
sudo launchctl load /Library/LaunchDaemons/org.phiffer.lunchbreak-start.plist
sudo launchctl load /Library/LaunchDaemons/org.phiffer.lunchbreak-end.plist

I’ve found this “one simple trick” has been effective at managing my novelty-seeking brain. Each time I absent-mindedly load up a blocked page I take a deep breath and close the tab. For now I’ve chosen not to block my feed reader, so I’m keeping up with the weblogs I subscribe to much more regularly than I did before. Keep on posting, friends!


A weekly internet radio show designed to help you focus. Streamed each Wednesday at noon, Pacific Time. Hosted by none other than Patrick Ewing (the game developer Patrick Ewing).

Each week we attempt to induce a two-hour state of Flow in the listener: the sense that your work is carrying you along effortlessly like a log in a stream. Long, uninterrupted sets of instrumental music carefully selected as a background for doing creative work. I aim to energize and focus the mind without ever feeling distracting or alienating.

Link via Robin Sloan

Class and attention quality

From yesterday’s New York Times article, “Wasting Time Is New Divide in Digital Era”:

“Despite the educational potential of computers, the reality is that their use for education or meaningful content creation is minuscule compared to their use for pure entertainment,” said Vicky Rideout, author of the decade-long Kaiser study. “Instead of closing the achievement gap, they’re widening the time-wasting gap.”

Policy makers and researchers say the challenges are heightened for parents and children with fewer resources—the very people who were supposed to be helped by closing the digital divide.

The same day Matt Mullenweg posted this video to his blog. It’s a presentation about the social implications of constantly using one’s iPhone, given at a country club.


Digital literacy and attention quality are certainly important across the socioeconomic spectrum, but I do think that it’s legitimate for public policy to focus on the needs of lower income people. More from the Times article:

The new divide is such a cause of concern for the Federal Communications Commission that it is considering a proposal to spend $200 million to create a digital literacy corps. This group of hundreds, even thousands, of trainers would fan out to schools and libraries to teach productive uses of computers for parents, students and job seekers.

Separately, the commission will help send digital literacy trainers this fall to organizations like the Boys and Girls Club, the League of United Latin American Citizens, and the National Association for the Advancement of Colored People. Some of the financial support for this program, part of a broader initiative called Connect2Compete, comes from private companies like Best Buy and Microsoft.

Let me preface this by saying that I have much respect for Microsoft’s danah boyd, who is quoted in the article. But the idea of Best Buy and Microsoft funding a national digital literacy program sounds to me like McDonald’s funding a new school lunch program. “Connect2Compete” sounds like a great name for some dystopian parody of corporate-training-mill style technology education.

Don’t get me wrong, I fully support these kinds of initiatives. I just think we need more independent efforts, for example Jonathan Baldwin’s Tidepools. As part of his thesis project at Parsons, Baldwin set up free community wifi for primarily lower income residents of Brooklyn’s Red Hook. The community mapping application he created uses the visual language of gaming to do things like improve civic infrastructure and map out the locations of NYPD stop-and-frisks.

It’s impressive work, and I’m happy to hear he’ll be developing it further under the New America Foundation. And it’s given me a lot of ideas about how I should proceed with