Giter VIP home page Giter VIP logo

macos-blackhole's Introduction

macos-blackhole

What is this?

A simple bash script I use on my MacBook. When run the script will:

  • Download and install the simple hosts file manager Gas Mask
  • Download StevenBlack's well-curated host files to load within Gas Mask
  • If Gas Mask is already installed, the host files will be updated to the latest versions

How do I run it?

Either

git clone https://github.com/TheDen/macos-blackhole
./macos-blackhole/macos-blackhole.sh
curl -sL https://raw.githubusercontent.com/TheDen/macos-blackhole/master/macos-blackhole.sh -o macos-blackhole.sh
chmod +x macos-blackhole.sh
./macos-blackhole.sh

Or live dangerously and pipe the script to bash

curl -sL https://raw.githubusercontent.com/TheDen/macos-blackhole/master/macos-blackhole.sh | bash

Why not just use pi-hole?

I 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.

Contributions and Caveats

Room for improvement and considerations for PRs:

  • 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
  • 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).
  • The script ought to be formatted with shfmt -i 2 -ci -sr (https://github.com/mvdan/sh) and the script must pass shellcheck (could potentially add a CI)
  • A nice way to run the script on schedule in MacOS? crontab?
  • There is inherit hackyness in this setup, but it's quick and works for me

What is MacOS's default host file?

127.0.0.1	localhost
255.255.255.255	broadcasthost
::1 localhost
fe80::1%lo0	localhost

macos-blackhole's People

Contributors

theden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.