Skip to content

Instantly share code, notes, and snippets.

View maxrodrigo's full-sized avatar
🪐

Max Rodrigo maxrodrigo

🪐
View GitHub Profile
@maxrodrigo
maxrodrigo / git_file_prune.sh
Created September 15, 2021 06:28
Prune Git Repository
#!/usr/bin/env bash
FILE="$1"
git filter-branch --index-filter "git rm --cached --ignore-unmatch $FILE" --prune-empty --tag-name-filter cat -- --all
git for-each-ref --format="delete %(refname)" refs/original | git update-ref --stdin
git reflog expire --expire=now --all
git gc --prune=now
@maxrodrigo
maxrodrigo / pihole_blocklists.sh
Created October 20, 2021 22:11
Add blocklists to gravity.db with sqlite
curl https://v.firebog.net/hosts/lists.php?type=tick | \
xargs -I {} sqlite3 /etc/pihole/gravity.db "INSERT OR IGNORE INTO adlist (address, comment) VALUES ('{}','firebog');"
pihole -g