Ultimate Webdev Time Saver
With my wonder script you have more focus on your customer projects under localhost. So you get things done like a zen master. Believe Me.
timesaver.sh
#!/bin/bash
echo "127.0.0.1 www.facebook.com" >> /etc/hosts
echo "127.0.0.1 www.twitter.com" >> /etc/hosts
echo "127.0.0.1 www.youtube.com" >> /etc/hosts
echo "127.0.0.1 www.pinterest.com" >> /etc/hosts
echo "127.0.0.1 www.stumbleupon.com" >> /etc/hosts
echo "127.0.0.1 www.reddit.com" >> /etc/hosts
echo "127.0.0.1 www.slashdot.org" >> /etc/hosts
echo "127.0.0.1 news.ycombinator.com" >> /etc/hosts
echo "127.0.0.1 www.4chan.org" >> /etc/hosts
echo "127.0.0.1 www.9gag.com" >> /etc/hosts
Written by Béla Varga
Related protips
11 Responses
Hosting all those sites locally must slow your laptop down!

With my wonder script you no longer need this sites.

I coded a bash script ( https://gist.github.com/748896 ) with the same idea and man, you really save time!
Hi netzzwerg,
i cant catch this trick totaly, would you mind just explain how to doit simply?
Thanks in advance ~!

Does not work if you use chrome and already visited those websites : it keeps its own DNS cache and won't care about your changes :(
I tried to make a pomodoro script based on this idea some time ago but had to give up.

All those poor souls integrating social networking APIs.

@naholyr I think including a call to flush the cache may help it work with Chrome. (Not FF yet.) I'm still doing a bit of debugging on the version I built for practice that has a cache flush, but you're welcome to give it a shot.
You can also turn it on/off.

@afgomez I recreated a version of yours to practice my bash scripting. Thanks for putting it out there!

@sjhcockrell neat! I will shamelessly copy the good parts tomorrow and blend them with mine :)

You forgot imgur. :p

cool trick, but isn't the concept of discipline central to the idea of being a zen master?