Use it e.g. in Transmission's options as file:///tmp/blocklist
Last active
August 29, 2015 14:04
-
-
Save rxw1/a5e1f2c8fccf56aab6bc to your computer and use it in GitHub Desktop.
Blocklists w/ cronjob
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
#!/usr/bin/env zsh | |
tmpdir="/tmp/blocklists-$(date +%Y-%M-%d)" | |
mkdir -p $tmpdir | |
# https://www.iblocklist.com/lists.php | |
if [[ $1 = '-a' ]]; then | |
blocklists=($(curl -s 'https://www.iblocklist.com/lists.php' | egrep -o '[a-z]{20}' | sort -u)) | |
else | |
blocklists=( | |
dgxtneitpuvgqqcpfulq # bluetack ads | |
gihxqmhyunbxhbmgqrla # bluetack bogon | |
imlmncgrkbnacgcwfjvh # bluetack edu | |
usrcshglbiilevmyfhse # bluetack hijacked | |
ydxerpxkpcfqjaybcssw # bluetack level 1 | |
gyisgnzbhppbvsphucsw # bluetack level 2 | |
uwnukjqktoggdknzrhgh # bluetack level 3 | |
xshktygkujudfnjfioro # bluetack microsoft | |
mcvxsnihddgutbjfbghy # bluetack spider | |
llvtlsjyoyiczbkjsxpf # bluetack spyware | |
ijfqtofzixtwayqovmxn # tbg primary threats | |
) | |
fi | |
for b in $blocklists; do | |
wget -q -O ${tmpdir}/${b}.gz "http://list.iblocklist.com/?list=${b}&fileformat=p2p&archiveformat=gz" | |
done | |
lc=$LC_ALL | |
export LC_ALL='C' | |
gzcat ${tmpdir}/*.gz | sort -u > /tmp/blocklist | |
export LC_ALL=$lc | |
rm -r ${tmpdir} |
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
# every day five minutes after midnight | |
5 0 * * * $HOME/.local/bin/blocklists.sh |
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
# More simple onliner that get's the job done as well | |
@daily curl -sL 'https://www.iblocklist.com/lists.php' | egrep -A1 'star_[45]' | egrep -o '[a-z]{20}' | sort -u | while read -r blocklist; do curl -sL "http://list.iblocklist.com/?list=${blocklist}&fileformat=p2p&archiveformat=gz" | gunzip -q > ~/Library/Application\ Support/Transmission/blocklists/$blocklist; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment