Compare commits

...

12 Commits

Author SHA1 Message Date
Random936
bc58d71ed5 Added new reconcile and pom scripts 2026-03-28 17:34:25 -04:00
Jaden Provost Maxwell-Comfort
5c36c869cd Separated idrac scripts to be server specific 2026-02-22 18:26:32 -08:00
Random936
b8c01492e2 Updated ledger to autocategorize transactions 2026-02-03 20:45:35 -05:00
Jaden Provost Maxwell-Comfort
7d83c328be Added idrac scripts for r730xd 2026-01-30 18:24:14 -05:00
Random936
1d407d1893 Added proxmox display script 2026-01-17 10:56:06 -05:00
Random936
9190f0dd6a Updated tld to use nextcloud directory 2025-12-14 12:19:38 -05:00
Random936
d38de67704 Fixed i3 switch command to correctly move workspaces 2025-12-01 18:57:01 -05:00
Random936
b0d8421b70 Created update script for ledger-cli using simplefin 2025-12-01 16:28:02 -05:00
Random936
434c84caf6 Added life-left script 2025-12-01 15:14:53 -05:00
Random936
0e65223381 Updated nixos update; modified run to only include .sh files 2025-12-01 15:14:03 -05:00
Random936
283ef0417b Updated nixos update script to update git submodules 2025-12-01 12:47:50 -05:00
Random936
5180bc805c Updated i3 switch to move workspaces 2025-11-18 20:06:44 -05:00
17 changed files with 172 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ SCRIPT_DIR="$(dirname $(realpath "$0"))"
function run() { function run() {
if [ $# -lt 2 ]; then if [ $# -lt 2 ]; then
echo "Usage: $0 <category> <script> [args...]" echo "Usage: $0 <category> <script> [args...]"
find "$SCRIPT_DIR" -mindepth 2 | awk -F'[./]' '{printf "$ run %s %s\n",$(NF-2),$(NF-1)}' find "$SCRIPT_DIR" -mindepth 2 -iname "*.sh" | awk -F'[./]' '{printf "$ run %s %s\n",$(NF-2),$(NF-1)}'
return return
fi fi
bash "$SCRIPT_DIR/$1/$2.sh" ${@:3} bash "$SCRIPT_DIR/$1/$2.sh" ${@:3}

View File

@@ -5,3 +5,9 @@ sleep 5
ps aux | grep polybar | awk '{ if (NR > 1) print prev; prev = $2}' | xargs kill ps aux | grep polybar | awk '{ if (NR > 1) print prev; prev = $2}' | xargs kill
~/.screenlayout/polybar.sh ~/.screenlayout/polybar.sh
~/.screenlayout/wallpapers.sh ~/.screenlayout/wallpapers.sh
i3 workspace number 2
i3 move workspace to output right
i3 workspace number 3
i3 move workspace to output right
i3 workspace number 3
i3 move workspace to output right

12
ledger/reconcile.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
if [[ -f "~/.simplefin.enc" ]]; then
echo "Simplefin access URL is missing."
echo "Please run the setup script before running update."
exit
fi
SCRIPT_DIR="$(dirname -- "${BASH_SOURCE[0]}")"
ACCESS_URL="$(cat ~/.simplefin.enc | openssl aes-256-cbc -d -a -salt -pbkdf2 -iter 1000000)"
curl -L "${ACCESS_URL}/accounts?start-date=$(date '+%s')&pending=1" | jq -rc '.accounts | map({name, balance})[]'

21
ledger/setup.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
read -p "Enter your setup token: " token
while : ; do
read -sp "Enter password: " password
echo
read -sp "Confirm password: " confirmed
echo
[[ "$password" == "$confirmed" ]] && break || echo "Passwords are not equal."
echo
done
CLAIM_URL="$(echo "$token" | base64 -d)"
ACCESS_URL="$(curl -H "Content-Length: 0" -X POST "$CLAIM_URL")"
echo "Claim URL: $CLAIM_URL"
echo "Access URL: $ACCESS_URL"
echo "$ACCESS_URL" | openssl aes-256-cbc -salt -a -pbkdf2 -iter 1000000 -pass "pass:$password" > ~/.simplefin.enc

43
ledger/update.jq Normal file
View File

@@ -0,0 +1,43 @@
# Takes in a string as the transaction description and returns the
# acconut to categorize as.
def categorize_transaction:
if test("MURNMGMT-MIRA") then "Expenses:Bills:Rent"
elif test("VERIZON\\s+DES") then "Expenses:Bills:Internet"
elif test("PEPCO\\s+PAYMENTUS|WASHINGTON\\s+GAS\\s+DES") then "Expenses:Bills:Utilities"
elif test("HEALTHEQUITY\\s+INC") then "Assets:HealthEquity"
elif test("LOCKHEED\\s+MARTIN") then "Income:Work"
elif test("CASH\\s+REWARDS") then "Income:Gifts"
elif test("Roosters") then "Expenses:Essentials:Hygiene"
elif test("ALASKA\\s+AIR") then "Expenses:Travel:Flights"
elif test("HELP\\.UBER\\.COMCA") then "Expenses:Travel:Taxi"
elif test("STEAM GAMES") then "Expenses:Entertainment:Games"
elif test("YouTubePremium|DOORDASHDASHPASS|Prime\\s+Video\\s+Channels|TIDAL\\.COM|Amazon Grocery|SIMPLEFIN BRIDGE|(APPLE\\.COM.*RECURRING$)") then "Expenses:Subscriptions"
elif test("MOMS OF|SAFEWAY\\.COM|MAYORGA") then "Expenses:Food:Groceries"
elif test("CHICK-FIL-A|GEMELLIS\\s+ITALIAN|CHIPOTLE|SHEETZ|KUNG\\s+FU\\s+TEA") then "Expenses:Food:Restaurants"
elif test("GRUBHUB|DD\\s+\\*DOORDASH") then "Expenses:Food:Delivery"
elif test("MARKET@WORK") then "Expenses:Food:Snacks"
else "UNKNOWN" end;
def format_transactions:
map(
.name as $name |
.transactions |
map(.account = $name)[]
) |
sort_by(.transacted_at) |
map(
(.transacted_at | strftime("%Y/%m/%d")) + " " +
(.description | gsub("\\s+"; " ")) + "\n " + (.description | categorize_transaction) + " $" +
(-(.amount | tonumber) | tostring) + " ; Payee: " +
.payee + "\n " +
.account + "\n"
);
def rename_accounts:
map(.name |= (
if (.| startswith("Adv Plus Banking")) then "Checking"
elif (.| startswith("Unlimited Cash Rewards Visa Signature")) then "Credit"
elif (.| startswith("Amazon Prime Rewards Visa Signature")) then "Amazon"
end));
.accounts | rename_accounts | format_transactions[]

17
ledger/update.sh Normal file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
if [[ $# < 1 ]]; then
echo "Usage: $0 <start-date>"
exit
fi
if [[ -f "~/.simplefin.enc" ]]; then
echo "Simplefin access URL is missing."
echo "Please run the setup script before running update."
exit
fi
SCRIPT_DIR="$(dirname -- "${BASH_SOURCE[0]}")"
ACCESS_URL="$(cat ~/.simplefin.enc | openssl aes-256-cbc -d -a -salt -pbkdf2 -iter 1000000)"
curl -L "${ACCESS_URL}/accounts?start-date=$(date -d "$1" '+%s')&pending=1" | jq -r -f "${SCRIPT_DIR}/update.jq"

27
life/left.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
MINUTE=60
HOUR=$(($MINUTE * 60))
DAY=$(($HOUR * 24))
MONTH=$(($DAY * 30))
YEAR=$(($DAY * 365))
if [[ $# < 2 ]]; then
echo "Usage: $0 <birthdate> <age>"
exit
fi
print_lifetime() {
future=$(date +%s -d "$1 + $2 years")
epoch=$(($future - $(date +%s)))
echo "Seconds until $2 years old: $epoch"
echo "Minutes until $2 years old: $(($epoch / $MINUTE))"
echo "Hours until $2 years old: $(($epoch / $HOUR))"
echo "Days until $2 years old: $(($epoch / $DAY))"
echo "Months until $2 years old: $(($epoch / $MONTH))"
echo "Years until $2 years old: $(($epoch / $YEAR))"
}
print_lifetime "$1" "$2"

View File

@@ -1,6 +1,10 @@
#!/usr/bin/env bash
update() { update() {
cd ~/dotfiles cd ~/dotfiles
git pull git pull
git submodule init
git submodule update
sudo nixos-rebuild switch --flake ~/dotfiles sudo nixos-rebuild switch --flake ~/dotfiles
home-manager switch --flake ~/dotfiles home-manager switch --flake ~/dotfiles
} }
@@ -9,7 +13,7 @@ update() {
ssh media@media.randomctf.com -t "$(typeset -f update); update" ssh media@media.randomctf.com -t "$(typeset -f update); update"
ssh logging@logging.randomctf.local -t "$(typeset -f update); update" ssh logging@logging.randomctf.local -t "$(typeset -f update); update"
ssh mindforge@mindforge.randomctf.local -t "$(typeset -f update); update" ssh mindforge@mindforge.randomctf.local -t "$(typeset -f update); update"
ssh sampledb@sampledb.randomctf.local -t "$(typeset -f update); update" ssh mnemosyne@mnemosyne.randomctf.local -t "$(typeset -f update); update"
# Ubuntu VMs # Ubuntu VMs
ssh pbx@pbx.randomctf.local -t "sudo apt update -y && sudo apt upgrade -y" ssh pbx@pbx.randomctf.local -t "sudo apt update -y && sudo apt upgrade -y"

18
prod/pom.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
cycle_raw=$(gum choose --header="Choose your pomodoro cycle for work/break." "50/10" "25/5")
work_time=$(echo "$cycle_raw" | cut -d/ -f 1)
break_time=$(echo "$cycle_raw" | cut -d/ -f 2)
while true; do
timer "${work_time}m"
if gum confirm "Do you want to take a break?"; then
timer "${break_time}m"
fi
if ! gum confirm "Do you want to resume working?"; then
break
fi
done

3
proxmox/display.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
nohup remote-viewer ~/Downloads/pve-spice.vv 2>&1 >/dev/null &

3
r330/start.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
sshpass -p "$(rbw get iDRAC)" ssh root@192.168.100.11 racadm serveraction powerup

3
r330/status.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
sshpass -p "$(rbw get iDRAC)" ssh root@192.168.100.11 racadm serveraction powerstatus

3
r330/stop.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
sshpass -p "$(rbw get iDRAC)" ssh root@192.168.100.11 racadm serveraction graceshutdown

3
r730xd/start.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
sshpass -p "$(rbw get iDRAC)" ssh root@192.168.100.12 racadm serveraction powerup

3
r730xd/status.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
sshpass -p "$(rbw get iDRAC)" ssh root@192.168.100.12 racadm serveraction powerstatus

3
r730xd/stop.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
sshpass -p "$(rbw get iDRAC)" ssh root@192.168.100.12 racadm serveraction graceshutdown

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
backup=$(date +%s) backup=$(date +%s)
mkdir "$HOME/backup_tld/$backup" mkdir "$HOME/Nextcloud/Archives/Backups/backup_tld/$backup"
cp -R "$HOME/.local/share/Hinterland/TheLongDark/Survival/"* "$HOME/backup_tld/$backup" cp -R "$HOME/.local/share/Hinterland/TheLongDark/Survival/"* "$HOME/backup_tld/$backup"