{"id":18574924,"url":"https://github.com/mattsparks/hostsfile","last_synced_at":"2025-10-04T16:40:11.843Z","repository":{"id":150215848,"uuid":"158300039","full_name":"mattsparks/hostsfile","owner":"mattsparks","description":"A command line tool that simplifies working with hosts files.","archived":false,"fork":false,"pushed_at":"2018-11-27T14:01:37.000Z","size":6,"stargazers_count":25,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T21:05:51.502Z","etag":null,"topics":["cli","command-line","command-line-tool","hosts","hostsfile","tool"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattsparks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-11-19T22:48:10.000Z","updated_at":"2023-09-08T17:47:25.000Z","dependencies_parsed_at":"2023-04-13T17:17:52.207Z","dependency_job_id":null,"html_url":"https://github.com/mattsparks/hostsfile","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mattsparks/hostsfile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattsparks%2Fhostsfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattsparks%2Fhostsfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattsparks%2Fhostsfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattsparks%2Fhostsfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattsparks","download_url":"https://codeload.github.com/mattsparks/hostsfile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattsparks%2Fhostsfile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278343069,"owners_count":25971399,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","command-line","command-line-tool","hosts","hostsfile","tool"],"created_at":"2024-11-06T23:16:54.216Z","updated_at":"2025-10-04T16:40:11.737Z","avatar_url":"https://github.com/mattsparks.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hostsfile\nHave you grown weary of working with your `hosts` file? Are you tired of editing it in your editor of choice? Look no further, traveler! _hostsfile_ is a tool to elevate your suffering.\n\nWant to add a domain to your hosts file? Easy!\n\n```shell\nsudo hostsfile add 127.0.0.1 example.com\n\nexample.com added to hosts file!\n```\n\nChange your mind? You always were unpredictable!\n\n```shell\nsudo hostsfile remove example.com\n\nexample.com removed from hosts file!\n```\n\nMaybe you'd like only to pause your addition...\n\n```shell\nsudo hostsfile pause example.com\n\nexample.com paused!\n```\n\nBut wait! Let's let it live again!\n\n```shell\nsudo hostsfile resume example.com\n\nexample.com resumed!\n```\n\n# Installation\n\nThese instructions are for macOS. The script should work on most Linux distributions, but hasn't been tested.\n\nFor those of you that use bash scripts regularly, I'll assume you have a directory somewhere with your scripts. Just add `hostsfile` to your directory, give it the proper permissions, and you should be good to go.\n\nFollow along below if you're new to bash scripts or need a little refresher. This is adapted from the wonderful tutorial from Tania Rascia called [How to Create and Use Bash Scripts](https://www.taniarascia.com/how-to-create-and-use-bash-scripts/).\n\n1. Open your terminal.\n\n2. Create a `bin` directory in your home directory.\n\n```shell\ncd ~\nmkdir bin\n```\n\n3. Export your bin directory.\n\n```shell\nsudo nano ~/.bash_profile # open .bash_profile\n```\nAdd the following line:\n\n```shell\nexport PATH=$PATH:/Users/your_user/bin\n```\nBe sure to replace \"your_user\" with your directory name.\n\nExit nano `CRTL+X` and save.\n\n4. Clone this repo and copy the `hostsfile` to your `/bin` directory.\n\n```shell\ncd ~/Code # navigate somewhere other than /bin\ngit clone https://github.com/mattsparks/hostsfile.git\ncd hostsfile\ncp hostsfile /Users/your_user/bin/hostsfile\n```\n\n5. Make it executable.\n\n```shell\ncd ~/bin # navigate to your bin if you're not there\nchmod u+x hostsfile\n```\n\n# Contribute\n\nI have **zero** doubt that this code can be improved. I'd love your contribution!\n\n1. Fork this repo.\n2. Create a new branch.\n3. Send pull request.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattsparks%2Fhostsfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattsparks%2Fhostsfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattsparks%2Fhostsfile/lists"}