adblock-hosts script

Forum rules
General talk about software - if the program is not in the repos, please links to the developer's page or github.
aaah
Oyster-Slurper
Posts: 21
Joined: Wed Mar 09, 2016 12:38 pm

adblock-hosts script

Unread post by aaah » Sat Mar 12, 2016 4:07 pm

I will just link to it
http://vsido.org/index.php?topic=757.0
I was using a more complicated setup but have switched to this, I like it simple.
It just updates your hosts file for you to block nasties and adverts.

User avatar
slartie
Grump
Posts: 416
Joined: Tue Jun 18, 2013 12:35 pm
Location: Denmark
Contact:

Re: adblock-hosts script

Unread post by slartie » Sat Mar 12, 2016 4:14 pm

Or just .. you know .. use uBlock instead.

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: adblock-hosts script

Unread post by pidsley » Sat Mar 12, 2016 4:25 pm

aaah wrote: I was using a more complicated setup but have switched to this, I like it simple.
What were you using before? ublock works for me.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: adblock-hosts script

Unread post by machinebacon » Sat Mar 12, 2016 4:31 pm

Code: Select all

#!/bin/dash
wget -c -O /tmp/hosts.txt http://www.mvps.org/winhelp2002/hosts.txt
sed -i -e 's:127.0.0.1:0.0.0.0:g' -e "s:^.*localhost.$:127.0.0.1 localhost `hostname`:" /tmp/hosts.txt
cat /tmp/hosts.txt | tr -d "\r" > /etc/hosts
rm /tmp/hosts.txt
But seriously, the more you add to /etc/hosts the slower the DNS resolution is. I'd simply use ublock. For TUI browser ads play no role anyway.
..gnutella..

User avatar
bones
Clooney
Posts: 2385
Joined: Fri Jun 28, 2013 11:47 pm
Location: Cascadia

Re: adblock-hosts script

Unread post by bones » Sat Mar 12, 2016 6:10 pm

Giant host file here, but seriously, ublock origin works great.

User avatar
ivanovnegro
Minister of Truth
Posts: 5448
Joined: Wed Oct 17, 2012 11:12 pm

Re: adblock-hosts script

Unread post by ivanovnegro » Sat Mar 12, 2016 7:05 pm

I know we repeat ourselves but really?
It seems AdBlock is going astray. Here is a simpler and system wide alternative to AdBlock.
From that dark website you linked.

uBlock is all you need.

Edit: No wonder. The post is from 2014.

aaah
Oyster-Slurper
Posts: 21
Joined: Wed Mar 09, 2016 12:38 pm

Re: adblock-hosts script

Unread post by aaah » Sat Mar 12, 2016 7:14 pm

I've heard abt ublock but for some reason decided not to try it, cant remember why. Is it only for certain browsers, will look it up again, in the meantime I guess this post comes under the category, "Epic fail" :)
ok had a quick search abt it, it's a browser addon, I don't realy want another addon although it might not use much memory I don't know. Happy with my hosts file for now, haven't noticed a slowdown.
Last edited by aaah on Sat Mar 12, 2016 7:23 pm, edited 1 time in total.

User avatar
ivanovnegro
Minister of Truth
Posts: 5448
Joined: Wed Oct 17, 2012 11:12 pm

Re: adblock-hosts script

Unread post by ivanovnegro » Sat Mar 12, 2016 7:15 pm

You can grab uBlock for all the popular browsers. You see, every griller uses it. I think that means something. :)

User avatar
slartie
Grump
Posts: 416
Joined: Tue Jun 18, 2013 12:35 pm
Location: Denmark
Contact:

Re: adblock-hosts script

Unread post by slartie » Sat Mar 12, 2016 7:56 pm

Last I checked, uBlock has a smaller memory footprint than AdBlock and all its variants ever had.

User avatar
wuxmedia
Grasshopper
Posts: 6445
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: adblock-hosts script

Unread post by wuxmedia » Sat Mar 12, 2016 9:55 pm

I'm very happy with ublock. I have been since it wa pointed out on here, not that I'm short of RAM or anything. It is embarrassingly good, sometimes at work on a site migration - "where are my ads..."
- huh, what ads... ohh?
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5877
Joined: Tue Sep 03, 2013 7:05 am

Re: adblock-hosts script

Unread post by GekkoP » Sun Mar 13, 2016 10:08 am

Yeah, uBlock just works great.


User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: adblock-hosts script

Unread post by rhowaldt » Mon Mar 14, 2016 11:55 am

getting repetitive here, but yeah, ublock does it for me too.
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

anticapitalista
Honorary Member
Posts: 70
Joined: Fri Feb 28, 2014 5:12 pm

Re: adblock-hosts script

Unread post by anticapitalista » Mon Mar 14, 2016 2:27 pm

I prefer ad blocking via hosts file. Like OP no slowdown.

User avatar
Theo
CLIt Licker
Posts: 394
Joined: Wed Nov 11, 2015 10:19 pm
Location: Nieuw-Buinen, Netherlands

Re: adblock-hosts script

Unread post by Theo » Mon Mar 14, 2016 6:12 pm

AFAIK the hosts file takes a bit time because it's unindexed text. So if I have the choice I install uBlock otherwise I use the hosts file.

User avatar
ivanovnegro
Minister of Truth
Posts: 5448
Joined: Wed Oct 17, 2012 11:12 pm

Re: adblock-hosts script

Unread post by ivanovnegro » Tue Mar 15, 2016 4:15 pm

Nice to see some outliers.

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5877
Joined: Tue Sep 03, 2013 7:05 am

Re: adblock-hosts script

Unread post by GekkoP » Tue Mar 15, 2016 4:21 pm

If not uBlock, I go with this: http://surf.suckless.org/files/adblock-hosts

User avatar
Theo
CLIt Licker
Posts: 394
Joined: Wed Nov 11, 2015 10:19 pm
Location: Nieuw-Buinen, Netherlands

Re: adblock-hosts script

Unread post by Theo » Tue Mar 15, 2016 9:25 pm

^ Thanks, a nice catch for 'stubborn' browsers I guess :)

Post Reply