4 ms·
127.0.0.1 Reddit reddit.com 127.0.0.1 techcrunch.com techcrunch 127.0.0.1 news.ycombinator.com 127.0.0.1 facebook.com 127.0.0.1 fark.com etc....
by phlux 16y ago
127.0.0.1 Reddit reddit.com
127.0.0.1 techcrunch.com techcrunch
127.0.0.1 news.ycombinator.com
127.0.0.1 facebook.com
127.0.0.1 fark.com
etc....
- vain 16y agoHow did you see this post with those host settings?
- thenduks 16y agoI've done this temporarily before with a simple hostfile swap script that I run when I've got something serious to do.
- btucker 16y agoHow about having your hostfile swap script change your IM status to something like "Goofing off online." (or whatever)? Nothing like the shame of broadcasting that to your coworkers to get you to keep your goof off time to a minimum.
- zecho 16y agoThis is a great idea. Mind sharing your script? I block annoying sites with my hostfile, too, but every once in while I actually need to look at something on Facebook. This would also be useful as it's a big mess with all the changes I have to make for work, too. Storing them separately would be super helpful.
- xuki 16y agoCreate 2 files hosts.work & hosts.play in /etc Add these 2 lines into .profile or .bash_profile alias work='sudo cp -f /etc/hosts.work /etc/hosts' alias play='sudo cp -f /etc/hosts.play /etc/hosts' If you don't want to sudo, chmod /etc/hosts.
- yogsototh 16y agoGreat idea! Should be mixed with crontab that disable "play mode" every 30 minutes forcing you to manually copy the play host file.
- loire280 16y agoJust remember to be careful with changing permissions on your hosts file. You wouldn't want an unprivileged user to be adding lines to it. 69.57.123.17 your-bank.com
- rhizome 16y agoalias work='sudo ln -sf /etc/hosts.work /etc/hosts' alias play='sudo ln -sf /etc/hosts.play /etc/hosts'
- aquadoctorbob 16y agoHere's how I do it, improvements welcome: https://gist.github.com/875467 https://gist.github.com/875467
- zecho 16y agoAwesome. I actually started to write a script based on cp'ing different hostfiles, but I think I like this way better. Thanks!
- phlux 16y agoThis is hacker news, you know
- scorpion032 16y agohttp://174.132.225.106/ http://174.132.225.106/
- eli 16y agoHere's a much better IP address to use: 66.135.33.106 (try it out http://66.135.33.106/ http://66.135.33.106/ ) Using localhost can make things awful confusing if you ever happen to run a webserver on port 80 while developing something.
- leftnode 16y agoHere's a little script I wrote to block all of my popular ones - https://github.com/leftnode/get-shit-done https://github.com/leftnode/get-shit-done