Live data from Hacker News

BeGoneAds – A Python script that blocks ads by installing common hosts files

github.com

1–10 of 97 posts

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#4

Anybody have a sense of the performance overhead of using hosts files versus a detached hardware solution like a pihole?

I don't have any evidence (I've not attempted to benchmark it or anything), but my gut says that the stack is checking the hosts file first anyhow, so it shouldn't be much. It might actually be an improvement over a separate appliance.

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#5

Anybody have a sense of the performance overhead of using hosts files versus a detached hardware solution like a pihole?

My understanding is that difference is in scope, not performance.

Hosts files will only affect the host (workstation/desktop/laptop etc) they're installed on.

Things like piHole try to make it easy to apply the solution to all members of your network - which even in household cases these days can number in dozens, making it impractical to manage hosts files for all of them (This includes items like phones which are typically unfeasible to mess with hosts file).

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#6

Python scripts to modify system files make me a little skittish, even with source code available. I think I would just as soon grab the hosts file from https://www.someonewhocares.org/ and drop it in myself.

I also don't understand systemd integration in the todo.

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#7
I get that this is just someone's side project, I'm glad it exists and they're free to write it in their favorite language/environment and all; but the effort to actually run this is equivalent to actually copying the hosts files manually, and I already have all the dependencies installed. I could never get my non-techy parents to run this properly.

If the goal of the project is actual adoption, a native executable without external dependencies would have been a much better option.

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#8
Since accepting Host files from someone on the internet can be dangerous I dug into the code:

The list of hosts to exclude comes from several sites here: https://github.com/anned20/begoneads/blob/2c90fcee221edf71f8...

The actual application of the hosts file is here: https://github.com/anned20/begoneads/blob/2c90fcee221edf71f8...

I missed something though. Is a simple domain name per line enough to send that content to /dev/null? I haven’t used that form in /etc/hosts.

My primary concern was that this technique could be used to send ad traffic to a site that returns 404 but gathers metrics on the web regardless.

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#9
post #6

Python scripts to modify system files make me a little skittish, even with source code available. I think I would just as soon grab the hosts file from https://www.someonewhocares.org/ and drop it in myself.

I also don't understand systemd integration in the todo.

The goal here is to make it automatically update the hosts file once in a while

Re: BeGoneAds – A Python script that blocks ads by installing common hosts files

#10

I get that this is just someone's side project, I'm glad it exists and they're free to write it in their favorite language/environment and all; but the effort to actually run this is equivalent to actually copying the hosts files manually, and I already have all the dependencies installed. I could never get my non-techy parents to run this properly. If the goal of the project is actual adoption, a native executable w…

This is a todo, It's already on PyPI and I'm working on getting it packaged for all the main distros of Linux/Windows and MacOS.
Post reply on HN