Skip to content

Instantly share code, notes, and snippets.

@ar2pi
Last active August 9, 2021 15:33
Show Gist options
  • Save ar2pi/25d7ffc31cb1695bef557556ded182fe to your computer and use it in GitHub Desktop.
Save ar2pi/25d7ffc31cb1695bef557556ded182fe to your computer and use it in GitHub Desktop.
/etc/hosts ad blocker
#!/usr/bin/env bash
#
# This script will append additional entries (from http://winhelp2002.mvps.org/hosts.txt) in /etc/hosts file.
# run: "adblock"
#
# Notes:
# - A backup is created as `hosts.bk` in current working directory.
#
cp /etc/hosts hosts.bk
sudo sh -c "curl -sSL -o - http://winhelp2002.mvps.org/hosts.txt >> /etc/hosts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment