This file contains hidden or 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
#!/usr/bin/env python | |
# Takes amalgamated hosts file and converts to privoxy action file | |
# so you could block malicious hosts via proxy rather then /etc/hosts file | |
# See http://www.privoxy.org/faq/misc.html#HOSTSFILE | |
# | |
import re | |
import os | |
badguys_pattern = re.compile( | |
'^0.0.0.0(\s*|\t*)(.*)\n|^127.0.0.1(\s*|\t*)(.*)\n') |