if you're on a mac, Gas Mask is a really good tool to switch between different /etc/hosts files http://www.clockwise.ee/gasmask/ here's my 'focus mode' https://gist.github.com/2564478
Command line tool for blocking sites to be more productive
11–20 of 28 posts
Re: Command line tool for blocking sites to be more productive
#12There are a few versions of it in Python, PHP and sh so you can pick your preference :-)
Re: Command line tool for blocking sites to be more productive
#13# turn on
sudo rm /etc/hosts
sudo ln -s /etc/hosts{.work,}
# turn off
sudo rm /etc/hosts
sudo ln -s /etc/hosts{.play,}
Optimized further (in your ~/.bashrc):
alias work="sudo rm /etc/hosts && sudo ln -s /etc/hosts{.work,}"
alias play="sudo rm /etc/hosts && sudo ln -s /etc/hosts{.play,}"
Optimization cubed (lets you define a base hosts file):
alias work="sudo rm /etc/hosts && sudo cat /etc/hosts.base >> /etc/hosts && sudo cat /etc/hosts.work >> /etc/hosts"
alias play=...
The number of upvotes, the fact that you thought this was necessary and the fact that this application exists all made me facepalm hard. I can't even see right now.
Re: Command line tool for blocking sites to be more productive
#14Optimized version: # turn on sudo rm /etc/hosts sudo ln -s /etc/hosts{.work,} # turn off sudo rm /etc/hosts sudo ln -s /etc/hosts{.play,} Optimized further (in your ~/.bashrc): alias work="sudo rm /etc/hosts && sudo ln -s /etc/hosts{.work,}" alias play="sudo rm /etc/hosts && sudo ln -s /etc/hosts{.play,}" Optimization cubed (lets you define a base hosts file): alias work="sudo rm /etc/hosts && sudo cat /etc/hosts.bas…
Re: Command line tool for blocking sites to be more productive
#15Nice project, though if you'd rather not install Node.JS and all of its dependencies, you might want to try https://github.com/leftnode/get-shit-done There are a few versions of it in Python, PHP and sh so you can pick your preference :-)
https://github.com/richardjharris/get-shit-done
I've just realised I'll need to update it now Arch is using systemd...
Re: Command line tool for blocking sites to be more productive
#16Nice clean tool. Thing is, I'd like these tools to wearing muzzle to lose weight. It's misdirection of effort into avoiding rather than addressing the demonstrated issue of self-control.
Re: Command line tool for blocking sites to be more productive
#17Optimized version: # turn on sudo rm /etc/hosts sudo ln -s /etc/hosts{.work,} # turn off sudo rm /etc/hosts sudo ln -s /etc/hosts{.play,} Optimized further (in your ~/.bashrc): alias work="sudo rm /etc/hosts && sudo ln -s /etc/hosts{.work,}" alias play="sudo rm /etc/hosts && sudo ln -s /etc/hosts{.play,}" Optimization cubed (lets you define a base hosts file): alias work="sudo rm /etc/hosts && sudo cat /etc/hosts.bas…
Re: Command line tool for blocking sites to be more productive
#18Sweet. I am going to try this out! Has anyone here used Self Control? ( http://visitsteve.com/made/selfcontrol/ ). Sometimes when I block websites, like Reddit.com and this one and few others it makes other websites look weird. Like the page will still load but be broken. I think Self Control is blocking sites the same way this does. Any idea why this happens?
Re: Command line tool for blocking sites to be more productive
#19Optimized version: # turn on sudo rm /etc/hosts sudo ln -s /etc/hosts{.work,} # turn off sudo rm /etc/hosts sudo ln -s /etc/hosts{.play,} Optimized further (in your ~/.bashrc): alias work="sudo rm /etc/hosts && sudo ln -s /etc/hosts{.work,}" alias play="sudo rm /etc/hosts && sudo ln -s /etc/hosts{.play,}" Optimization cubed (lets you define a base hosts file): alias work="sudo rm /etc/hosts && sudo cat /etc/hosts.bas…
This is close to what I have, except less complex. A single line in /etc/hosts that redirects sites to 127.0.0.1, which gets commented or uncommented. The fact that I have to go through the hassle of sudoing up and removing the comment means I'm far more likely to catch myself before doing it and getting back to work.
alias play="sleep 120 && ..."
Two minutes should be enough for the craving to pass :-)
Re: Command line tool for blocking sites to be more productive
#20Your mind is not willing to do the task you need it to do and there is nothing you can do about it. (that's my experience)