Skip to content

Instantly share code, notes, and snippets.

@bennylope
bennylope / productivity.sh
Last active September 30, 2019 13:33
Block (from Samuel Mullen on Legacy Rocks slack)
# List the domains you want to block, one per line, in your ~/.blocked_sites file,
# then ensure this script is included or sourced in your terminal configuration.
function worktime {
while read -r line; do
echo "127.0.0.1 ${line} # WORKTIME"
echo "fe80::1%lo0 ${line} # WORKTIME"
echo "127.0.0.1 www.${line} # WORKTIME"
echo "fe80::1%lo0 www.${line} # WORKTIME"
done < $HOME/.blocked_sites | sudo tee -a /etc/hosts > /dev/null