Antix Advert Block for Mint??

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
Glockdoc
Level 3
Level 3
Posts: 104
Joined: Tue May 09, 2017 5:42 am

Antix Advert Block for Mint??

Post by Glockdoc » Fri Nov 08, 2019 8:23 am

I have MX on one of my machines and stumbled across adblock in the applications. Basically is updates and modifies the hosts file to block ads at the system level. I have searched and can't find anything equivalent for Mint. Anybody using an adblocker w the host file?

I know I can manually edit/copy/paste the list for one or more sights into my host file. I even found a script to do it and update it, but couldn't make it work on my set up.

Thought I would ask the Mint experts as I have Mint on a couple of other machines.

Thanks in advance!

User avatar
Flemur
Level 17
Level 17
Posts: 7321
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Antix Advert Block for Mint??

Post by Flemur » Fri Nov 08, 2019 9:29 am

Glockdoc wrote:
Fri Nov 08, 2019 8:23 am
I have MX on one of my machines and stumbled across adblock in the applications. Basically is updates and modifies the hosts file to block ads at the system level. I have searched and can't find anything equivalent for Mint. Anybody using an adblocker w the host file?

I know I can manually edit/copy/paste the list for one or more sights into my host file. I even found a script to do it and update it, but couldn't make it work on my set up.
Was that mysterious script "block-advert.sh" from this website:
https://github.com/antiX-Linux/advert-block-antix
?
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

User avatar
trytip
Level 11
Level 11
Posts: 3815
Joined: Tue Jul 05, 2016 1:20 pm

Re: Antix Advert Block for Mint??

Post by trytip » Fri Nov 08, 2019 10:08 am

updating hosts file automatically is tricky but i guess if you are just using it generically you can let the system do it for you.
here is my file /etc/hosts backup yours and extract mine if you wish hosts_10_03_19.tar.gz

this list includes :
https://someonewhocares.org/hosts/
http://winhelp2002.mvps.org/hosts.htm
https://github.com/hoshsadiq/adblock-nocoin-list
*bonus windows 10 telemetry blocker*

IMPORTANT: this list if for ipv4/ipv6 BUT i have disabled ipv6 if you need ipv6 uncomment these lines from the top of the list
#::1 localhost
#::1 localhost.localdomain
127.0.0.1 local
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
#fe80::1%lo0 localhost
#</localhost>
also change to your username:
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
127.0.1.1 mint03
255.255.255.255 broadcasthost
#::1 localhost
#::1 localhost.localdomain
127.0.0.1 local
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
#fe80::1%lo0 localhost
#</localhost>

oh and BTW i use this list in all my linux, windows 10 and my android. it's also supposed to work on apple systems but don't have any apples
Last edited by trytip on Sat Nov 09, 2019 2:18 pm, edited 1 time in total.
Image

User avatar
Flemur
Level 17
Level 17
Posts: 7321
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Antix Advert Block for Mint??

Post by Flemur » Fri Nov 08, 2019 10:14 am

trytip wrote:
Fri Nov 08, 2019 10:08 am
this list includes :
https://someonewhocares.org/hosts/
http://winhelp2002.mvps.org/hosts.htm
https://github.com/hoshsadiq/adblock-nocoin-list
*bonus windows 10 telemetry blocker*
FWIW, your hosts file has 57,086 lines and the antix file has 156,827 lines....I dunno if that's good, bad or neither.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

User avatar
trytip
Level 11
Level 11
Posts: 3815
Joined: Tue Jul 05, 2016 1:20 pm

Re: Antix Advert Block for Mint??

Post by trytip » Fri Nov 08, 2019 10:28 am

Flemur wrote:
Fri Nov 08, 2019 10:14 am
FWIW, your hosts file has 57,086 lines and the antix file has 156,827 lines....I dunno if that's good, bad or neither.
sure i can add more, i find that sometimes less is more :D but have't looked over the antix hosts to compare, is there a link to it?
also my list is both ipv4 and ipv6 is antix ahead of me on that one or are they only for ipv4 ? i only use /etc/hosts as fallback, my main adblocker is nano adblocker/defender
Image

Glockdoc
Level 3
Level 3
Posts: 104
Joined: Tue May 09, 2017 5:42 am

Re: Antix Advert Block for Mint??

Post by Glockdoc » Fri Nov 08, 2019 10:34 am

trytip wrote:
Fri Nov 08, 2019 10:08 am
updating hosts file automatically is tricky but i guess if you are just using it generically you can let the system do it for you.
here is my file /etc/hosts backup yours and extract mine if you wish hosts_10_03_19.tar.gz

this list includes :
https://someonewhocares.org/hosts/
http://winhelp2002.mvps.org/hosts.htm
https://github.com/hoshsadiq/adblock-nocoin-list
*bonus windows 10 telemetry blocker*

IMPORTANT: this list if for ipv4/ipv6 BUT i have disabled ipv6 if you need ipv6 uncomment these lines from the top of the list
#::1 localhost
#::1 localhost.localdomain
127.0.0.1 local
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
#fe80::1%lo0 localhost
#</localhost>
oh and BTW i use this list in all my linux, windows 10 and my android. it's also supposed to work on apple systems but don't have any apples

Cool!! I am using xXxNoLimits on my Android with AdAway. This is what started me down this path. Great info.

Glockdoc
Level 3
Level 3
Posts: 104
Joined: Tue May 09, 2017 5:42 am

Re: Antix Advert Block for Mint??

Post by Glockdoc » Fri Nov 08, 2019 10:36 am

Flemur wrote:
Fri Nov 08, 2019 9:29 am
Glockdoc wrote:
Fri Nov 08, 2019 8:23 am
I have MX on one of my machines and stumbled across adblock in the applications. Basically is updates and modifies the hosts file to block ads at the system level. I have searched and can't find anything equivalent for Mint. Anybody using an adblocker w the host file?

I know I can manually edit/copy/paste the list for one or more sights into my host file. I even found a script to do it and update it, but couldn't make it work on my set up.
Was that mysterious script "block-advert.sh" from this website:
https://github.com/antiX-Linux/advert-block-antix
?
Nope, it was from here https://www.putorius.net/block-unwanted ... ts-on.html

I am still trying to figure out how to navigate and use github. It is above me pay grade, but I am learning.

Glockdoc
Level 3
Level 3
Posts: 104
Joined: Tue May 09, 2017 5:42 am

Re: Antix Advert Block for Mint??

Post by Glockdoc » Fri Nov 08, 2019 10:38 am

trytip wrote:
Fri Nov 08, 2019 10:28 am
Flemur wrote:
Fri Nov 08, 2019 10:14 am
FWIW, your hosts file has 57,086 lines and the antix file has 156,827 lines....I dunno if that's good, bad or neither.
sure i can add more, i find that sometimes less is more :D but have't looked over the antix hosts to compare, is there a link to it?
also my list is both ipv4 and ipv6 is antix ahead of me on that one or are they only for ipv4 ? i only use /etc/hosts as fallback, my main adblocker is nano adblocker/defender
No link. It is included in my MX install. Found it by accident. Been using MX for 5 months on my main machine and I keep finding new stuff.

gm10
Level 19
Level 19
Posts: 9709
Joined: Thu Jun 21, 2018 5:11 pm

Re: Antix Advert Block for Mint??

Post by gm10 » Fri Nov 08, 2019 10:51 am

Glockdoc wrote:
Fri Nov 08, 2019 10:38 am
No link. It is included in my MX install. Found it by accident. Been using MX for 5 months on my main machine and I keep finding new stuff.
Just keep using it then. In a terminal window:

Code: Select all

