{"id":20109542,"url":"https://github.com/agentcooper/hosts-cop","last_synced_at":"2026-05-10T13:04:54.088Z","repository":{"id":141124661,"uuid":"190938243","full_name":"agentcooper/hosts-cop","owner":"agentcooper","description":"Restore /etc/hosts each time you remove sites from it (macOS)","archived":false,"fork":false,"pushed_at":"2019-06-08T23:25:04.000Z","size":187,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T05:29:58.887Z","etag":null,"topics":["etc-hosts","hosts-file","macos","productivity","self-control"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agentcooper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-08T21:47:55.000Z","updated_at":"2019-06-08T23:25:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"c16b5e3e-d3ff-491e-a74b-cbafd0741ce9","html_url":"https://github.com/agentcooper/hosts-cop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentcooper%2Fhosts-cop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentcooper%2Fhosts-cop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentcooper%2Fhosts-cop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentcooper%2Fhosts-cop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agentcooper","download_url":"https://codeload.github.com/agentcooper/hosts-cop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241549741,"owners_count":19980578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["etc-hosts","hosts-file","macos","productivity","self-control"],"created_at":"2024-11-13T18:08:47.914Z","updated_at":"2026-05-10T13:04:49.052Z","avatar_url":"https://github.com/agentcooper.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hosts cop\n\n`/etc/hosts` file is pretty useful for blocking websites ([guide](\u003chttps://www.wikihow.com/Block-and-Unblock-Internet-Sites-(On-a-Mac)#Blocking_Sites_with_the_Hosts_File_sub\u003e)). Once you learn how to do it, it is also easy to unblock them.\n\nHosts cop will restore `/etc/hosts` file to the previous version each time you try to remove blocked sites from it.\n\n![notification](./screenshots/notification.png?raw=true)\n\nAdding sites to `/etc/hosts` will not trigger a notification.\n\nFor macOS.\n\n## Install\n\n```bash\ngit clone https://github.com/agentcooper/hosts-cop\nsudo ./hosts-cop/start\n```\n\n## Stop\n\n```bash\n# from hosts-cop directory\nsudo ./stop\n```\n\n## Why `sudo`?\n\nScript needs to run from [`/Library/LaunchDaemons/`](https://www.launchd.info/) to be able to write to `/etc/hosts`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentcooper%2Fhosts-cop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagentcooper%2Fhosts-cop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentcooper%2Fhosts-cop/lists"}