Compare commits
4 Commits
1d407d1893
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc58d71ed5 | ||
|
|
5c36c869cd | ||
|
|
b8c01492e2 | ||
|
|
7d83c328be |
12
ledger/reconcile.sh
Normal file
12
ledger/reconcile.sh
Normal 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})[]'
|
||||||
@@ -1,3 +1,23 @@
|
|||||||
|
# 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:
|
def format_transactions:
|
||||||
map(
|
map(
|
||||||
.name as $name |
|
.name as $name |
|
||||||
@@ -7,7 +27,7 @@ def format_transactions:
|
|||||||
sort_by(.transacted_at) |
|
sort_by(.transacted_at) |
|
||||||
map(
|
map(
|
||||||
(.transacted_at | strftime("%Y/%m/%d")) + " " +
|
(.transacted_at | strftime("%Y/%m/%d")) + " " +
|
||||||
(.description | gsub("\\s+"; " ")) + "\n UNKNOWN $" +
|
(.description | gsub("\\s+"; " ")) + "\n " + (.description | categorize_transaction) + " $" +
|
||||||
(-(.amount | tonumber) | tostring) + " ; Payee: " +
|
(-(.amount | tonumber) | tostring) + " ; Payee: " +
|
||||||
.payee + "\n " +
|
.payee + "\n " +
|
||||||
.account + "\n"
|
.account + "\n"
|
||||||
@@ -20,4 +40,4 @@ def rename_accounts:
|
|||||||
elif (.| startswith("Amazon Prime Rewards Visa Signature")) then "Amazon"
|
elif (.| startswith("Amazon Prime Rewards Visa Signature")) then "Amazon"
|
||||||
end));
|
end));
|
||||||
|
|
||||||
.accounts | rename_accounts | format_transactions[]
|
.accounts | rename_accounts | format_transactions[]
|
||||||
|
|||||||
@@ -13,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
18
prod/pom.sh
Normal 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
r330/start.sh
Normal file
3
r330/start.sh
Normal 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
3
r330/status.sh
Normal 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
3
r330/stop.sh
Normal 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
3
r730xd/start.sh
Normal 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
3
r730xd/status.sh
Normal 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
3
r730xd/stop.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
sshpass -p "$(rbw get iDRAC)" ssh root@192.168.100.12 racadm serveraction graceshutdown
|
||||||
Reference in New Issue
Block a user