Created
May 31, 2012 20:13
-
-
Save paulsmith/2845915 to your computer and use it in GitHub Desktop.
The least user-friendly version of `Freedom' I could come up with
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc | |
# Freedom! | |
freedom () { | |
sed '/# FREEDOM/{n;s/^#//;}' < /etc/hosts > /tmp/hosts.$$ && | |
sudo mv /tmp/hosts.$$ /etc/hosts | |
} | |
disable-freedom () { | |
sed '/# FREEDOM/{n;s/^[^#]/#&/;}' < /etc/hosts > /tmp/hosts.$$ && | |
sudo mv /tmp/hosts.$$ /etc/hosts | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You should not do this. You should use http://macfreedom.com/ or friends. | |
$ freedom | |
later … | |
$ disable-freedom | |
It’s not quite Freedom in that you can disable it at will. It should really use `at(1)' or some sort of boot-time process for that. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/hosts | |
127.0.0.1 localhost | |
# ... | |
# FREEDOM | |
127.0.0.1 twitter.com facebook.com news.ycombinator.com getprismatic.com buzzfeed.com # ... many, many more ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment