4 ms·
Prepare a hosts file as 127.0.0.1 news.ycombinator.com 127.0.0.1 reddit.com 127.0.0.1 twitter.com etc A shell script to rename the regul
by ww520 14y ago
Prepare a hosts file as
127.0.0.1 news.ycombinator.com
127.0.0.1 reddit.com
127.0.0.1 twitter.com
etc
A shell script to rename the regular hosts file and this one at will. Add it in cron if you want it scheduled.
- idontlikebacon 14y agoI wrote a little shell script that makes it easy to manage host files for this very purpose. You can check it out here: https://github.com/theabraham/wrk https://github.com/theabraham/wrk
- daenz 14y agoFocus.py does something similar, but on a non-fixed schedule https://github.com/amoffat/focus https://github.com/amoffat/focus
- henryboston 14y agoI did this for a while but I just ended up editing my hosts file every time I wanted to stop working. Maybe I just need to practice more self discipline.
- wpietri 14y agoA workable substitute for self-discipline is to make it hard enough to do the bad thing that either your laziness or your better nature wins out. E.g., I don't keep cookies in the house. Instead, I go to the store if I want some. It's pretty rare that I'll overcome my laziness enough to head out for them. And then on the way I often come to my senses. In this case, I might make it harder to edit the hosts file. E.g., a daemon that puts the block back automatically unless I solve 25 captchas. I also really like LeechBlock's option to insert a 30-second pause before viewing banned websites. Since it cancels the countdown if the window loses focus, I have to just sit and wait for half a minute. 90% of the time I'll say, "But I don't even want to look at Facebook now," close the window, and get back to what I want to be doing.
- henryboston 14y agoDo they have LeechBlock for chrome?
- steveplace 14y agoI have taken it to an extreme and got a dd-wrt router that easily blocks websites through both time of day and mac address. My wife is the one that knows the password.
- ww520 14y agoI found that often it's just muscle memory for going to a particular time sink site, like when the project is being rebuilt for that 10 seconds, I would check out HN but got sucked in for much longer. The hosts file blocking just breaks that habit and forces me to focus back on the project.