This commit is contained in:
Jeffrey Paul 2025-05-16 23:26:14 -07:00
commit 9b405f4fb7
3 changed files with 47 additions and 0 deletions

16
Makefile Normal file
View File

@ -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

14
generate.sh Executable file
View File

@ -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

17
list.txt Normal file
View File

@ -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