Last active
September 8, 2024 12:07
-
-
Save corporatepiyush/7ebc13a355f70a8b9617488e86c174d1 to your computer and use it in GitHub Desktop.
Block ads and malware for MacOS and Linux
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
# Protection from Malicious Domain (ads, malware, hack scripts, fakenews and gambling ) | |
# You may not be doing it but various apps installed on your system doing it internally, so having ad blocker in Browser does not helps. | |
# Execute below command in your terminal once every week. | |
sudo chmod 774 /etc/hosts | |
curl https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn/hosts > hosts | |
sudo mv hosts /etc/hosts | |
sudo chmod 644 /etc/hosts |
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
# Protection from Malicious Domain (ads, malware, hack scripts, fakenews and gambling ) for MacOS. | |
# You may not be doing it but various apps installed on your system doing it internally, so having ad blocker in Browser does not helps. | |
# Execute below command in your terminal once every week. | |
sudo chmod 774 /private/etc/hosts | |
curl https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn/hosts > hosts | |
sudo mv hosts /private/etc/hosts | |
sudo chmod 644 /private/etc/hosts |
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
# Protection from Malicious Domain (ads, malware, hack scripts, fakenews and gambling ) for Linux servers in cloud. This is much restricitve version | |
# Execute below command in your terminal once every week. | |
sudo chmod 774 /etc/hosts | |
curl https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts > hosts | |
sudo mv hosts /etc/hosts | |
sudo chmod 644 /etc/hosts |
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
# Protection from Malicious Domain (ads, malware, hack scripts, fakenews and gambling ) for MacOS machine as server | |
# Execute below command in your terminal once every week. | |
sudo chmod 774 /private/etc/hosts | |
curl https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts > hosts | |
sudo mv hosts /private/etc/hosts | |
sudo chmod 644 /private/etc/hosts |
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
# Change permissions of /etc/hosts to allow writing | |
sudo chmod 774 /etc/hosts | |
# Download the updated hosts file from StevenBlack's repository | |
fetch https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts -o /tmp/hosts | |
# Backup the current /etc/hosts file (optional but recommended) | |
sudo cp /etc/hosts /etc/hosts.bak | |
# Move the new hosts file to replace /etc/hosts | |
sudo mv /tmp/hosts /etc/hosts | |
# Set correct permissions for /etc/hosts | |
sudo chmod 644 /etc/hosts | |
# Inform the user that the process is complete | |
echo "The /etc/hosts file has been updated successfully and permissions restored." |
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
nmcli connection show --active | |
# here instead of "wiredProfileCustom", put the actual name specific to your machine | |
sudo nmcli connection modify "wiredProfileCustom" ipv4.dns "1.1.1.3" | |
sudo nmcli connection modify "wiredProfileCustom" ipv4.ignore-auto-dns yes | |
sudo nmcli connection up "wiredProfileCustom" | |
nmcli connection show "wiredProfileCustom" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment