Skip to content

Instantly share code, notes, and snippets.

@unnamedfeeling
Created November 15, 2017 10:25
Show Gist options
  • Save unnamedfeeling/01472b206aec4cb12890e2be3a81e496 to your computer and use it in GitHub Desktop.
Save unnamedfeeling/01472b206aec4cb12890e2be3a81e496 to your computer and use it in GitHub Desktop.
Bash script for stripping out many adverts on the net (in addition to adblock and ghostery). Applicable for routers or linux distros.
rm /etc/hosts
wget http://winhelp2002.mvps.org/hosts.txt -q -O ->> /opt/etc/hosts
wget http://hosts-file.net/ad_servers.txt -q -O ->> /opt/etc/hosts
wget "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext" -q -O ->> /opt/etc/hosts
sed -i 's/127.0.0.1/0.0.0.0/g' /opt/etc/hosts
ln -s /opt/etc/hosts /etc/hosts
killall dnsmasq
dnsmasq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment