Getting SelfControl to work for me.
March 8, 2010 6:00 PM   Subscribe

SelfControl filter: I am trying to use SelfControl to block certain websites relatively permanently using Automator or something but I don't know what I'm doing.

SelfControl has a 12 hour lockout limit. Once the timer is running you can't add more time to the lockout until the timer runs out. My idea was to get Automator to launch SelfControl every 12 hours and "watch me" click the the "Start!" button on SelfControl. I see this working perfectly craptacularly. Does anyone with more Automator or Applescript experience know how I might achieve blockage?
posted by who else to Computers & Internet (11 answers total) 4 users marked this as a favorite
 
If you truly want to make it hard to click through to a website, you can do the following in the terminal, it takes more steps to enable, but that also means it will take more steps to undo. If your goal is to keep yourself from going to specific sites, it may be a little more useful in that regard. (Note this is not exactly for the faint of heart, if you have trepidations you may want to wait for a user friendly way to do this to show up).

In /Applications/Utilities/Terminal.app, you want to do the following series of commands:
First, backup your hosts file (this is what can override the address for a website you are visiting, we are pretty much going to route facebook to nowhere in the eyes of your computer):
cp /etc/hosts ~/hosts.bak

Now we are going to edit the original:
sudo nano /etc/hosts

It will prompt you for your account password, and then open a file that looks like this:


##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost



At the bottom of the screen will be some commands, the ^ means the control key.

In between:
255.255.255.255 broadcasthost
::1 localhost

You will want to insert:
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com

so now your file looks like:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
::1 localhost
fe80::1%lo0 localhost


Press control-w and then control-x to save, then quit, the nano application.

You may have to run the command:
dscacheutil -flushcache

before you will notice the changes (also quit and relaunch your browser).

You can remove the "block" by either editing the file again and removing the lines you added, or just adding a # to the beginning of each line you added, and saving the file, etc.
posted by mrzarquon at 6:36 PM on March 8, 2010 [1 favorite]


I use Concentrate to block time-sucking websites. It has a 12-hour cap as well, but you can easily drag the timer slider before the clock runs out to top it up again.
posted by Robot Johnny at 6:48 PM on March 8, 2010


Correction: Concentrate has no time limit, actually. I was looking at one of my custom "tasks" which was set to 12 hours. There's no unlimited option, but you can easily enter in x amount of hours. I tried with 999 and it worked fine.
posted by Robot Johnny at 6:51 PM on March 8, 2010


FYI Concentrate is not a free app, but I've found it to be $29 well spent.
posted by Robot Johnny at 6:52 PM on March 8, 2010


Response by poster: Robot Johnny: the only thing with Concentrate is that you just have to quit the app and you can access the websites again. Not so with SelfControl.

mrzarquon: thanks for taking the time to write that out, I will have to digest that info to see if I can make use of it!
posted by who else at 7:48 PM on March 8, 2010


If you use Firefox, there's a plugin called Leechblock that has much more finely tuned settings than SelfControl does. You can definitely set it up to more or less permanently block a site or sites or make sites available only for a certain time of day or for a certain preset amount of time within a block of time.

Of course, the trick is that you can always fire up another browser, but for myself I've found that Leechblock does the job for me, as seeing the denial screen come up is enough to remind me not to be time wasting.
posted by ursus_comiter at 12:45 AM on March 9, 2010 [1 favorite]


http://www.proginosko.com/leechblock.html
posted by ursus_comiter at 2:41 AM on March 9, 2010


This is easy to do with ical. Just create an event for the time you want the program to launch. Set the alarm for the event as "open file". Just make sure the file it is opening is the application.
posted by travis08 at 9:03 AM on March 9, 2010 [1 favorite]


Response by poster: The other thing I was thinking since I think the fail points of this Automator plan are recording a mouse input macro and getting the timing right of having the script run twice a day, I was thinking I could get something to make SelfControl pop up when an offending url is visited in my browser and then I can just hit the kill switch. Doable?
posted by who else at 10:59 AM on March 9, 2010


You can also use a visual editor like BBEdit or TextEdit to edit the hosts file, if the idea of using nano puts you off.

There's also this GUI tool for editing the hosts file.

Another option here might be to use OpenDNS. You can use it to blacklist specific sites. I use it on my home network.
posted by chazlarson at 11:54 AM on March 9, 2010


Karl James Pestka published an applescript he wrote for this today: http://www.macosxhints.com/article.php?story=20100801214648362
posted by SteveLambert at 10:36 AM on August 3, 2010 [1 favorite]


« Older I want Xu Xus!   |   Minor mistake or red flag? Newer »
This thread is closed to new comments.