Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Easy blocking of internet access to avoid distractions Internet
As much as one would like to exercise pure personal discipline in avoiding constant web browsing and email checking when we need to be working seriously, sometimes it takes a little bit of a forced "fencing off" of distractions. Some routers have timing routines built into their config -- but not AirPorts (as far as I can tell.)

Here's what to do: go buy a cheap household lamp and appliance timer (usually under ten bucks from your hardware store; here's the one I use. I have my timer set to 'turn off' access between 7:00am and 1:00pm. You can get timers that give you one, two, or three cycles daily.

Now, the real tip, with two options:
  1. Put the timer between your cable modem and your AirPort. This will block all access, including to your local network. It keeps your VOIP phone service on.
  2. Put the timer between your cable modem and the AC wall power. Advantage? Maintains LAN access, and if you use a VOIP phone service, it turns that off as well, for total distraction control.
This works best for me when my AirPort and cable modem are in a room far from my home office -- less chance of cheating.

[robg adds: Draconian, I know, but I thought it a creative use of a wall timer to enforce a net-free work time. Of course, since my work time requires that I be on the net, this really wouldn't work in my setup. Reverse the hours though, and I could use it to insure I only go online when it is work time...]
    •    
  • Currently 2.90 / 5
  You rated: 4 / 5 (10 votes cast)
 
[23,966 views]  

Easy blocking of internet access to avoid distractions | 15 comments | Create New Account
Click here to return to the 'Easy blocking of internet access to avoid distractions' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Easy blocking of internet access to avoid distractions
Authored by: kirkmc on Jan 11, '07 07:47:25AM

You can also just create a new location in the Network prefs with all network adapters off, and switch to it from the Apple menu when you want to block access...

Kirk

---
Read my blog: Kirkville -- http://www.mcelhearn.com
Musings, Opinion and Miscellanea, on Macs, iPods and more



[ Reply to This | # ]
Easy blocking of internet access to avoid distractions
Authored by: silas on Jan 11, '07 08:15:43AM

I'm looking for a lamp timer that will do the following during "focus" time:

-Block incoming e-mail that isn't related to the specific projects I need to make progress on, but allow others through
-Block outgoing web requests that are more than one degree removed from the original topic matter I was working on, but allow others through
-Only allow streaming of net radio stations without lyrics or other spoken words
-Delivery brief electrical shocks to the base of my spine every time I attempt to circumvent the above.

I asked about this at the local consumer lighting store, and they didn't have one. Searches on Amazon have been fruitless so far. Surely Linksys or Belkin make something like this?

Silas



[ Reply to This | # ]
Easy blocking of internet access to avoid distractions
Authored by: dzurn on Jan 11, '07 12:50:33PM

Shoot, is that all? That's easy.

I've got a really good Linksys one hooked up to my spine right n

---
Madness takes its toll.
Please have exact change.



[ Reply to This | # ]
Easy blocking of internet access to avoid distractions
Authored by: deleted_user4 on Jan 11, '07 02:15:44PM

How about two stay-open applescripts? That's what I do when I need to get down to it. Have them both check to make sure your frontmost application is Word (or whatever) every 10 seconds or so, and every time it catches something else up, have it quit it, and return you to word, delivering a chastising message while it's at it (I have mine tell the computer in the living room to announce to my whole appartment that I am slacking off, to keep me motivated to stay on track).

The great thing about having two running is that you can have each one check to see if the other is running, and if it's not, it can relaunch it. So you can't even get out of this one if you want to, unless you kill both processes at once. Incredibly annoying, but effective!



[ Reply to This | # ]
Easy blocking of internet access to avoid distractions
Authored by: eaglemoon on Jan 19, '07 06:51:06PM

Can you perhaps provide what those scripts might be? Would really appreciate it!

Tx



[ Reply to This | # ]
Easy blocking of internet access to avoid distractions
Authored by: mlanger on Jan 16, '07 05:37:15AM

Silas, I'm with you. Blocking it ALL isn't practical since we really do NEED to access the Net to get work done. When you find the lamp timer with the features you listed, be sure to tell the rest of us here about it. ;-)



[ Reply to This | # ]
Easy blocking of internet access to avoid distractions
Authored by: edified on Jan 11, '07 08:48:20AM
Also of note is that apple's new airport extreme lets you change access rules by time constraints. It's really cool!

Cheer, Ed

[ Reply to This | # ]

even simpler.
Authored by: SOX on Jan 11, '07 04:47:11PM

you can also set up a cron job to toggle your
/etc/hosts.allow
flie to be blank and your hosts.deny file to
ALL : ALL

Alternatively if there are simply specific websites you want to prevent youself from going to you can instead add these to your hosts file like this
127.0.0.1 apple.slashdot.org slashdot.org macoshints.org nytimes.org

this will map those servers to your loopback address effectively blocking them.
if you make your ~/sites/index.html be
<H1>Get back to Work</H1>
it's even more effective



[ Reply to This | # ]
not as simple as I am!
Authored by: DotDotComma on Jan 12, '07 02:32:13AM

As in the hint at top, I've been doing a similar time-switching of half the home network to control net access for some time, but this 'cron' approach sounds perfect to tailor it a little more to individual users ...

Could you, o clever one, point me - less-clever one! - to some brief outlines on creating a cron setup to achieve this (can't even find my hosts file .... doh!)

Many thanks ....



[ Reply to This | # ]
not as simple as I am!
Authored by: SOX on Jan 12, '07 07:34:56AM
Okay i'll help you, but rather than give you the answer I'll help lead you through it.

First cron is a fairly easy syntax and the global root cron is located in /etc/crontab and it has a man page for it's syntax. (There's also user level crons in /var/crontab). But the modern way is now to use launchDeamon which has a more complex syntax that is both self documenting and a little intimidating. TO see how to do this look in
cat /System/Library/LaunchDaemons/com.apple.periodic-daily.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">;
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.apple.periodic-daily</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/periodic</string>
<string>daily</string>
</array>
<key>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
</dict>
</plist>

So you just copy this twice, make one called blocker.plist and one called unblocker.plist

in blocker,plist
change the program arguments array to
<string>/usr/local/bin/waxon_off.pl </string>
<string>off</string>
change the time to
<key>Hour</key>
<integer>8</integer>

in unblocker set things to

change the program arguments array to
<string>/usr/local/bin/waxon_off.pl </string>
<string>on</string>
change the time to
<key>Hour</key>
<integer>17</integer>

Now we need to create waxon and waxoff

copy and paste the following into a terminal
cat >/usr/local/bin/waxon_off.pl
/usr/bin/perl -w
open FH, "/etc/hosts.orig";
@S = <FH>;
close FH;
open FH, "/etc/hosts";
print FH, @S,"\n";
if (@ARGV[0] eq "off") {
print FH<<EOF;
127.0.0.1 slashdot.org apple.slashdot.org
127.0.0.1 macosxhints.com
EOF
close FH;
}

Then execute:
sudo cp /etc/hosts /etc/host.orig
chmod a+x /usr/local/bin/waxon_off.pl


There. now you will turn things off at 8 am and turn things back on at 5 pm

if you want to revert this remove the plist file and then restore the original hosts file like this.

sudo cp /etc/hosts.orig /etc/host

if you want to override it manually use
/usr/local/bin/waxon_off.pl off

edit the segment
print FH<<EOF;
127.0.0.1 slashdot.org apple.slashdot.org
127.0.0.1 macosxhints.com
EOF

to include whatever sites you want blocked.






[ Reply to This | # ]
typo fix
Authored by: SOX on Jan 12, '07 10:26:52AM

copy and paste the following into a terminal
cat >/usr/local/bin/waxon_off.pl
#!/usr/bin/perl -w # typo fix
open FH, "/etc/hosts.orig";
@S = <FH>;
close FH;
open FH, ">/etc/hosts"; # fixed a typo
print FH, @S,"\n";
if (@ARGV[0] eq "off") {
print FH<<EOF;
127.0.0.1 slashdot.org apple.slashdot.org
127.0.0.1 macosxhints.com
EOF
close FH;
}



[ Reply to This | # ]
typo fix again
Authored by: SOX on Jan 12, '07 03:28:58PM

copy and paste the following into a terminal
cat >/usr/local/bin/waxon_off.pl
#!/usr/bin/perl -w # typo fix
open FH, "/etc/hosts.orig";
@S = <FH>;
close FH;
open FH, ">/etc/hosts"; # fixed a typo
print FH, @S,"\n";
if ($ARGV[0] eq "off") {
print FH<<EOF;
127.0.0.1 slashdot.org apple.slashdot.org
127.0.0.1 macosxhints.com
EOF
close FH;
}



[ Reply to This | # ]
typo fix again
Authored by: eaglemoon on Jan 19, '07 06:54:34PM

Hi,

Thanks for the hints!

Two questions:

1)Can this also block email traffic? I don't want any internet period!

2)Is there a way to create a little application that would do this from a GUI?

I am new on the Mac - would be happy to figure out a way to do this!



[ Reply to This | # ]
Easy blocking of internet access to avoid distractions
Authored by: RandyMan on Jan 15, '07 03:04:04PM
Funny, I just bought one of these to keep my internet connection alive at all times.

My DSL modem/router has this nasty habit of locking up at the most inconvenient times (like a day and a half into my 10 day vacation, when I'm not home to cycle its power), so I'm going to use this to do a power cycle every 24 hours, so that I have continual access to the servers I run from home.

[ Reply to This | # ]

Easy blocking of internet access to avoid distractions
Authored by: eaglemoon on Jan 19, '07 06:49:01PM

Hi,

Thanks for the hints!

Two questions:

1)Can this also block email traffic? I don't want any internet period!

2)Is there a way to create a little application that would do this from a GUI?

I am new on the Mac - would be happy to figure out a way to do this!



[ Reply to This | # ]