Created
December 28, 2021 23:20
-
-
Save dehidehidehi/580554cf855665dcadc8c1a478054825 to your computer and use it in GitHub Desktop.
/etc/hosts : Block adservers, facebook products, and cryptominers urls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Block advertisers, facebook products, and cryptominer scripts | |
| # into a new file which can replace /etc/hosts. | |
| # Make a dir to store the to-be downloaded files. | |
| mkdir /etc/hosts.d/blocked | |
| cp /etc/hosts /etc/hosts.d/blocked/previous-hosts-contents.txt | |
| cd /etc/hosts.d/blocked | |
| # Download block lists directly from officially maintained repositories. | |
| curl -o adservers.txt https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt | |
| curl -o facebook-extended.txt https://www.github.developerdan.com/hosts/lists/facebook-extended.txt | |
| curl -o coinminers-all.txt https://gitlab.com/ZeroDot1/CoinBlockerLists/-/raw/master/list.txt?inline=false | |
| # Merge all .txt files into one file. | |
| # as the hosts file. | |
| cat /etc/hosts.d/blocked/*.txt > /etc/hosts.d/blocked/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment