Last active
September 25, 2020 15:22
-
-
Save mpvosseller/9f6a19136412ec5f71effc3faf33aa2e to your computer and use it in GitHub Desktop.
shell aliases to temporarily block and unblock a set of hostnames to better focus
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
# add to your shell startup file (e.g. ~/.zshrc or ~/.bash_profile) | |
export FOCUS_IGNORE_SITES="twitter.com api.twitter.com www.facebook.com www.nytimes.com" | |
alias focus='sudo echo "127.0.0.1 ${FOCUS_IGNORE_SITES} # FOCUS_IGNORE_SITES" | sudo tee -a /etc/hosts > /dev/null' | |
alias unfocus="sudo sed -i '' '/FOCUS_IGNORE_SITES/d' /etc/hosts" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment