{"id":17720129,"url":"https://github.com/theden/macos-blackhole","last_synced_at":"2025-07-09T03:11:25.711Z","repository":{"id":83727753,"uuid":"240039332","full_name":"TheDen/macos-blackhole","owner":"TheDen","description":"Script to set up pi-hole style blocking on your MacBook","archived":false,"fork":false,"pushed_at":"2020-03-14T12:33:32.000Z","size":22,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-08T04:25:31.372Z","etag":null,"topics":["ad-blocker","pi-hole","privacy","security","shell","unified-hosts"],"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/TheDen.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":"2020-02-12T14:56:04.000Z","updated_at":"2023-01-05T17:27:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"a1d67dfe-115e-48ea-92ed-fb2def3be373","html_url":"https://github.com/TheDen/macos-blackhole","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TheDen/macos-blackhole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDen%2Fmacos-blackhole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDen%2Fmacos-blackhole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDen%2Fmacos-blackhole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDen%2Fmacos-blackhole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheDen","download_url":"https://codeload.github.com/TheDen/macos-blackhole/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheDen%2Fmacos-blackhole/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264384389,"owners_count":23599612,"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":["ad-blocker","pi-hole","privacy","security","shell","unified-hosts"],"created_at":"2024-10-25T15:26:14.553Z","updated_at":"2025-07-09T03:11:25.695Z","avatar_url":"https://github.com/TheDen.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# macos-blackhole\n\n## What is this?\n\nA simple bash script I use on my MacBook. When run the script will:\n\n* Download and install the simple hosts file manager [Gas Mask](https://github.com/2ndalpha/gasmask)\n* Download [StevenBlack's](https://github.com/StevenBlack/hosts) well-curated host files to load within Gas Mask\n* If Gas Mask is already installed, the host files will be updated to the latest versions\n\n\n## How do I run it?\n\nEither\n\n```bash\ngit clone https://github.com/TheDen/macos-blackhole\n./macos-blackhole/macos-blackhole.sh\n```\n\n```bash\ncurl -sL https://raw.githubusercontent.com/TheDen/macos-blackhole/master/macos-blackhole.sh -o macos-blackhole.sh\nchmod +x macos-blackhole.sh\n./macos-blackhole.sh\n```\n\nOr live dangerously and pipe the script to `bash`\n\n```bash\ncurl -sL https://raw.githubusercontent.com/TheDen/macos-blackhole/master/macos-blackhole.sh | bash\n```\n\n## Why not just use [pi-hole](https://github.com/pi-hole/pi-hole)?\n\nI love pi-hole, but sometimes pi-hole can't be deployed on networks where the the user is not an admin (or on untrusted networks). This allows mobility with respect to host blocking.\n\n## Contributions and Caveats\n\nRoom for improvement and considerations for PRs:\n\n* Currently it's set up to only download two host files from SteveBlack's repo. Personally these are the two I mainly use, though the script could be updated to download them all\n* Even though this is a personal script, I attempted to make it portable, deps are builtins, `bash` (avoiding v4 bashisms), `curl`, `unzip`, and `shasum`. So it's not guaranteed to work on your machine (but most likely will).\n* The script ought to be formatted with `shfmt -i 2 -ci -sr` ([https://github.com/mvdan/sh](https://github.com/mvdan/sh)) and the script must pass [shellcheck](https://github.com/koalaman/shellcheck) (could potentially add a CI)\n* A nice way to run the script on schedule in MacOS? `crontab`?\n* There is inherit hackyness in this setup, but it's quick and works for me\n\n\n## What is MacOS's default host file?\n\n```\n127.0.0.1\tlocalhost\n255.255.255.255\tbroadcasthost\n::1 localhost\nfe80::1%lo0\tlocalhost\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheden%2Fmacos-blackhole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheden%2Fmacos-blackhole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheden%2Fmacos-blackhole/lists"}