scripts/housekeeping

51 lines
1.5 KiB
Plaintext
Raw Normal View History

2018-08-02 02:52:06 +00:00
#!/bin/bash
# Run karn on all work projects so that my git identities are correct
WORK_ROOT="/home/nemo/projects/work/razorpay"
find $WORK_ROOT -maxdepth 2 -type d -iname .git | xargs -I{} bash -c "cd {}/.. && karn update"
PERSONAL_ROOT="/home/nemo/projects/personal"
2018-10-21 12:40:17 +00:00
find $PERSONAL_ROOT -maxdepth 2 -type d -iname .git | xargs -I{} bash -c "cd {}/.. && karn update"
# Cleanup yay-cache
2018-12-25 09:24:25 +00:00
find /home/nemo/.cache/yay -iregex '.*\.\(bz2\|tar\|zip\|deb\|xz\|gz\)$' -delete
# Remove orphan packages
2019-01-01 18:56:43 +00:00
sudo pacman -Rns $(pacman -Qtdq)
# Delete pacman cache files older than 7 days
sudo find /var/cache/pacman/pkg -maxdepth 1 -mindepth 1 -mtime +7 -delete
2018-12-25 09:24:25 +00:00
# Clear systemd logs
sudo journalctl --vacuum-size=100M
# Clear docker stuff
sudo docker system prune -af
## KEEP ALL NETWORK RELATED STUFF BELOW THIS
echo "Going to try stuff that needs network access now"
# Push passwords to keybase
2019-02-16 07:26:32 +00:00
pass git pushall
2018-12-25 09:24:25 +00:00
# Sync mobile passwords
cd /home/nemo/projects/personal/mobile-passwords
2019-03-28 06:24:49 +00:00
git from && ./runme.sh && git pushall
# Sync mobile passwords
pushd /home/nemo/projects/personal/mobile-passwords
git from && ./runme.sh && git push origin master
popd
# Generate a blacklist hosts file
if ping -c 1 192.168.1.1 &> /dev/null
then
# Generate the Blacklist
2019-04-15 19:26:17 +00:00
pushd /home/nemo/projects/personal/dnscrypt-proxy/utils/generate-domains-blacklists
2019-03-28 06:24:49 +00:00
python2 ./generate-domains-blacklist.py > blacklist.txt
2019-04-26 22:27:16 +00:00
scp blacklist.txt root@192.168.1.1:/etc/config/blacklist.txt
2019-03-28 06:24:49 +00:00
popd
2019-04-15 19:26:17 +00:00
# TODO: Copy it across to the router
2019-03-28 06:24:49 +00:00
fi