If you are having trouble staying motivated to work, then you need to fix that. For me, browsing facebook et al is a palette cleanser of sorts. If I lock myself to only being able to view 'work' sites, I'd become too stressed to do my best work.
Interesting to hear that you feel more stressed when you lock yourself out of palette cleansing sites. For me, I sometimes get this background anxiety/agitation when working in front of a computer for long periods of time, which can tip me into distraction when I hit something frustrating.
My computer is a shared leisure/work machine, which means that it can fall into the "working in the bedroom effect:" I find that I don't work well in that space because it's where I sleep and relax at the end of a day.
I create a boundary between relaxing/working states by changing environment: going to a coffee shop, office, or another room.
For some reason, this script has a similar boundary/environment effect on me: an intentional step to create a different "space" where I am working.
# Read from the array, and remove files from /etc/hosts
for site in $*; do
sed -i '' "/127.0.0.1 $host/d" $hosts
Now I need to figure out why it seemed to work in the first place.
1. Permanent for a time period. It is incredibly, incredibly hard to undo. This is what makes it different from the others
3. GUI with whitelist/blacklist
It wasn't meant for public consumption, but mine takes care of IPv6 access.
*edit: this is for os x.
# NB: left unquoted so it's split by the IFS.
blocked_sites=$(grep -v '^#' "$blocked_hosts")
I'll take a look, thanks for the suggestion!
But 30 seconds is also a decent amount of time to convince myself that I don't really need to see that site right now, and often I'll just close the tab a few seconds in and get on with work.
and it as really helped me (serial redditor) be more productive.
Did a combination of Chrome/Safari nanny plugins for a while, but the effort of `sudo` + password seems to be working better and is a bit easier to turn on/off for me.
If there's nothing bash-specific you may wish to use "#!/bin/sh" (or "#!/usr/bin/env bash" if bash is required.)