Not only does
BASH cure cancer, but it can stop you from wasting time on the intertubes. While lying on the grass today I realised that I have a few 'jumping off' sites for non-work meanders; gateway drugs of sorts. By blocking these sites, I can stop myself from getting sidetracked most of the time and prevent Work Avoidance Behaviour (WABbing). If you're one of those people who can stick to a schedule, you could even cron it. Read the
crufty-4am-produced shell script yourself, or the English below.
The shell script has two variables at the top, the location of your block list and the location of your hosts (as in /etc/hosts) file. Anyone with a modicum of unix knowledge should get how it works now (if not, don't use it). As an additional step I export my Tomboy todo list to HTML and use netcat to serve it up on localhost (trying to use a combination of dbus and the ExportToHTML xsl to automate this, but not succeeding). This ensures that I am not only prevented from being side tracked, but am put back on track.
The block list is formed by listing the base domain for each site, one per line. For example:
singe@blackguard:~$ cat ~/.worktime
facebook.com
bloglines.com
twitter.com
singe.za.net
engadget.com
gizmodo.com
boingboing.net
You'll need to run it as root to modify the hosts file. For example:
singe@blackguard:~/bin$ ./worktime.sh
Invalid argument!
The options are "on" or "off" e.g.:
./worktime.sh on #to enable work time
./worktime.sh off #to enable play time
singe@blackguard:~/bin$ sudo ./worktime.sh on
Get to work!
singe@blackguard:~/bin$ sudo ./worktime.sh on
It's already work time.
singe@blackguard:~/bin$ sudo ./worktime.sh off
Work's done, let's play.
singe@blackguard:~/bin$ sudo ./worktime.sh off
You're already playing.
You can download it here.
Tracked: Jan 23, 09:12