Hacker News new | ask | show | jobs
by sirodoht 2159 days ago
Disabling access from /etc/hosts has been very useful for me, though my similar [1] productivity script did not work as well as I wanted it.

For quite some time I had been using hostess [2] to enable/disable specific websites, yet this too had a couple of problems.

1. Docker Desktop (macOS) keeps appending on my /etc/hosts without asking me when I start it. This requires usage of `hostess fix` to remove duplicate entries.

2. Changing /etc/hosts requires sudo access, which means I have to keep inputting it when I need to make any changes.

Eventually I just `vim /etc/hosts` instead of `sudo hostess fix && sudo hostess on news.ycombinator.com`

[1] https://github.com/sirodoht/productivity.sh

[2] https://github.com/cbednarski/hostess

1 comments

You can use the NOPASSWD directive in your

     /etc/sudoers 
file to allow hostess to run in sudo without auth.