Slow down distracting sites instead of blocking them entirely

I’ve been a longtime fan of RescueTime, a productivity tool that tracks how much time you spend working in any particular app or website on your computer. The premium version includes a “Focused” mode that replaces many websites that their users indicate (this is adjustable) as distracting with an error page. There are many other tools that implement some variation of this blocking idea, another notable one being Concentrate.

These tools have never fully worked for me. Upon seeing an error page of a blocked site, I still find it difficult to let go of the desire to see what I wanted. After a few times, I get frustrated and get tempted to disable the given piece of blocking software altogether.

On the other hand, I noticed that when faced with a slow Internet connection (say, tethering via EDGE in Ukraine), the desire to browse distracting sites quickly fades on its own as the amount of wait time outweighs the need for distraction (it seems so obviously silly to wait 10-15 sec to read some silly headlines on cnn.com). In other words, impatience easily defeats the desire to be briefly distracted, and since the distraction is no longer brief, the slowness makes it intuitively obvious how much time is really spent.

I’d love to see this integrated into RescueTime and Concentrate, but meanwhile, I remembered that Mac OS X comes with a wonderful firewall utility “ipfw”, and a really simple but effective traffic-shaping tool, “dummynet”.

To slow down a group of sites (tumblr, cnn, hacker news, vimeo, google news) to 3KB/s with a 1000ms latency (Ukrainian EDGE is more like 10KB/s with 500ms latency, but there is also some packet loss), open your terminal, and run:

# clear any firewall rules you may have had already

# (careful! sometimes you don't want this)

sudo ipfw -f flush

# list websites, network blocks

sudo ipfw add 100 pipe 666 ip from www.tumblr.com to any

sudo ipfw add 100 pipe 666 ip from assets.tumblr.com to any

sudo ipfw add 100 pipe 666 ip from tumblr.com to any

sudo ipfw add 100 pipe 666 ip from 69.63.176.0/20 to any # facebook (ARIN TFBNET2) sudo ipfw add 100 pipe 666 ip from 66.220.144.0/20 to any # facebook (ARIN TFBNET3) sudo ipfw add 100 pipe 666 ip from vimeo.com to any

sudo ipfw add 100 pipe 666 ip from news.ycombinator.com to any

sudo ipfw add 100 pipe 666 ip from 157.166.224.0/24 to any # cnn.com

sudo ipfw add 100 pipe 666 ip from 74.125.226.176/29 to any # news.google.com/ru sudo ipfw add 100 pipe 666 ip from 74.125.226.112/29 to any # news.google.com/ru

sudo ipfw add 100 pipe 666 ip from 74.125.226.144/29 to any # news.google.com/ru

# specify the desired speed, latency (you can even do packet loss, if you like)

sudo ipfw pipe 666 config bw 3KB/s delay 1000ms

Naturally, you can add more websites to the list, but do watch out with websites that have use IP addresses (Facebook, Youtube, etc), to slow them down, you will need to list either all of them, or specify a range with a netmask. That’s somewhat annoying and there are likely better ways to do this by having a system-wide throttling proxy with a blacklist, but I have also not seen that as a product either.

Have you ever wanted to do this? How do you avoid distracting sites (other than the tried and true “just don’t do it” method)?