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
  • 155
  • 10

1 Answers1

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
  • 1,062
  • 1
  • 10
  • 14
  • I must confess, I can't understand your meaning, Sir. What do you mean by *temp host file*? – Ave Maleficum Apr 12 '14 at 13:25
  • 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 Apr 12 '14 at 22:21
  • 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 Apr 15 '14 at 21:14
  • 1
    If 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 Apr 15 '14 at 21:41
  • 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 Apr 15 '14 at 21:53
  • Take a look for dnsmasq. You can do wildcards and what not with it. – Jason McD Apr 16 '14 at 03:55