Lots of people commenting if your code is fun you shouldn't have to restrict yourself, blah blah blah. That's not the problem. The problem is how easy it is to instantly distract yourself. <i>Taktaktaktaktak</i> "Oh hey, I wonder if so-and-so replied on my Facebook, let's just to a quick look.." <i>5 hours later</i> "Oh snap, the time just flew by!"<p>If you're serious about blocking yourself from parts of the Internet, do it comprehensively. Here's what I do.<p>Most of the advice on this page is blocking from the browser-level or OS-level. This is easy to bypass, and you have to configure every device. You need to work at the router-level.<p>Let's talk blocking. A complete blacklist is wrong, you still need some Internet to Google or ask for help. e.g. stackoverflow.com, etc. Similarly, whitelists don't work because you can't possibly list every site you may need access to -- you may not know they exist yet. You need a keyword-matching blacklist.<p>You need two things:<p>1. WRT54GL router ($20-$50)
2. Tomato firmware: <a href="http://www.polarcloud.com/tomato/" rel="nofollow">http://www.polarcloud.com/tomato/</a><p>Vendor firmware usually has access restrictions, but they usually limit it to like 10 websites, and it usually doesn't have pattern-matching. You need a 3rd party firmware like Tomato.<p>Install the firmware per instructions from its website. It's really easy. The firmware has a page called "Access Restrictions". It does keyword blacklists/whitelists. You can block yourself for only certain hours of certain days. Here is an easy video tutorial from their website to guide you: <a href="http://www.polarcloud.com/v/screst.htm" rel="nofollow">http://www.polarcloud.com/v/screst.htm</a><p>For example, one keyword I use is "news". BAM! All URLs with the word "news" instantly blocked. Good. I don't need to be reading news when I should be coding. Resources like stackoverflow.com don't usually put "news" in their URLs, so they're safe.<p>There is the problem of unplugging the uplink from the router and directly into your computer (bypassing the router), or simply reconfiguring the router without restrictions. If you lack that much self-control, which I can understand (as I do too!!!), I recommend locking your router in a electrical enclosure and throwing away the key. Ok, not really. I made a cron job for the router that changes its login password to gibberish at some hour of the day, and X minutes prior it sets it to my normal password. Thus, I have X minutes of access to the router per day, should I need it.