Last active
January 29, 2024 04:12
-
-
Save abenson/68e24b62d1e6e9cb303676aee95e7f50 to your computer and use it in GitHub Desktop.
adblock setup
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
... | |
# adblock | |
addn-hosts=/etc/hosts.adblock | |
... |
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
#!/bin/sh | |
exec snooze -d 2/5 /usr/local/bin/update-adblock |
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
#!/bin/sh | |
FILE=$(mktemp) | |
touch $FILE | |
URLS="https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | |
https://raw.githubusercontent.com/notracking/hosts-blocklists/master/hostnames.txt" | |
for url in $URLS; do | |
echo $url | |
curl -sL "$url" | grep '^0' >> $FILE | |
done | |
sort -u $FILE > /etc/hosts.adblock | |
chown root:root /etc/hosts.adblock | |
chmod 0644 /etc/hosts.adblock | |
rm $FILE | |
sv reload dnsmasq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment