Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've just installed Self Control for Ubuntu.

It looks like it just tweaks /etc/hosts and defines some rules in iptables.

Some sites aren't getting blocked, and I think it's because they're distributing hosting across a couple of servers. There's a system administrator way to say that, I'm sure, but I suspect I need to define wildcard rules.

So my first question is: can I write wild card rules for /etc/hosts and iptables (which?) to prevent access to anything at, hypothetically, *.facebook.com? I don't need to do this inside of SelfControl.

I'd also like to fail more elegantly -- now the page just tries to load and doesn't. I'd like to redirect to a local page where I can offer myself little reminders about how this isn't actually where I want to spend my down time. Can I do that w/in the framework above? Redirect to a page on localhost?

(I am running a local web server, as I think anyone on Ubuntu is)

share|improve this question
add comment

2 Answers

No, you can't have wildcards in /etc/hosts.

One easy way to set this up where you can have wildcards is to install a local Squid proxy, and then use squid ACLs to ban access to *.facebook.com, askubuntu.com, etc. You can make these ACLs active only for particular times of the week. Then you just need enough selfcontrol not to turn off your browser's proxy settings.

share|improve this answer
add comment

Some home based routers also offer fairly robust access restrictions as well which would not be tied to your OS but your MAC or IP address instead. I use the features in my router to block my child's access to specific sites as well as completely block access if there is a reason to, i.e., grades, restriction for other reasons. It uses rules which can be applied in several different manners including times of the day and days of the week.

just wanted to provide another alternative. :)

share|improve this answer
    
That would infuriate my family, I'm sure. But it is tempting. –  Amanda May 16 '11 at 18:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.