Fine-tuning block-advert.sh
Posted: Mon Aug 11, 2025 12:57 am
On my internet-connected Linux (plural Linii?) I installed block-advert which is a great help in cutting down adverts and other unwanted slop. (advert-block-antix in synaptic)
However the blocking was slightly too strict as I lost access to a couple of addresses that I wanted to reach.
My solution was as follows:
1. open /usr/local/bin/block-advert.sh in your editor of choice.
2. after the second occurrence of the line "====================YTO"
added the lines:
N.B. Obviously change my choices reddit and whatsapp to your own preference, add whatever, and you can skip Mike or replace with a string that you can easily search
HTH,
Mike
However the blocking was slightly too strict as I lost access to a couple of addresses that I wanted to reach.
My solution was as follows:
1. open /usr/local/bin/block-advert.sh in your editor of choice.
2. after the second occurrence of the line "====================YTO"
added the lines:
(On my copy of /usr/local/bin/block-advert.sh this came at line 83)echo "Modify $WORKINGDIR/blocklist-all: Remove whatsapp & reddit (Mike)"
grep -v whatsapp $WORKINGDIR/blocklist-all | grep -v reddit > $WORKINGDIR/blocklist-all2
mv $WORKINGDIR/blocklist-all2 $WORKINGDIR/blocklist-all
N.B. Obviously change my choices reddit and whatsapp to your own preference, add whatever, and you can skip Mike or replace with a string that you can easily search
HTH,
Mike