mkdir ~/.local/bin
wget https://raw.githubusercontent.com/antiX-Linux/advert-block-antix/master/block-advert.sh -O ~/.local/bin/block-advert
chmod +x ~/.local/bin/block-advert
apt install yad
source ~/.profile
You can then run the script like this:

Code: Select all

sudo block-advert
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

Glockdoc
Level 3
Level 3
Posts: 104
Joined: Tue May 09, 2017 5:42 am

Re: Antix Advert Block for Mint??

Post by Glockdoc » Fri Nov 08, 2019 11:00 am

gm10 wrote:
Fri Nov 08, 2019 10:51 am
Glockdoc wrote:
Fri Nov 08, 2019 10:38 am
No link. It is included in my MX install. Found it by accident. Been using MX for 5 months on my main machine and I keep finding new stuff.
Just keep using it then. In a terminal window:

Code: Select all

mkdir ~/.local/bin
wget https://raw.githubusercontent.com/antiX-Linux/advert-block-antix/master/block-advert.sh -O ~/.local/bin/block-advert
chmod +x ~/.local/bin/block-advert
apt install yad
source ~/.profile
You can then run the script like this:

Code: Select all

sudo block-advert
I will give it a try on my Mint machine at our shop tomorrow. Thanks.

User avatar
Flemur
Level 17
Level 17
Posts: 7321
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Antix Advert Block for Mint??

Post by Flemur » Fri Nov 08, 2019 11:05 am

Glockdoc wrote:
Fri Nov 08, 2019 10:36 am
I am still trying to figure out how to navigate and use github. It is above me pay grade, but I am learning.
Click the "Clone or Download" button, click "Download zip", extract it -> directory with a bunch of file but, as is typical, no useful instructions, then you mess around until you break something:

Code: Select all

$ sh block-advert.sh
block-advert.sh: 36: block-advert.sh: function: not found$ bash blo*.sh
block-advert.sh: 44: block-advert.sh: function: not found
...pp: cannot create regular file '/etc/hosts.ORIGINAL': Permission denied
cp: cannot create regular file '/etc/hosts.saved': Permission denied
mv: replace '/etc/hosts', overriding mode 0644 (rw-r--r--)? y
 y

Code: Select all

