This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {# | |
| This was my gaming/GPU Windows 11 passthrough libvirt vm. It's templated in jinja2 for use with Ansible. | |
| I retired it in October 2024. | |
| Arch Linux was the host, and I switched between using the stable and LTS Linux Kernel depending on updates. | |
| The rest of of Ansible repo (including the variables) has since been retired, but I made a point to document things as I tweaked them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| SYNCDIR=~/Sync | |
| LOGFILE=~/sync-conflicts.log | |
| find $SYNCDIR -name "*sync-conflict*" > $LOGFILE | |
| find ~/ -maxdepth 1 -type f -size 0 -name "sync-conflicts" -exec rm {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| LOGFILE=$(udevadm info --query=all --name=$1 | grep ID_SERIAL= | cut -c 14-) | |
| wipefs -a "$1" && \ | |
| dd if=/dev/urandom of="$1" status=progress bs=4096 ; \ | |
| smartctl -a "$1" >> "$LOGFILE".txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| diary () { | |
| PAGE=~/Obsidian/Notes/Attachments/Diary/$(date +%F).gpg | |
| if [ -f "$PAGE" ](%20-f%20"$PAGE"%20); then | |
| nvim -c 'set spell' "$PAGE" | |
| else | |
| echo "New page, copying template." | |
| cp ~/Obsidian/Notes/Attachments/Diary/template.gpg "$PAGE" >> /dev/null | |
| nvim -c 'set spell' "$PAGE" | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This is a silly little script I wrote to automatically update my NameCheap dynamic dns. I just wanted an alternative to the ddclient container I was using. | |
| # It should be able to handle some errors, there's a grep to get the IP address only, as well as a check to make sure it's between the character range. Not much else though, its literally an 11 line shell script, lmao. | |
| # Just edit the `DOMAIN` and `PASSWORD` enviornment variables in the script and throw it in your crontab. | |
| DOMAIN="" | |
| PASSWORD="" | |
| HOST="@" | |
| IP="$(curl -s https://dynamicdns.park-your-domain.com/getip 2>/dev/null | grep --colour=never -E -o '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)')" | |
| if [ "$(echo $IP | wc -c)" -le "15" ] && [ "$(echo $IP | wc -c)" -ge "7" ]; then | |
| curl -s https://dynamicdns.park-your-domain.com/update\?host\="$HOST"\&domain\="$DOMAIN"\&password\="$PASSWORD"\&ip\="$IP" | grep --colour=never |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| OSREL=$(grep -w ID /etc/os-release) | |
| SUBJECT="Updated Packages on $(cat /etc/hostname)" | |
| if [ "$OSREL" = "ID=arch" ]; then | |
| yay -Sy >> /dev/null | |
| BODY=$(yay -Qu) | |
| fi | |
| if [ "$OSREL" = "ID=debian" ]; then | |
| apt update &> /dev/null | |
| BODY=$(apt list --upgradable 2> /dev/null | grep -v '^Listing...') |