Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ad-blocking with your hosts file
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Sun Nov 16, 2003 7:31 pm    Post subject: Reply with quote

hm.. i am glad i have not run into that (yet?).
_________________
proud to be a scout and a chronic penguin hugger
Legion of Lore - site
Back to top
View user's profile Send private message
Fluffy`
n00b
n00b


Joined: 02 Jul 2003
Posts: 54

PostPosted: Sun Nov 23, 2003 5:01 pm    Post subject: Reply with quote

EDIT AFTER EDIT!
Download first public version:
http://fluffy.homeip.net/blandat.php
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Sun Dec 28, 2003 4:08 am    Post subject: Reply with quote

RedBeard0531 wrote:
I know that this is an unpopular opinion, but this is a VERY bad idea. Those adds are there for a reason. that page that is giving you free information is trying to make somemoney, and is probrobly barley covering the bandwidth.

It seems to me that the right way to do this is to send the HTTP request for the ad and kill the connection with a TCP RST packet. This way, the web servers still log the ad hits, but you don't waste bandwidth downloading them, and you don't get flashy junk all over your screen.

I haven't looked, but I highly doubt this is supported by any of the ad-blocking software out there.

Of course, this only works for ads that are inline in the web page you are viewing, and not for ads that come in popups. Then again, one might be of the opinion that popup ads don't deserve any revenue anyway. :wink:
Back to top
View user's profile Send private message
Malakin
Veteran
Veteran


Joined: 14 Apr 2002
Posts: 1692
Location: Victoria BC Canada

PostPosted: Sun Dec 28, 2003 4:55 am    Post subject: Reply with quote

Since this thread has popped back up again I should mention that the latest version of adblock for Mozilla/Firebird is awesome. I stopped using privoxy and just use adblock now. Adblock now totally removes anything you want it to, it doesn't download it anymore, although you still have the option to download and only hide it if you want.

http://adblock.mozdev.org/
Back to top
View user's profile Send private message
shiznix
Guru
Guru


Joined: 29 Jun 2003
Posts: 358
Location: Adelaide, Australia

PostPosted: Sun Dec 28, 2003 9:05 am    Post subject: Reply with quote

Given the age of this thread, I'm surprised noone has mentioned Squid yet.

Setup a transparent squid http proxy cache & use one of the many squid plugins to block/filter all manner of ads, banners & images.

The upside of this is that there is no chance of delay, cached URLs load instantly for everyone (they're stored on HD), & it's completely configurable at your gateway.

This means you don't have to download/install/configure 3rd party ad blocking programs for each browser on every box connected to your LAN.

Served us well for 3 years. We just don't get any ads :)

Regards,
Shiznix
Back to top
View user's profile Send private message
floam
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1067
Location: Vancouver, WA USA

PostPosted: Sun Dec 28, 2003 9:01 pm    Post subject: Reply with quote

What would be nice is a way to tell mozilla that if an image is 404 then it should ignore width= and height= in the html, or set both of them to 0. Would make the banners basically invisible. :)

Is it possible to use adblock with Epiphany?
_________________
Think about your breathing.
http://floam.sh.nu
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Sun Dec 28, 2003 9:18 pm    Post subject: Reply with quote

floam wrote:
What would be nice is a way to tell mozilla that if an image is 404 then it should ignore width= and height= in the html, or set both of them to 0. Would make the banners basically invisible. :)

The problem with this is that often, web pages are written so that their layout rely on the banners consuming a certain amount of screen space. Removing that space completely would ruin the layout of such web pages.
Back to top
View user's profile Send private message
Malakin
Veteran
Veteran


Joined: 14 Apr 2002
Posts: 1692
Location: Victoria BC Canada

PostPosted: Sun Dec 28, 2003 9:23 pm    Post subject: Reply with quote

Quote:
What would be nice is a way to tell mozilla that if an image is 404 then it should ignore width= and height= in the html, or set both of them to 0. Would make the banners basically invisible. :)
There is an option in adblock "collapse blocked elements" and it does exactly what you want it to, it will collapse images and iframes, works great. (it's under adblock options in adblock preferences)

I've had collapse turned on since I went back to adblock and haven't had a single website's layout negatively effected by it although it's certainly possible.
Back to top
View user's profile Send private message
KenTI
n00b
n00b


Joined: 28 Jan 2004
Posts: 53
Location: Italy

PostPosted: Mon Apr 19, 2004 9:58 pm    Post subject: Reply with quote

this tip is great!! i tried to configure privoxy to do just the simple url filtering like adblock but with no success.. this is extremely easy, you just have to add the url of the adserver to the blacklist

one question, is it possible to use wildcards such as http://*/banners/* like in adblock?
Back to top
View user's profile Send private message
Malakin
Veteran
Veteran


Joined: 14 Apr 2002
Posts: 1692
Location: Victoria BC Canada

PostPosted: Mon Apr 19, 2004 10:02 pm    Post subject: Reply with quote

Quote:
one question, is it possible to use wildcards such as http://*/banners/* like in adblock?
If you're referring to the idea of blocking websites with your hosts file then the answer is no, you can only block by server and everything from that server gets blocked. The adblock plugin for firefox is a much better solution imo.
Back to top
View user's profile Send private message
etnoy
Apprentice
Apprentice


Joined: 29 Aug 2003
Posts: 255
Location: Västerås, Sweden

PostPosted: Mon Apr 19, 2004 10:10 pm    Post subject: Reply with quote

I second that opinion. The time this thread was started, I think thet Firebird was still 0.7 and I don't know if the excellent AdBlock extension was available that time. Firefox being my primary browser, I almost don't see any ads any more :)
_________________
The md5sum of the above post is 06280ccd85ef9deb49c336e7945f4b5c

God is dead! - Nietzsche
Nietzsche is dead! -God
Back to top
View user's profile Send private message
KenTI
n00b
n00b


Joined: 28 Jan 2004
Posts: 53
Location: Italy

PostPosted: Mon Apr 19, 2004 10:10 pm    Post subject: Reply with quote

i use both opera and firefox, and when i was using privoxy (with the default configuration still, i wasn't able to manage tweaking it :oops: ) i noticed that privoxy really slowed down browsing

now using opera just with the hosts filter works even faster than firefox, it is a bit complicated to look up for the url of each banner (especially for flash, with adblock you just have to click on the label that appears on the side of the ad)
Back to top
View user's profile Send private message
Rainmaker
Veteran
Veteran


Joined: 12 Feb 2004
Posts: 1650
Location: /home/NL/ehv/

PostPosted: Tue Apr 20, 2004 1:50 am    Post subject: Reply with quote

an alternative to this is to use a filtering proxy server

I have one of those on my router, running transparant. This comes in handy, because you don't have to configure every client (copy the host file over)

myh favorite: http://sourceforge.net/projects/middle-man/
Back to top
View user's profile Send private message
Malakin
Veteran
Veteran


Joined: 14 Apr 2002
Posts: 1692
Location: Victoria BC Canada

PostPosted: Tue Apr 20, 2004 2:08 am    Post subject: Reply with quote

I used to use privoxy back before adblock worked as well as it did, there was a noticeable performance penalty and privoxy uses a fair bit of memory just to run.

There is absolutely not benefit to using hosts file blocking over adblock.

The major downside to using hosts file blocking is you have to block the entire server and most ads sit on a server with other legitimate content.

Earlier versions of adblock just stopped the images from being displayed but the current versions are massively imporoved and stop the content from ever being downloaded and there's no performance hit from using it, your pages will actually load faster since they no longer have to download the crap.

http://adblock.mozdev.org/
Back to top
View user's profile Send private message
omega`
n00b
n00b


Joined: 28 May 2004
Posts: 33
Location: .nl

PostPosted: Mon Dec 06, 2004 8:13 am    Post subject: adblock for opera? Reply with quote

It would be great if there was an adblock clone for Opera. There are some filtering programs for Opera. But I don't like how they work and some only work on Windows.

(Oh and sorry for playing thread necromancer.)
Back to top
View user's profile Send private message
nat
Apprentice
Apprentice


Joined: 04 Sep 2002
Posts: 204

PostPosted: Mon Jan 10, 2005 6:01 pm    Post subject: Reply with quote

I'd like to point out another alternative to adblock sites using hostnames. There is a blacklist feature to the dnrd DNS proxy. (from version 2.18 )

Create a list with all the hostnames you'd like to be blocked and save as /etc/dnrd/blacklist no 127.0.0.1 entries in front, just a list with hostnames.

Then point your resolv.conf to 127.0.0.1 and if you have a small network, let all the clients /etc/resolv.conf point to the dnrd host.

Dnrd will answer "host not found" on all listed hostnames instead of 127.0.0.1 so the browser will not even try to connect to localhost.

See https://bugs.gentoo.org/show_bug.cgi?id=77379 for a ebuild for 2.18. (not in portage yet)
Back to top
View user's profile Send private message
FastTurtle
Guru
Guru


Joined: 03 Sep 2002
Posts: 386
Location: Shake & Bake

PostPosted: Wed Dec 28, 2005 2:49 pm    Post subject: Dual Method with Hosts & Adblock Reply with quote

I'm glad I was able to google for this thread as it provided me enough info to solve an adblock problem in Firefox 1.0.7-r1

What happened was that my adblock list grew to about 200 entries and I started seeing lots of slowdowns and increased CPU usage so it was important to find a solution.

What I did was simply transfered all known advertisers and malware/spyware websites over to the hosts file, while cleaning most entries out of adblock. Now the reason this helped was because of the way adblock works, it places all entries into the about:config file and that's parsed all the time by firefox. Now by using the dual method, my adblock file catches the ads that are sub-domains of websites I visit frequently, while the hosts file speeds things up by silently blocking those websites I want nothing to do with.

A Word of Warning:

Be very careful what you list in your hosts blocking file as you can unintentionally block good websites. The solution I found that works quite well is to create a plain text file based upon the entries in your adblock file and then add them to your hosts file.

Remember that you can only block the top level domain name; EG: doubleclick, fastclick,burstnet and so on. You can not block yahoo.com/b/ or other sub-domains in your hosts file as it quits parsing at the top level. That's why I use this dual method blocking. Main comes from the /etc/hosts file while adblock catches the variables such as ads/ ads.js and so on. :lol:
_________________
AMD 640 - 16GB - Radeon 5670
Back to top
View user's profile Send private message
HeXiLeD
l33t
l33t


Joined: 20 Aug 2005
Posts: 946
Location: online

PostPosted: Thu Dec 29, 2005 3:19 am    Post subject: Reply with quote

most of the urls posted here with info for the hosts do not open.
can those who have them in a file post a new url for me to download; or something like that ?
im looking to create a good hosts block file

Thank you
_________________
443640, Questioning, Unsolved, Configs, BinHost
Back to top
View user's profile Send private message
Arno
Tux's lil' helper
Tux's lil' helper


Joined: 19 Oct 2002
Posts: 126
Location: France

PostPosted: Thu Dec 29, 2005 11:51 pm    Post subject: Reply with quote

Hi,

I use the host file from this site: http://www.everythingisnt.com/hosts.html. It seems to be maintained and is updated from time to time.

Regards.
-- Arno
Back to top
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Thu Dec 29, 2005 11:56 pm    Post subject: Reply with quote

thanks Arno.

i will update my post with a link to that instead,
as my hosts file is no longer downloadable.
_________________
proud to be a scout and a chronic penguin hugger
Legion of Lore - site
Back to top
View user's profile Send private message
Arny
n00b
n00b


Joined: 13 Oct 2004
Posts: 57

PostPosted: Fri Dec 30, 2005 4:23 am    Post subject: Reply with quote

I'm surprised that nobody's mentioned using squid in combination with the excellent adzapper script. Both are available in portage and very simple to setup. I use this combo on my gateway by redirecting the connection through squid which runs everything through adzapper. This has the advantage of caching pages that I check frequently and automatically replacing ads with an image/text of my choice in such a way to maintains the layout of the page.

Simple, effective, and it probably even saves a minimal amount of bandwidth by not downloading all of those ads. Furthermore it gets updated for me every few months!
Back to top
View user's profile Send private message
rodoke
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jan 2005
Posts: 87
Location: So. Ill.

PostPosted: Sat Dec 31, 2005 10:45 am    Post subject: To add to /etc/hosts sources Reply with quote

Though the site (and file) is very MS-oriented, I use this hosts file.
_________________
Bill Watterson wrote:
If we wanted more leisure, we'd invent machines that do things less efficiently.
Back to top
View user's profile Send private message
HeXiLeD
l33t
l33t


Joined: 20 Aug 2005
Posts: 946
Location: online

PostPosted: Sat Jan 28, 2006 8:33 pm    Post subject: Reply with quote

well right now i have HUGE hosts file and probably with 'dupes' in it.
is there any and simple cmd line way of doing a checkup and auto remove repetead urls ?
_________________
443640, Questioning, Unsolved, Configs, BinHost
Back to top
View user's profile Send private message
nanafunk
n00b
n00b


Joined: 29 Jun 2005
Posts: 36

PostPosted: Wed Feb 01, 2006 9:17 am    Post subject: Reply with quote

Code:
>>> cat bleh.txt
moo
moo
doo
foo
soo
roo
>>> sort -u bleh.txt
doo
foo
moo
roo
soo
>>> uniq bleh.txt
moo
doo
foo
soo
roo
>>>
Back to top
View user's profile Send private message
HeXiLeD
l33t
l33t


Joined: 20 Aug 2005
Posts: 946
Location: online

PostPosted: Thu Mar 09, 2006 2:21 am    Post subject: Reply with quote

my current hosts file here
it has above 75000 hosts
_________________
443640, Questioning, Unsolved, Configs, BinHost
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum