This is a read-only archive!

Productivity Booster

I came up with a great way to increase my productivity recently. You need a locally-running Apache server for this to work most effectively.

First you need to set up a redirect for 404 requests to localhost. On my system I determined that DocumentRoot is /srv/http, so I set this up in /etc/httpd/conf/httpd.conf:

<Directory "/srv/http">
    AllowOverride All
</Directory>

Next I edited /srv/http/.htaccess to redirect 404's to a main index page:

ErrorDocument 404 /index.html

Then I created /srv/http/index.html:

<html>
    <head>
        <title>GET BACK TO WORK, YOU HOBO</title>
        <style type="text/css">
            html {
                background: #f00;
            }
            h1 {
                color: #0f0;
                font-family: sans-serif;
                text-align: center;
                margin-top: 100px;
                font-size: 64pt;
            }
        </style>
    </head>
    <body>
        <h1>GET BACK TO WORK, YOU HOBO</h1>
    </body>
</html>

Almost done; the final step is to edit /etc/hosts:

127.0.0.1 reddit.com www.reddit.com slashdot.org news.ycombinator.com

Now I see this. Image hidden behind a link to spare the eyes of my readers.

If this doesn't work, you could try making the background color flash quickly between red and green, or add a background MIDI and some animated GIFs.

October 08, 2010 @ 8:09 AM PDT
Cateogory: Linux

6 Comments

laurus
Quoth laurus on October 08, 2010 @ 11:58 AM PDT

Brian,

Thanks for this. I can't wait to use it. This is the kind of thing that makes blogs great. By the way, I've found your Clojure posts quite intriguing and helpful! Keep it up! :)

ikarus
Quoth ikarus on October 08, 2010 @ 1:29 PM PDT

C'mon, give yourself a break =)

Dion Moult
Quoth Dion Moult on October 08, 2010 @ 4:22 PM PDT

Well somebody is going to install this at our workplace soon no doubt.

Merlin
Quoth Merlin on October 09, 2010 @ 5:53 PM PDT

Thanks for the laugh ;)

I am really tempted to install this on our proxy at work ;) Way too many people hang out on facebook all day.

Daniel Janus
Quoth Daniel Janus on October 11, 2010 @ 10:50 AM PDT

I have come up with something similar some time ago; doesn't block URLs but instead nags me when I stop working in Emacs for a couple of minutes:

anti-procrastination.el

httpundefined

Shawn
Quoth Shawn on November 04, 2010 @ 7:55 AM PDT

Oh god, the hours of my life wasted on those sites. If you're a Firefox user and don't feel like going through the hassle of maintaining an Apache server, try the LeechBlock extension. It has some niceties like a timer and password protected lockdown mode.