Skip to content

Instantly share code, notes, and snippets.

@javasteve99
Last active August 7, 2023 17:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save javasteve99/3226267 to your computer and use it in GitHub Desktop.
Save javasteve99/3226267 to your computer and use it in GitHub Desktop.
Blocked sites through host file === SUPER PRODUCTIVITY!!!
$ sudo crontab -e
# from https://unix.stackexchange.com/questions/41496/two-different-etc-hosts-depending-upon-the-time
0 9 * * 1-5 ln -f /etc/hosts_worktime /etc/hosts
0 16 * * 1-5 ln -f /etc/hosts_playtime /etc/hosts
$ sudo vi /private/etc/hosts //Open hosts file in vim
$ :x <enter> //Save edits and quit vim
$ dscacheutil -flushcache //Flush DNS cache <remember you have this aliased to 'flushit'>
//Restart Browser
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 vox.com
127.0.0.1 www.vox.com
127.0.0.1 nationalreview.com
127.0.0.1 www.nationalreview.com
127.0.0.1 reddit.com
127.0.0.1 www.reddit.com
127.0.0.1 cnn.com
127.0.0.1 www.cnn.com
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 arstechnica.com
127.0.0.1 www.arstechnica.com
127.0.0.1 theverge.com
127.0.0.1 www.theverge.com
127.0.0.1 npr.org
127.0.0.1 www.npr.org
127.0.0.1 askamanager.org
127.0.0.1 www.askamanager.org
127.0.0.1 feedly.com
127.0.0.1 www.feedly.com
127.0.0.1 nytimes.com
127.0.0.1 www.nytimes.com
127.0.0.1 washingtonpost.com
127.0.0.1 www.washingtonpost.com
127.0.0.1 wbur.org
127.0.0.1 www.wbur.org
127.0.0.1 boston.com
127.0.0.1 www.boston.com
127.0.0.1 appleinsider.com
127.0.0.1 www.appleinsider.com
127.0.0.1 macrumors.com
127.0.0.1 www.macrumors.com
127.0.0.1 instagram.com
127.0.0.1 www.instagram.com
127.0.0.1 twitter.com
127.0.0.1 www.twitter.com
127.0.0.1 gizmodo.com
127.0.0.1 www.gizmodo.com
127.0.0.1 io9.gizmodo.com
127.0.0.1 fivethirtyeight.com
127.0.0.1 www.fivethirtyeight.com
127.0.0.1 bostonglobe.com
127.0.0.1 www.bostonglobe.com
127.0.0.1 tiktok.com
127.0.0.1 www.tiktok.com
127.0.0.1 news.google.com
127.0.0.1 news.yahoo.com
127.0.0.1 masslive.com
127.0.0.1 www.masslive.com
127.0.0.1 bostonherald.com
127.0.0.1 www.bostonherald.com
127.0.0.1 axios.com
127.0.0.1 www.axios.com
127.0.0.1 thehill.com
127.0.0.1 www.hill.com
127.0.0.1 politico.com
127.0.0.1 www.politico.com
127.0.0.1 guitar.com
127.0.0.1 www.guitar.com
127.0.0.1 guitarworld.com
127.0.0.1 www.guitarworld.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment