commit 9b405f4fb7e866c2aabaa5ca02b4f1db974ea3b3 Author: sneak Date: Fri May 16 23:26:14 2025 -0700 initial diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8a55d4b --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +.PHONY: default commit clean + +default: commit + +commit: hosts + @echo "Committing changes to the repository..." + @git add hosts hosts.txt list.txt + @git commit -m "Update hosts file" + @git push origin main + +hosts: list.txt + ./generate.sh > $@ + cp $@ hosts.txt + +clean: + @rm -rf hosts hosts.txt diff --git a/generate.sh b/generate.sh new file mode 100755 index 0000000..d3c0530 --- /dev/null +++ b/generate.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -euo pipefail + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P )" + +HOSTS="$(awk '{ sub(/#.*/,""); if (/\S/) print }' $DIR/list.txt)" + +HOSTS="$(awk '{ sub(/#.*/,""); if (NF) print }' $DIR/list.txt | sort | uniq)" + +for HOST in $HOSTS ; do + echo "127.0.0.1 $HOST" +done + diff --git a/list.txt b/list.txt new file mode 100644 index 0000000..48e71cc --- /dev/null +++ b/list.txt @@ -0,0 +1,17 @@ +# sneak.berlin dns blocklist +# sneak@sneak.berlin +# WTFPL license + +# apple stuff that macOS/iOS don't need to work +xp.apple.com +pancake.apple.com + +# self explanatory +copilot-telemetry.githubusercontent.com + +# nanoleaf light panels constantly and unnecessarily phone home +health.nanoleaf.me +daemon.nanoleaf.me + +# so sad that mozilla sucks now +incoming.telemetry.mozilla.org