$ vi blo*sh
[the script says 'bash' but my /bin/sh -> dash, so it won't run right, so...]
$ bash blo*.sh
block-advert.sh: line 171: yad: command not found
$ yad
The program 'yad' is currently not installed. You can install it by typing:
sudo apt install yad
...
$ sudo apt install yad
...
$ !bash
bash blo*.sh
Now I see this GUI
adblock1.jpg
adblock1.jpg (19.44 KiB) Viewed 332 times
buttons are down at the bottom, click OK then get
adblock2.jpg
adblock2.jpg (11.5 KiB) Viewed 332 times
select them and hit OK then then it says in the terminal that it can't do it and asks a question,

Code: Select all

pp: cannot create regular file '/etc/hosts.ORIGINAL': Permission denied
cp: cannot create regular file '/etc/hosts.saved': Permission denied
mv: replace '/etc/hosts', overriding mode 0644 (rw-r--r--)? y

Code: Select all

 y
mv: cannot move '/tmp/hosts-temp' to '/etc/hosts': Permission denied
So the instructions which were too involved and complicated for the guy to write out:
-- download and extract the zip file.
-- sudo bash block-advert.sh

Then you get

Code: Select all

$ ls -l /etc/hosts
-rw-r--r-- 1 root root 2372447 Nov  8 08:08 /etc/hosts
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

gm10
Level 19
Level 19
Posts: 9709
Joined: Thu Jun 21, 2018 5:11 pm

Re: Antix Advert Block for Mint??

Post by gm10 » Fri Nov 08, 2019 12:45 pm

Flemur wrote:
Fri Nov 08, 2019 11:05 am
So the instructions which were too involved and complicated for the guy to write out:
U wot m8? Why would the author of a distribution-specific .deb package add instructions on how to lift a script out of the package?

Seriously, the uninformed snark from some towards other people investing their free time providing free software is nothing short of amazing...

Besides, I had already posted instructions, I suggest OP stick to those. :roll:
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

User avatar
Flemur
Level 17
Level 17
Posts: 7321
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Antix Advert Block for Mint??

Post by Flemur » Fri Nov 08, 2019 1:15 pm

gm10 wrote:
Fri Nov 08, 2019 12:45 pm
Flemur wrote:
Fri Nov 08, 2019 11:05 am
So the instructions which were too involved and complicated for the guy to write out:
U wot m8? Why would the author of a distribution-specific .deb package add instructions on how to lift a script out of the package?
There was no .deb file.

I'm referring to the fact that there were no instructions at all on how to use the software that was offered for download and use. That's just lame.
Seriously, the uninformed snark from some towards other people investing their free time providing free software is nothing short of amazing...
My snark was actually very informed, thanks very much for you uninformed insult.
Besides, I had already posted instructions, I suggest OP stick to those. :roll:
I'd was already writing my post when yours showed up, and I thought the OP might see how amusing it is to deal with the typically un- or poorly documented software at github.com which he's likely to run into again; your instructions won't help at all in that respect.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

gm10
Level 19
Level 19
Posts: 9709
Joined: Thu Jun 21, 2018 5:11 pm

Re: Antix Advert Block for Mint??

Post by gm10 » Fri Nov 08, 2019 2:22 pm

Flemur wrote:
Fri Nov 08, 2019 1:15 pm
gm10 wrote:
Fri Nov 08, 2019 12:45 pm
Flemur wrote:
Fri Nov 08, 2019 11:05 am
So the instructions which were too involved and complicated for the guy to write out:
U wot m8? Why would the author of a distribution-specific .deb package add instructions on how to lift a script out of the package?
There was no .deb file.

I'm referring to the fact that there were no instructions at all on how to use the software that was offered for download and use. That's just lame.
Seriously, the uninformed snark from some towards other people investing their free time providing free software is nothing short of amazing...
My snark was actually very informed, thanks very much for you uninformed insult.
If you were informed you'd know what a source code repository is and how to use dpkg-buildpackage. I don't even...

Sorry OP.
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

User avatar
Flemur
Level 17
Level 17
Posts: 7321
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Antix Advert Block for Mint??

Post by Flemur » Fri Nov 08, 2019 2:30 pm

gm10 wrote:
Fri Nov 08, 2019 2:22 pm
If you were informed you'd know what a source code repository is and how to use dpkg-buildpackage. I don't even...
Sorry OP.
No, you're sorry gm10. Code should be documented.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

Glockdoc
Level 3
Level 3
Posts: 104
Joined: Tue May 09, 2017 5:42 am

Re: Antix Advert Block for Mint??

Post by Glockdoc » Fri Nov 08, 2019 11:08 pm

Girls, girls....can't we all just get along?

Poor etiquette to bicker on a thread where someone (ME) is seeking help!

That being said, thank you to BOTH of you.

GM10 thanks for the succinct, clear instructions.

Flemur thanks for all the additional information. It helps.

If the OP (ME) knew how to build a .deb package from source code I never would have made my post. Github is a mess for guys like me due to the lack of clear instructions. Yes, these guys are posting their work for free, however, most seem to forget a lot of Linux users are not programmers and there is no help or guidance for 90% of the software hosted there.

One of the things I have found so GREAT about the Mint forums is how helpful everyone is, how little judgement is (openly) passed on us newbies, and how little trolling and insults are flung around. Flemur did not direct his comment at YOU, unless you are the github host of these files..........

Thanks again. As soon as I am in front of my Mint machine I will play with this and mark it solved when it is.

gm10
Level 19
Level 19
Posts: 9709
Joined: Thu Jun 21, 2018 5:11 pm

Re: Antix Advert Block for Mint??

Post by gm10 » Sat Nov 09, 2019 5:44 am

I know, but I just cannot stand the attitude: "You gave me A for free, but I wanted B, so you suck". It's just nasty. Anyway:
Glockdoc wrote:
Fri Nov 08, 2019 11:08 pm
If the OP (ME) knew how to build a .deb package from source code I never would have made my post. Github is a mess for guys like me due to the lack of clear instructions. Yes, these guys are posting their work for free, however, most seem to forget a lot of Linux users are not programmers and there is no help or guidance for 90% of the software hosted there.
It's still not their fault, they are publishing that package as part of the AntiX and MX-Linux distributions, that's what it is intended for and you get clear instructions how to install those distributions. The github source repository isn't meant to be used separately. But if you wanted to build that package, it's quite trivial. Make sure you've got the build-essential package installed and then:

Code: Select all

git clone  --depth=1 https://github.com/antiX-Linux/advert-block-antix.git
cd advert-block-antix
dpkg-buildpackage
And voilà, you've got a .deb package. Building from source is easy. ;) At least in theory. In practice the package wouldn't install on Mint since it was packaged for AntiX. Again, nothing to blame them for.

But if you prefer a .deb so you get your usual menu entry, I put a repackaged version on a PPA of mine
https://launchpad.net/~gm10/+archive/ub ... s-n-pieces
To download the .deb directly:
https://launchpad.net/~gm10/+archive/ub ... 10_all.deb
You're welcome. ;)
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

User avatar
trytip
Level 11
Level 11
Posts: 3815
Joined: Tue Jul 05, 2016 1:20 pm

Re: Antix Advert Block for Mint??

Post by trytip » Sat Nov 09, 2019 9:45 am

if you want to learn something, learn how to make your own hosts file, then you have no worries about creating a .deb package

IMPORTANT: people trying this in mint will not work unless you know what this means. look inside https://github.com/antiX-Linux/advert-b ... ck.desktop and you will see gksu being used, and as usual gm10 is on top of it with pkexec :shock:
[Desktop Entry]
Encoding=UTF-8
Name=advert-block
Name[am]=ማስታወቂያ መከልከያ
Name[ca]=Advert-block
Name[de]=advert-block
Name[el]=Advert Block
Name[es]=Bloquear-propaganda
Name[fr]=Stop Pub
Name[it]=Blocco della pubblicità
Name[nl]=advertentie-block
Name[pt]=Bloquear publicidade
Name[sv]=annonsblockerare
Comment=Block adverts via /etc/hosts file
Comment[am]=ማስታወቂያ መከልከያ በ /etc/hosts file
Comment[ca]=Bloqueja publicitat amb el fitxer /etc/hosts
Comment[de]=Blockiert Werbung über die Datei /etc/hosts
Comment[el]=Αποκλεισμός διαφημίσεις μέσω αρχείο /etc/hosts
Comment[es]=Bloquear-propaganda via el /etc/hosts
Comment[fr]=Bloque les publicités via le fichier /etc/hosts
Comment[it]=Blocca la pubblicità mediante il file /etc/hosts
Comment[nl]=Blokkeer advertenties middels /etc/hosts bestand
Comment[pt]=Bloqueia publicidade via ficheiro /etc/hosts
Comment[sv]=Blockera annonser via /etc/hosts fil
Exec=gksu block-advert.sh
Icon=advert-block
Terminal=false
Type=Application
Categories=Settings;
NoDisplay=False
Image

Glockdoc
Level 3
Level 3
Posts: 104
Joined: Tue May 09, 2017 5:42 am

Re: Antix Advert Block for Mint??

Post by Glockdoc » Sun Nov 10, 2019 3:25 am

gm10 wrote:
Sat Nov 09, 2019 5:44 am
I know, but I just cannot stand the attitude: "You gave me A for free, but I wanted B, so you suck". It's just nasty. Anyway:
Glockdoc wrote:
Fri Nov 08, 2019 11:08 pm
If the OP (ME) knew how to build a .deb package from source code I never would have made my post. Github is a mess for guys like me due to the lack of clear instructions. Yes, these guys are posting their work for free, however, most seem to forget a lot of Linux users are not programmers and there is no help or guidance for 90% of the software hosted there.
It's still not their fault, they are publishing that package as part of the AntiX and MX-Linux distributions, that's what it is intended for and you get clear instructions how to install those distributions. The github source repository isn't meant to be used separately. But if you wanted to build that package, it's quite trivial. Make sure you've got the build-essential package installed and then:

Code: Select all

git clone  --depth=1 https://github.com/antiX-Linux/advert-block-antix.git
cd advert-block-antix
dpkg-buildpackage
And voilà, you've got a .deb package. Building from source is easy. ;) At least in theory. In practice the package wouldn't install on Mint since it was packaged for AntiX. Again, nothing to blame them for.

But if you prefer a .deb so you get your usual menu entry, I put a repackaged version on a PPA of mine
https://launchpad.net/~gm10/+archive/ub ... s-n-pieces
To download the .deb directly:
https://launchpad.net/~gm10/+archive/ub ... 10_all.deb
You're welcome. ;)

I never said it was THEIR fault, just that it sucks for beginners like me.

But now, through your gracious imparting of wisdom( my most favorite part of Linux and the formus) I am 1 step further along. I will find a Mint pkg on github and play with it a little.

2 thumbs up!

Glockdoc
Level 3
Level 3
Posts: 104
Joined: Tue May 09, 2017 5:42 am

Re: Antix Advert Block for Mint??

Post by Glockdoc » Sun Nov 10, 2019 3:28 am

trytip wrote:
Sat Nov 09, 2019 9:45 am
if you want to learn something, learn how to make your own hosts file, then you have no worries about creating a .deb package

IMPORTANT: people trying this in mint will not work unless you know what this means. look inside https://github.com/antiX-Linux/advert-b ... ck.desktop and you will see gksu being used, and as usual gm10 is on top of it with pkexec :shock:
[Desktop Entry]
Encoding=UTF-8
Name=advert-block
Name[am]=ማስታወቂያ መከልከያ
Name[ca]=Advert-block
Name[de]=advert-block
Name[el]=Advert Block
Name[es]=Bloquear-propaganda
Name[fr]=Stop Pub
Name[it]=Blocco della pubblicità
Name[nl]=advertentie-block
Name[pt]=Bloquear publicidade
Name[sv]=annonsblockerare
Comment=Block adverts via /etc/hosts file
Comment[am]=ማስታወቂያ መከልከያ በ /etc/hosts file
Comment[ca]=Bloqueja publicitat amb el fitxer /etc/hosts
Comment[de]=Blockiert Werbung über die Datei /etc/hosts
Comment[el]=Αποκλεισμός διαφημίσεις μέσω αρχείο /etc/hosts
Comment[es]=Bloquear-propaganda via el /etc/hosts
Comment[fr]=Bloque les publicités via le fichier /etc/hosts
Comment[it]=Blocca la pubblicità mediante il file /etc/hosts
Comment[nl]=Blokkeer advertenties middels /etc/hosts bestand
Comment[pt]=Bloqueia publicidade via ficheiro /etc/hosts
Comment[sv]=Blockera annonser via /etc/hosts fil
Exec=gksu block-advert.sh
Icon=advert-block
Terminal=false
Type=Application
Categories=Settings;
NoDisplay=False
I did update my own host file. I was looking for a 1 click kind of solution the would either a) update when I clicked it or b) do it automatically.

Luckily, those that know more than I have been willing to share what they know. Sometime this week I will be in front of my Mint machine and implement it.

Post Reply

Return to “Software & Applications”