Is there a website that’s utterly toxic to your mental state or ability to work? Maybe you grind your teeth over your ex’s weblog, which details every moment of her happy new life without you. Maybe you’ve lost hours of your life trolling eBay auctions and you simply can’t allow yourself to impulse-buy another autographed Neil Diamond record. Perhaps online backgammon can snatch away hours of your day at the office.
The preceding hack describes how to block time-wasting websites during certain times of the day and week. Alternatively, you can block sites at all times, until you explicitly release the restriction. This hack fakes your computer into thinking that those problem sites live on your hard drive — although obviously they don’t — and forces a Server Not Found error when your fingers impulsively type that tempting, time-sucking URL.
Here’s what to do.
Windows
1. Open Notepad or some other text editor (in Windows 7, you need to open your text editor with elevated privileges by right-clicking the editor and clicking Run as Administrator); then open the file named hosts, which is located in the following directory: C:\WINDOWS\SYSTEM32\DRIVERS\ETC.
2. Add the following on its own line in the hosts file:
127.0.0.1 ebay.com facebook.com evilex.com
Replace the sites listed with the domains that you want to block.
Mac OS X
1. In Finder, choose Go ⇒ Go to Folder.
2. In the Go to Folder dialog, type /etc/.
3. From the /etc/ folder window, locate the hosts file and Cmd+click it. From the context menu, choose Get Info. In the Ownership & Permissions area, set You Can to Read & Write.
4. Now open the hosts file in a text editor.
5. Add the following on its own line in the hosts file:
127.0.0.1 ebay.com facebook.com evilex.com
Replace the sites listed with the domains that you want to block.
The Result
After you complete the steps for your operating system, save the hosts file and quit your editor.
Now when you visit one of your blocked sites, you get a Server Not Found error. (If you’re running a web server at home, as detailed in Hack 71, “Run a Home Web Server,” your own server’s files appear.)
The advantage of this method over Hack 39, “Limit Visits to Time-Wasting Websites” is that the sites are blocked from every browser, not just Chrome (StayFocusd) or Firefox (LeechBlock), on that computer. The downside is that when you decide it’s an okay time to browse eBay, you have to manually comment out the following line in the hosts file by adding a # to the beginning of the line, like this:
#127.0.0.1 metafilter.com flickr.com
That’s a deliberately huge inconvenience — one that can help keep your wandering clicker in line when you’re under a deadline.

Post a Comment

Previous Post Next Post