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!
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/4782/393640f88c24599cde6d104c3d0b913c.jpeg)
With my wonder script you no longer need this sites.
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/46147/578855_3794745059411_1045494353_n.jpg)
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 ~!
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/37915/396445b6e14727dcb6b3d6a66d52b567.png)
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.
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/7034/b50005fc2bfb82715bd0ab1e03f8db45.png)
All those poor souls integrating social networking APIs.
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/21020/g_profile.png)
@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.
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/21020/g_profile.png)
@afgomez I recreated a version of yours to practice my bash scripting. Thanks for putting it out there!
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/46147/578855_3794745059411_1045494353_n.jpg)
@sjhcockrell neat! I will shamelessly copy the good parts tomorrow and blend them with mine :)
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/6655/a2f9d9f971b1ab40760413c96d43261e.png)
You forgot imgur. :p
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/26874/ec61d4d2928411e280a722000aaa08b2_7.jpg)
cool trick, but isn't the concept of discipline central to the idea of being a zen master?