Wednesday, May 10, 2006

Breaking Bad Web Habits with Privoxy

In the past I've had spells of compulsiveness about visiting certain frequently updated websites, like slate.com, and sites with deep archives, like the Onion A.V. Club and Bob the Angry Flower. I can lose big chunks of time, as though I'm in a trance I can't snap out of. When I started finding myself tempted to get into those same bad habits while waiting for things to run etc. in the lab, I decided to put my foot down and find a technological solution. Just something to raise the threshold of temptation higher so I'll usually be able to catch myself before I get into those same ruts - enough time for my better nature to catch up with me.

All you need is a nifty free utility called Privoxy, that is available for both the Mac and PCs.
  1. Download Privoxy from their web page and follow the instructions about how to get it running. But basically this just involves putting the application somewhere, running it, and changing your web browser to use privoxy as a web proxy (by pointing to 127.0.0.1 port 8118). When you are using a proxy, what happens when you ask for a web page, is that instead of requesting it directly you ask a program to go and get it for you - possibly doing some operations on the page before it gets to you. In Privoxy's case, it does a pretty great job of filtering out advertisements and other annoying features of the web.

  2. Try it out on any site that has ad banners and enjoy the relative (visual) peace and quiet. The one thing I should warn you about is that Privoxy can occasionally disable a feature of a web page that you want to use, in particular ones that use pop ups or complicated forms. You might have to temporarily turn off privoxy (by going to http://config.privoxy.org/toggle) if a web page you need is exhibiting strange behaviour. I find it's more than worth it (only like 1 in 100 pages have this problem) for the ad filtering and the selective web blocking, which I will now describe how to do:

  3. Go to the Privoxy Status page (you use your web browser). If Privoxy is set up properly, you will see a page which includes the line "/Library/Privoxy/./default.action" and beside it a View and Edit button. Click Edit.

  4. There will be a bunch of items in a list in a light green box. Scroll to the bottom of that first box and click where it says Insert new section below.

  5. There will be a new box with a green, blue and yellow layer. Click the Add button below where it says "URL patterns:" Type in the pattern of a website that is bad for you. Typically that's just a URL without the http:// part, like "www.retrocrush.com" But it has some features for recognizing partial names. For instance www.guardian.co.uk has a number of different sub-sites, film.guardian.co.uk etc. I wanted to block them all, so I put in just ".guardian.co.uk" Any URL ending with that string would be captured. There's a lot fancier things you can do with URL patterns (most of which I have sadly had to employ at one time or another to defeat some attempt of mine to think of ways around my own blocking software)

  6. Keep clicking add until all your fatal attractions are accounted for (you can come back and add more later)

  7. Decide on the image you want your web browser to be redirected to when you attempt to access one of the forbidden sites. At home, my browser simply goes to this image:



    It's Isaac Newton, glaring at me as if to say, "I invented the generalized binomial theorem when I was 22. What have you done lately?"

    At school it's a different picture, the renowned computer scientist Edsger Dijkstra:



    Also hard to beat in the productivity department - among other achievements he wrote over 1300 brief manuscripts on computer algorithms and many other subjects (in fountain pen!) . Unlike Newton, I've actually met him, when he came to speak at the University of Waterloo, I believe the year he died. It's a friendly picture, yet a firm reminder that maybe time spent reading articles about the worst dressed at the Oscars could be more fruitfully employed.

    Whatever you choose, copy that URL.

  8. Back on your Privoxy Edit Actions screen, just above the list of URL patterns you added, it should say "Actions:" Click Edit. On the line where it says "add-header" in blue, click Enable. Also do that for handle-as-image, and set-image-blocker.

  9. An extra bit for set-image-blocker will appear when you do that, with the words "Redirect the browser to this image URL:" Paste your blocking URL in the box right underneath it, and click submit.


And that's it. Give it a try by trying to access one of the forbidden sites. Sometimes I deliberately do this just to reassure myself that I (and Edgser) am looking after myself.

As I've implied, it can't completely cure you of wasting time on the web, but you can use this to at least break the power of some of your worst temptations. Even when Privoxy is turned off, I still feel much more able to resist their lure.

5 comments:

Anonymous said...

My instinctive feeling on reading this entry, as with many of your other entries, is "Wow - I'm sure glad I don't have to do that!"

If I worked in a job where people tried to impose on me the kinds of rules you and your contributors are describing, I might spend some time arguing for why those rules are counterproductive to me being able to actually produce worthwhile work, but I would more likely just quit outright. It just doesn't make sense to me to put myself through that without even having anyone try to force it on me. I don't think it'll work, and even if it did work I don't think it would be worth it.

I watched a DVD commentary last night. Actually the subtitles to one, on fast forward, so it took a lot less time - but I'm not about to tell myself that I shouldn't.

Eww. Blogger removes capital letters from people's names. How rude!

D said...

I know what you mean, but there's a world of difference if I'm imposing them on myself... any kind of "rules" etc are for me alone, and I wouldn't dream that they would do anything for other people - except possibly give them ideas, and suggest the *principle* of making up their own procedures etc for their own work. (I hope I also make it clear that my own rules and such are meant to be endlessly revised - the point is that it's in a formal way. I have an "exceptions" list for DVD commentaries, and I added Top Secret to it and watched that on tuesday)

So I totally envy you for being able to be so productive with fewer strictures (do you have any? I'd love to hear about them if you do), but that's what I had for the longest time and the alternative - trying to formalize many aspects of how I work - seems to be a lot better.

It would be such a different situation if I were the boss of *someone else* and trying to help them be productive... I would likely avoid even recommending books on my list, unless they asked me about it. Can you imagine your boss plopping a book called "Getting Things Done" down on your desk and saying "read this!"

D said...

(I also hope it comes through here that I don't disapprove of looking at fun websites in general, and of course still do it a lot, but that this was to deal with certain habits that felt really out of control)

Unknown said...

very nice and helpfull article.The translation service is really very helpful to me.access 1337x in UK

Unknown said...

WOW!! Very informative blog and useful article. Please visit this site if you want more detail
Holborn Assets