Where developers come to connect, share, build and be inspired.

64

Ultimate Webdev Time Saver

6319 views

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

Comments

  • 41470_701060859_7290_n_normal
    rauschma

    Hosting all those sites locally must slow your laptop down!

  • Blank-mugshot
    SaberUK

    Mine is shorter:

    sudo ifconfig en1 down

  • Blank-mugshot
    netzzwerg

    With my wonder script you no longer need this sites.

  • 578855_3794745059411_1045494353_n
    afgomez

    I coded a bash script ( https://gist.github.com/748896 ) with the same idea and man, you really save time!

  • Blank-mugshot
    srih4ri

    All those poor souls integrating social networking APIs.

  • G_profile
    sjhcockrell

    @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://github.com/sjhcockrell/gsd/downloads

  • G_profile
    sjhcockrell

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

  • 578855_3794745059411_1045494353_n
    afgomez

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

  • E5b570ba6b6acbbfb1cb1145540486d6_normal
    codydmd

    Hi netzzwerg, i cant catch this trick totaly, would you mind just explain how to doit simply?

    Thanks in advance ~!

  • Blank-mugshot
    naholyr

    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.

  • Blank-mugshot
    MrJoy

    You forgot imgur. :p

  • Ec61d4d2928411e280a722000aaa08b2_7
    jyoungblood

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

Add a comment