Scheduling Internet Access on the Mac

4

I'm a student with a Mac laptop on which I take notes. My school has an Internet network. I get distracted during class.

I found this wonderful Mac app called SelfControl, but activating and deactivating it multiple times a day is a real drag.

Is there a way I can schedule SelfControl, or otherwise schedule Internet accessibility, using an AppleScript or otherwise, in order to keep me on track during class? Preferably the solution should be just as "desperate Internet addict"-proof as is SelfControl.

(Full Disclosure: I authored this post during Accounting 1 class.)

Nathan Arthur

Posted 2013-08-26T13:46:39.277

Reputation: 155

1Why are you don't using cron service to scheduling your jobs? – Sepahrad Salour – 2013-08-26T13:49:47.413

Thanks for the suggestion! This is my first Mac. I'm honestly pretty new to all this stuff. Could you point me to some good resources on using cron services? – Nathan Arthur – 2013-08-26T13:53:14.160

1

Sure, You can get main idea from this link: http://hints.macworld.com/article.php?story=2001020700163714

– Sepahrad Salour – 2013-08-26T14:02:58.350

@SepahradSalour Sir, that's Unix, how about Mac users?(Frankly, I did not understand what the article is talking about.) – Ave Maleficum – 2014-04-12T04:41:51.460

1@AveMaleficum Mac OSX was based ontop of BSD which was based on UNIX. – Jacob – 2014-04-12T05:41:52.463

Answers

4

You could do a combination of iCal (suggested here User friendly way to schedule jobs in Mac OS X) and add all the naughty (using this term loosely) places into a daytime (school time) temp host file. So at certain times of the day you swap hosts file. So from 9-4 your host entry for www.facebook.com is 127.0.0.1.

Not the most awesome solution but it will work. Unless you surf via typing in the IP address -- but who does that? ;)

Jason McD

Posted 2013-08-26T13:46:39.277

Reputation: 1 072

I must confess, I can't understand your meaning, Sir. What do you mean by temp host file? – Ave Maleficum – 2014-04-12T13:25:12.810

you have two /etc/hosts files. One hosts file with the sites you would want to suppress while you are in school and are pointing at 127.0.0.1. The other /etc/hosts file is the default one. – Jason McD – 2014-04-12T22:21:51.040

It's a good answer and I'll definitely consider it, but I was asking how to schedule Internet access across the board. Can this be done with a host file? – Nathan Arthur – 2014-04-15T21:14:25.090

1If you setup iCal to run a script to swap the hosts files then you are going to accomplish when you are setting out to do. When you type in a url it's going to resolve via the /etc/hosts file first, then head out to the internet if it can't be found. I do it all the time in the dev. world (minus the scheduling) to achieve different behaviors for the code. True, not the prettiest answer. There are also browser plugins, but those are specific to the browser running. Aka I install a plugin on Firefox and then load Chrome. doh! – Jason McD – 2014-04-15T21:41:07.307

Ok, sorry, I wasn't clear. Could you do something like a wildcard in the host file that would disallow access to all websites, not just certain ones? – Nathan Arthur – 2014-04-15T21:53:10.830

Take a look for dnsmasq. You can do wildcards and what not with it. – Jason McD – 2014-04-16T03:55:11.407