To ensure there are no nefarious redirects in such a massive list, this one-liner comes in handy[1]: grep -v '#' steves_hosts | awk '{print $1}'| sort | uniq -c [1] https://news.ycombinator.com/item?id=11456562
Someone explicitly called out and removed the Useless Use of cat but yet left the Useless Uses of grep, sort, and uniq in, I see. (-: * https://porkmail.org/era/unix/award#grep awk '!/#/ { seen[$1]++; } END { for (k in seen) { print seen[k],k; } }' steves_hosts
Block Adware and Malware with /etc/hosts
21–30 of 79 posts
Re: Block Adware and Malware with /etc/hosts
#22This is the default list used by the pihole project as well; it's a very good list. FWIW, something like ublock origin is going to be better for in-browser blocking (for example, DNS poisoning won't work with youtube ads, which are served from youtube.com, but addins like UBO can remove them because they can hook into the actual traffic). The ultimate adblocking solution is to use UBO in your browsers AND spin up a p…
When my Pi stopped working and I couldn’t find a new one, I gave up and moved to NextDNS [1] and have been very happy.
Re: Block Adware and Malware with /etc/hosts
#23To ensure there are no nefarious redirects in such a massive list, this one-liner comes in handy[1]: grep -v '#' steves_hosts | awk '{print $1}'| sort | uniq -c [1] https://news.ycombinator.com/item?id=11456562
Someone explicitly called out and removed the Useless Use of cat but yet left the Useless Uses of grep, sort, and uniq in, I see. (-: * https://porkmail.org/era/unix/award#grep awk '!/#/ { seen[$1]++; } END { for (k in seen) { print seen[k],k; } }' steves_hosts
Re: Block Adware and Malware with /etc/hosts
#24Earlier quoted context omitted.
pi-hole also makes it super easy to block .zip and .mov TLDs.
Don't forget .com which is executable extension.
Re: Block Adware and Malware with /etc/hosts
#25https://www.obdev.at/products/littlesnitch-mini/index.html
Sure, you could manage /etc/hosts manually, but Little Snitch Mini has a nice interface for managing blocklists, auto-updates them, and has nice visualization, and you can also manage blocks per app.
Re: Block Adware and Malware with /etc/hosts
#26Re: Block Adware and Malware with /etc/hosts
#27To ensure there are no nefarious redirects in such a massive list, this one-liner comes in handy[1]: grep -v '#' steves_hosts | awk '{print $1}'| sort | uniq -c [1] https://news.ycombinator.com/item?id=11456562
Someone explicitly called out and removed the Useless Use of cat but yet left the Useless Uses of grep, sort, and uniq in, I see. (-: * https://porkmail.org/era/unix/award#grep awk '!/#/ { seen[$1]++; } END { for (k in seen) { print seen[k],k; } }' steves_hosts
Also your awk isn't exactly identical as it's not sorted, but in this case that probably doesn't matter.
Re: Block Adware and Malware with /etc/hosts
#28Forgot about it for a few years, but this post jogged my memory.
We currently use a PiHole for house-wide, network-wide ad and telemetry blocking, though, but perhaps that hosts list is useful to someone else.
Re: Block Adware and Malware with /etc/hosts
#29Reminds me of SlashDot where there was a relatively well known submitter that was a huge proponent of host-based ad blocking on Windows and was also a proponent of getting very angry at almost anyone else. (Edit: typo)
They could not wrap their head around the idea that the hosts method is limited in some use cases.
This could not be blocked without blocking the main host too. https://example.com/adverts-folder/advert.jpg
Now it sort of works in practice as most of the advert networks do not host on the same domain.
It is good at catching out whole bad domains but partial ones it is not very good at. Which some domains will do using a reverse proxy.
Also at one point a hosts file was linear scan. No sort of hashing or binary search lookup. Not sure if that was ever fixed in windows or linux. So a small number of hosts it was ok. But as the file grows it starts to add up.
Re: Block Adware and Malware with /etc/hosts
#30Interestingly, from what I remember of the April Fools columns of electronics magazines of the time, one thing that people would not have been surprised by is that the purpose was zapping advertisements.
* https://worldradiohistory.com/UK/Electronics-Today-UK/80s/El...