Skip to content

Instantly share code, notes, and snippets.

View tomfrazier's full-sized avatar

Tom Frazier tomfrazier

View GitHub Profile
#!/bin/sh
easylist() {
echo -n 'Getting EasyList list ... '
out=/etc/dnsmasq.d/easylist.conf
tmp=$(mktemp)
wget -q -nv https://easylist-downloads.adblockplus.org/easylist.txt -O $tmp
egrep '^\|\|([a-Z\.]+)\^$' $tmp | cut -d '^' -f1 | sed 's#||#address=/# ; s#$#/127.0.0.1#' | sort | uniq >$tmp.$$
[ $? -eq 0 ] && sudo mv -f $tmp.$$ $out && wc -l $out || echo -42
rm $tmp
@tomfrazier
tomfrazier / make-mega-adblock-hostsfile.sh
Created November 1, 2016 08:52
Create Mega Adblock Hostsfile for use with Dnsmasq (Modified from Pi-hole)
#!/bin/bash
# Modified Pi-hole script to generate a generic hosts file
# for use with dnsmasq's addn-hosts configuration
# original : https://github.com/jacobsalmela/pi-hole/blob/master/gravity-adv.sh
# Address to send ads to. This could possibily be removed, but may be useful for debugging purposes?
destinationIP="0.0.0.0"
outlist='./final_blocklist.txt'
tempoutlist="$outlist.tmp"