Skip to content

Instantly share code, notes, and snippets.

@NNBnh
Created February 27, 2021 10:24
Show Gist options
  • Save NNBnh/15d18a005c6ab849855bddfad54ec044 to your computer and use it in GitHub Desktop.
Save NNBnh/15d18a005c6ab849855bddfad54ec044 to your computer and use it in GitHub Desktop.
Install Hosts ad-block quickly
#!/bin/sh
# Values
TMPDIR="${TMPDIR:-/tmp}"
# Start
curl -fsSL 'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts' --create-dirs --output "$TMPDIR/hosts" \
&& printf '%s' "127.0.1.1 $(hostname)" >> "$TMPDIR/hosts" \
&& sudo mv "$TMPDIR/hosts" '/etc/hosts'
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment