Skip to content

Instantly share code, notes, and snippets.

@ptb
Last active January 24, 2018 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptb/46246329f35f6bf5423c73260ba702a2 to your computer and use it in GitHub Desktop.
Save ptb/46246329f35f6bf5423c73260ba702a2 to your computer and use it in GitHub Desktop.
unset LANG; adblock () { test -n "$1" && curl --compressed --location --silent 'https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist' 'https://github.com/azet12/KADhosts/raw/master/KADhosts.txt' 'https://github.com/FadeMind/hosts.extras/raw/master/add.2o7Net/hosts' 'https://github.com/FadeMind/hosts.extras/raw/master/add.Dead/hosts' 'https://github.com/FadeMind/hosts.extras/raw/master/add.Risk/hosts' 'https://github.com/FadeMind/hosts.extras/raw/master/add.Spam/hosts' 'https://github.com/FadeMind/hosts.extras/raw/master/SpotifyAds/hosts' 'https://github.com/FadeMind/hosts.extras/raw/master/UncheckyAds/hosts' 'https://github.com/mitchellkrogza/Badd-Boyz-Hosts/raw/master/hosts' 'https://github.com/StevenBlack/hosts/raw/master/data/StevenBlack/hosts' 'https://github.com/tyzbit/hosts/raw/master/data/tyzbit/hosts' 'https://www.malwaredomainlist.com/hostslist/hosts.txt' 'https://mirror1.malwaredomains.com/files/justdomains' 'http://adblock.mahakala.is/' 'https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt' 'https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt' 'https://hosts-file.net/ad_servers.txt' 'https://hosts-file.net/emd.txt' 'https://hosts-file.net/exp.txt' 'https://hosts-file.net/fsa.txt' 'https://hosts-file.net/grm.txt' 'https://hosts-file.net/hjk.txt' 'https://hosts-file.net/mmt.txt' 'https://hosts-file.net/pha.txt' 'https://hosts-file.net/psh.txt' 'https://hosts-file.net/pup.txt' 'https://hosts-file.net/wrz.txt' 'https://adaway.org/hosts.txt' 'http://winhelp2002.mvps.org/hosts.txt' 'http://someonewhocares.org/hosts/hosts' 'http://sysctl.org/cameleon/hosts' 'https://pgl.yoyo.org/as/serverlist.php?mimetype=plaintext' | sed -E -e 's/#.*$//;s/^[[:space:]]*//;s/\.*[[:space:]]*$//;s/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[[:space:]]*(.*)/\1/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;/[^a-z0-9\._-]/d;/:/d;/localhost$/d;/0\.0\.0\.0$/d;/^$/d' | sort | uniq -c | sed -E -e 's/^[[:space:]]*//;s/[1-2]+ .*$//;s/[3-9]+ *//;/^$/d' | awk -F "." '{ for (i=NF; i>1; i--) printf "%s.", $i; print $1 }' | sort -fn | awk -F "." '{ for (i=NF; i>1; i--) printf "%s.", $i; print $1 }' | sed -e "s/^/address=\//;s/$/\/$1/" > blacklist.conf }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment