Earlier quoted context omitted.
The goal here is to make it automatically update the hosts file once in a while
Isn’t that what cron is for?
BeGoneAds – A Python script that blocks ads by installing common hosts files
61–70 of 97 posts
Re: BeGoneAds – A Python script that blocks ads by installing common hosts files
#62Earlier quoted context omitted.
Why not? Modifying system hosts configuration requires privileged file system access. The mindset here should be default deny.
Yep, finding and modifying a script that runs with root privileges, but is writable by non-root users is the oldest privesc trick in the book. With the proper permissions something like this should be ok, but I'd tread lightly. Especially with something that dynamically updates your hosts file.
Re: BeGoneAds – A Python script that blocks ads by installing common hosts files
#63Serious question. We all realize that the economics of the internet is largely fueled by ads, so why are we so keen to block them? It’s ad revenue that have allowed technology to flourish so strongly over the last two decades.
Not long ago, the economy was largely fueled by slavery. Yet we got rid of that.
It’s a ridiculous comparison. I am not a friend to intrusive ad-tech, but making a moral equivalence to slavery is to trivialize slavery. It’s like comparing parking tickets to the death penalty.
Re: BeGoneAds – A Python script that blocks ads by installing common hosts files
#64Earlier quoted context omitted.
I assume you wrote a hello world once or twice, what was the point of that?
Who posts their hello world on HN? My question was a valid one given the circumstances.
Re: BeGoneAds – A Python script that blocks ads by installing common hosts files
#65Earlier quoted context omitted.
To be completely fair with you, I didn't know this was out there. Then again, I think my solution is more elegant, especially if all the todo's are finished.
Patching a critical system file with python on a regular basis... What could go wrong?
Re: BeGoneAds – A Python script that blocks ads by installing common hosts files
#66Re: BeGoneAds – A Python script that blocks ads by installing common hosts files
#67Earlier quoted context omitted.
To be completely fair with you, I didn't know this was out there. Then again, I think my solution is more elegant, especially if all the todo's are finished.
Patching a critical system file with python on a regular basis... What could go wrong?
Yes, downloading hosts files from 3rd-party sites is kind of sketchy. But using python to do it is what you're worried about?
Re: BeGoneAds – A Python script that blocks ads by installing common hosts files
#68Earlier quoted context omitted.
Yep, finding and modifying a script that runs with root privileges, but is writable by non-root users is the oldest privesc trick in the book. With the proper permissions something like this should be ok, but I'd tread lightly. Especially with something that dynamically updates your hosts file.
It won't be able to run if the user that is running it doesn't have the proper privileges. You could even protect the files by giving them other permissions so only the root user can use them.
Naturally it's on the user to properly configure the permissions.
I'm not saying this isn't a worthy project, I'm just adding to the discussion on why people should be cautious when running scripts with root permissions.
Re: BeGoneAds – A Python script that blocks ads by installing common hosts files
#69Earlier quoted context omitted.
Just using cron is back compatible
Things you get with systemd that you don't get with cron unless you implement them in the script. * Not running if the network is down. * Not running if the download path isn't available. * Running if the machine was off during the scheduled time. * Monitoring and retry logic. * Logging to syslog. * Resource constraints. * Random wait. It ends up being a lot of code factored out of the actual application.
Re: BeGoneAds – A Python script that blocks ads by installing common hosts files
#70Serious question. We all realize that the economics of the internet is largely fueled by ads, so why are we so keen to block them? It’s ad revenue that have allowed technology to flourish so strongly over the last two decades.
Ads have gotten to a point where they hamper user experience. My problem with most of the ads is the amount of js tracking junk and 3rd party A/B calls that grinds the browser to a halt.