Skip to content

Instantly share code, notes, and snippets.

@iGlitch
Last active August 13, 2022 04:16
Show Gist options
  • Save iGlitch/8c83f592f29cc7a4000e9dd6f270a57a to your computer and use it in GitHub Desktop.
Save iGlitch/8c83f592f29cc7a4000e9dd6f270a57a to your computer and use it in GitHub Desktop.
Update DNSCrypt Blacklist oisd full & extra, 1Hosts Pro for cron
cd /etc/dnscrypt-proxy2/ #go to path
rm -f blacky.txt #remove old
wget -q -O 1.txt https://dblw.oisd.nl/ #download
wget -q -O 2.txt https://dblw.oisd.nl/extra/ #download
wget -q -O 3.txt https://badmojr.github.io/1Hosts/Pro/wildcards.txt #download
cp blocked-names.txt mine.txt #copy to tmp file to keep notes
cat 1.txt 2.txt 3.txt > blacky.txt #combine all downloads
sed -i -e 's/*.//g' blacky.txt #remove *.
sed -i -e '/^#/d' blacky.txt #remove header/comments
sed -i -e '/^$/d' blacky.txt #remove empty lines
sed -i -e '/^#/d' mine.txt #remove header/comments
sed -i -e '/^$/d' mine.txt #remove empty lines
mv blacky.txt blocklist.txt.old && cat blocklist.txt.old | sort | uniq >> blacky.out #delete dupes
cat mine.txt blacky.out > blacky.txt #add my custom list to main blacklist
rm -f 1.txt 2.txt 3.txt blacky.out blocklist.txt.old mine.txt #remove temp files
/etc/init.d/dnscrypt-proxy restart #restart dnscrypt service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment