From c5a1015083050726f2e00575e6c64d05c80c940f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:00:07 -0700 Subject: [PATCH 001/144] Add a script for uploading MASTER catalogs automagically, so the location of the trailing slash can't accidentally be swapped. ;) --- bin/send-to-server.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/send-to-server.sh diff --git a/bin/send-to-server.sh b/bin/send-to-server.sh new file mode 100755 index 0000000..f25969a --- /dev/null +++ b/bin/send-to-server.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# TBD: +# - ensure all SERVER_* variables actually exist in environment +# - test the script :) + +DIR="$(dirname -- "${BASH_SOURCE[0]}")" + +if [[ "$DIR" != *"MASTER" ]]; then + echo "This directory is not labeled as a MASTER. Skipping upload." + exit 0 +fi + +new_dir="`basename $DIR`" +new_dir="${new_dir//MASTER/clone}" + +clone -e "ssh -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_NAME:$SERVER_SFTP/$new_dir From 353b38fad45bc3a6f2d1b6b40a27ab24555e44a3 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:01:51 -0700 Subject: [PATCH 002/144] Rename script to something easier to remember as well as type. --- bin/{send-to-server.sh => send-master.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename bin/{send-to-server.sh => send-master.sh} (100%) diff --git a/bin/send-to-server.sh b/bin/send-master.sh similarity index 100% rename from bin/send-to-server.sh rename to bin/send-master.sh From 17a65f6ce0c80e8cf7e508a7bbda1fe465cb009a Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:07:49 -0700 Subject: [PATCH 003/144] Rename the bin dir to include `shared`. --- {bin => bin-shared}/send-master.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {bin => bin-shared}/send-master.sh (100%) diff --git a/bin/send-master.sh b/bin-shared/send-master.sh similarity index 100% rename from bin/send-master.sh rename to bin-shared/send-master.sh From 9bb80b51c4115ce4dbfe7a42ea945a0b4020fe36 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:07:55 -0700 Subject: [PATCH 004/144] Add RC file which sources the shared bin. --- .rc-shared | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .rc-shared diff --git a/.rc-shared b/.rc-shared new file mode 100644 index 0000000..ed716da --- /dev/null +++ b/.rc-shared @@ -0,0 +1,8 @@ +# Notes: +# Try and keep this file OK for both BASH and ZSH, preferring BASH if necessary. + +echo "Shared RC Config - Loading..." + +set PATH="$PATH:~/bin-shared:~/.bin-shared" + +echo "Shared RC Config - Complete!" From 3c6a0994c6be7e84a66c6fb0fe24c938e5d64121 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:08:40 -0700 Subject: [PATCH 005/144] Edit note to be more stern yet kind. ;) --- .rc-shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rc-shared b/.rc-shared index ed716da..3633eb2 100644 --- a/.rc-shared +++ b/.rc-shared @@ -1,5 +1,5 @@ # Notes: -# Try and keep this file OK for both BASH and ZSH, preferring BASH if necessary. +# - Please keep this file working for both BASH and ZSH. :) echo "Shared RC Config - Loading..." From 8bf6b5905c7724f16c3a86d0267c1e7517d9cb9a Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:13:00 -0700 Subject: [PATCH 006/144] Use underscore in name. --- .rc-shared => .rc_shared | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .rc-shared => .rc_shared (100%) diff --git a/.rc-shared b/.rc_shared similarity index 100% rename from .rc-shared rename to .rc_shared From 1c919cb4d97a984841d00bb1a9896966dc31ca8d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:13:46 -0700 Subject: [PATCH 007/144] Use underscore in script filename as well. --- bin-shared/{send-master.sh => send_master.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename bin-shared/{send-master.sh => send_master.sh} (100%) diff --git a/bin-shared/send-master.sh b/bin-shared/send_master.sh similarity index 100% rename from bin-shared/send-master.sh rename to bin-shared/send_master.sh From 3de906a03fb6e3c6e21d49072709b9ed9e58852e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:13:57 -0700 Subject: [PATCH 008/144] Create alias with dash for script. --- .rc_shared | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.rc_shared b/.rc_shared index 3633eb2..69b74dc 100644 --- a/.rc_shared +++ b/.rc_shared @@ -5,4 +5,6 @@ echo "Shared RC Config - Loading..." set PATH="$PATH:~/bin-shared:~/.bin-shared" +alias send-master="send_master.sh" + echo "Shared RC Config - Complete!" From 8e3c581d16fefb1fb269764be753a0a40bc3ec2c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:21:39 -0700 Subject: [PATCH 009/144] Rename file for better code highlighting. --- .rc_shared | 10 ---------- rc_shared.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 10 deletions(-) delete mode 100644 .rc_shared create mode 100644 rc_shared.sh diff --git a/.rc_shared b/.rc_shared deleted file mode 100644 index 69b74dc..0000000 --- a/.rc_shared +++ /dev/null @@ -1,10 +0,0 @@ -# Notes: -# - Please keep this file working for both BASH and ZSH. :) - -echo "Shared RC Config - Loading..." - -set PATH="$PATH:~/bin-shared:~/.bin-shared" - -alias send-master="send_master.sh" - -echo "Shared RC Config - Complete!" diff --git a/rc_shared.sh b/rc_shared.sh new file mode 100644 index 0000000..c80db94 --- /dev/null +++ b/rc_shared.sh @@ -0,0 +1,27 @@ +# Notes: +# - Please keep this file working for both BASH and ZSH. :) + +echo "Shared RC Config - Loading..." + +export PATH="$PATH:~/bin-shared:~/.bin-shared" + +alias send-master="send_master.sh" + +function update-shared { + branch="$1" + if [[ -z "$branch" ]]; then + branch="dev" + fi + + git clone GIT_PROTOCOL://git@GIT_HOSTNAME:$GIT_PORT/env-shared \ + shared-deleteme --branch=$branch + + mv -v ~/.rc_shared ~/.bin_shared ~/TRASH/ + + mv -v shared-deleteme/rc_shared.sh ~/.rc_shared + mv -v shared-deleteme/bin_shared ~/.bin_shared + + mv -v +} + +echo "Shared RC Config - Complete!" From 3f4d3363afb5c09845e58a85d8c6e2f1fc5b735f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:24:11 -0700 Subject: [PATCH 010/144] Finish the script for the shared config to update itself. Add aliases. --- rc_shared.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index c80db94..b7f1bde 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -21,7 +21,10 @@ function update-shared { mv -v shared-deleteme/rc_shared.sh ~/.rc_shared mv -v shared-deleteme/bin_shared ~/.bin_shared - mv -v + mv -v shared-deleteme ~/TRASH/shared-deleteme-`date "+%Y%m%d-%H%M%S"` } +alias shared-update="update-shared" +alias reload-shared="update-shared" +alias shared-reload="update-shared" echo "Shared RC Config - Complete!" From bbf7bd560646d4e1f2fb21dd6ca6d979fdf40295 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:25:55 -0700 Subject: [PATCH 011/144] Add comments to script. --- rc_shared.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index b7f1bde..9f9b8c3 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -3,10 +3,22 @@ echo "Shared RC Config - Loading..." + +## Variables ## + +# Environment Usability export PATH="$PATH:~/bin-shared:~/.bin-shared" + +## Aliases ## + +# Bin Scripts alias send-master="send_master.sh" + +## Functions ## + +# Related specifically to this project. function update-shared { branch="$1" if [[ -z "$branch" ]]; then @@ -27,4 +39,13 @@ alias shared-update="update-shared" alias reload-shared="update-shared" alias shared-reload="update-shared" +# Shortcuts + +# Audio + +# Video + + +## Complete! ## + echo "Shared RC Config - Complete!" From 9f6c7834d80c22cb6025da970ae5e404b517877b Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 23 Mar 2026 12:31:42 -0700 Subject: [PATCH 012/144] Add comments and TBD's. --- bin-shared/send_master.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index f25969a..c50c421 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -3,15 +3,30 @@ # TBD: # - ensure all SERVER_* variables actually exist in environment # - test the script :) +# - add parameter to set loop=true + +## Variables ## DIR="$(dirname -- "${BASH_SOURCE[0]}")" +loop=false + +## Validations ## if [[ "$DIR" != *"MASTER" ]]; then echo "This directory is not labeled as a MASTER. Skipping upload." exit 0 fi +## Main ## + new_dir="`basename $DIR`" new_dir="${new_dir//MASTER/clone}" -clone -e "ssh -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_NAME:$SERVER_SFTP/$new_dir +do + clone -e "ssh -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_NAME:$SERVER_SFTP/$new_dir +while $loop + +## Complete ## + +echo "Done!" +exit 0 From c5d13862110ae879f2dabe217fe1e3e25889e17c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 27 Mar 2026 17:06:48 -0700 Subject: [PATCH 013/144] Add another TODO to master sync script. --- bin-shared/send_master.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index c50c421..a244bcd 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -4,6 +4,7 @@ # - ensure all SERVER_* variables actually exist in environment # - test the script :) # - add parameter to set loop=true +# - allow passing the script a variable for the dir, rather than assuming curr ## Variables ## From 9c9de6f96f092f2572182f84bdba63dcd9f591d7 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 27 Mar 2026 17:07:24 -0700 Subject: [PATCH 014/144] Add function which syncs all the MASTER catalogs in the current directory. --- rc_shared.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 9f9b8c3..131bce4 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -12,13 +12,11 @@ export PATH="$PATH:~/bin-shared:~/.bin-shared" ## Aliases ## -# Bin Scripts -alias send-master="send_master.sh" - ## Functions ## # Related specifically to this project. + function update-shared { branch="$1" if [[ -z "$branch" ]]; then @@ -41,6 +39,19 @@ alias shared-reload="update-shared" # Shortcuts +function send-master { send_master.sh; } + +# Enhance Bin Scripts + +function send-masters { + ls | grep MASTER | while read dir; do + echo "Preparing to sync '$dir' to '$SERVER_NAME'." + cd $dir + send-master + cd .. + done +} + # Audio # Video From b94a3e4a0b277ac78e4978daabaf8a2a62a801d8 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 27 Mar 2026 17:09:42 -0700 Subject: [PATCH 015/144] Add an explicit bye since goodbye does not seem to be working still? --- rc_shared.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/rc_shared.sh b/rc_shared.sh index 131bce4..31e1217 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -40,6 +40,7 @@ alias shared-reload="update-shared" # Shortcuts function send-master { send_master.sh; } +function goodbye { update -y; bye; } # Enhance Bin Scripts From e815803630e375257a7a2d9a601fdee9ea1cbce7 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 27 Mar 2026 18:34:20 -0700 Subject: [PATCH 016/144] Add dates to output. --- rc_shared.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 31e1217..4c131ef 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -1,7 +1,7 @@ # Notes: # - Please keep this file working for both BASH and ZSH. :) -echo "Shared RC Config - Loading..." +echo "`date` - Shared RC Config - Loading..." ## Variables ## @@ -60,4 +60,4 @@ function send-masters { ## Complete! ## -echo "Shared RC Config - Complete!" +echo "`date` - Shared RC Config - Complete!" From 6afd10b296dbe1df894034c2ae3f73ae09178c43 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 27 Mar 2026 18:35:26 -0700 Subject: [PATCH 017/144] Only show the output if not running as root. --- rc_shared.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 4c131ef..28db791 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -1,7 +1,8 @@ # Notes: # - Please keep this file working for both BASH and ZSH. :) -echo "`date` - Shared RC Config - Loading..." +[[ $(whoami) != "root" ]] && + echo "`date` - Shared RC Config - Loading..." ## Variables ## @@ -60,4 +61,5 @@ function send-masters { ## Complete! ## -echo "`date` - Shared RC Config - Complete!" +[[ $(whoami) != "root" ]] && + echo "`date` - Shared RC Config - Complete!" From 6ed7475c02fca645617ecb35cd86d83a27ca940e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 27 Mar 2026 18:40:11 -0700 Subject: [PATCH 018/144] Change command to use the proper variables which should now exist in each main env project. Add a sleep for the loop with conditional output. --- bin-shared/send_master.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index a244bcd..6a549f9 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash # TBD: -# - ensure all SERVER_* variables actually exist in environment # - test the script :) # - add parameter to set loop=true # - allow passing the script a variable for the dir, rather than assuming curr @@ -23,8 +22,15 @@ fi new_dir="`basename $DIR`" new_dir="${new_dir//MASTER/clone}" +sleep=0 do - clone -e "ssh -p $SERVER_PORT" ./ $SERVER_USER@$SERVER_NAME:$SERVER_SFTP/$new_dir + if (( $sleep > 0 )); then + echo "Sleeping for '$sleep' seconds..." + sleep $sleep + fi + #clone -e "ssh -p $PROD_DATA_PORT" ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir + echo "FORTEST - Here's the command: 'clone -e "ssh -p $PROD_DATA_PORT" ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir'" + sleep=30 while $loop ## Complete ## From 513c0d6faca3c220ccbc1d35c09f80e5e5e975bc Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 12:08:16 -0700 Subject: [PATCH 019/144] Add colors for PS1 prompts. --- rc_shared.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 28db791..eeaef81 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -10,6 +10,20 @@ # Environment Usability export PATH="$PATH:~/bin-shared:~/.bin-shared" +# PS1 Colors +PURPLE=`tput setaf 55` +ORANGE=`tput setaf 208` +GREEN=`tput setaf 34` + +RED=`tput setaf 196` +SCARLET=`tput setaf 160` +YELLOW=`tput setaf 226` + +GRAY=`tput setaf 243` + +RESET=`tput sgr0` +BOLD=`tput bold` + ## Aliases ## From 9d1141bf820d61b888065c634c7981750b1eb915 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 12:08:29 -0700 Subject: [PATCH 020/144] Fix output to be more helpful. --- bin-shared/send_master.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index 6a549f9..2edd254 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -13,7 +13,7 @@ loop=false ## Validations ## if [[ "$DIR" != *"MASTER" ]]; then - echo "This directory is not labeled as a MASTER. Skipping upload." + echo "'$DIR' is not labeled as a MASTER. Skipping upload." exit 0 fi From eb9eb03c1e1ca7c8e3ea129c3aed1db3abb0203d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 12:10:57 -0700 Subject: [PATCH 021/144] Remove start message. --- rc_shared.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index eeaef81..a2f9a5a 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -1,10 +1,6 @@ # Notes: # - Please keep this file working for both BASH and ZSH. :) -[[ $(whoami) != "root" ]] && - echo "`date` - Shared RC Config - Loading..." - - ## Variables ## # Environment Usability From 6d0840d4eb1122cf60f1199cf453b3db5e3b3327 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 12:15:17 -0700 Subject: [PATCH 022/144] Fix the DIR variable to be current directory, not program directory. --- bin-shared/send_master.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index 2edd254..bf1f2e0 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -7,9 +7,12 @@ ## Variables ## -DIR="$(dirname -- "${BASH_SOURCE[0]}")" +PROG="$(basename -- "${BASH_SOURCE[0]}")" loop=false +DIR="`pwd`" +dir="`basename $DIR`" + ## Validations ## if [[ "$DIR" != *"MASTER" ]]; then @@ -19,8 +22,7 @@ fi ## Main ## -new_dir="`basename $DIR`" -new_dir="${new_dir//MASTER/clone}" +new_dir="${dir//MASTER/clone}" sleep=0 do From 74fb1def7f051a25ae49aa995fbcbb4469a111f9 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 12:18:24 -0700 Subject: [PATCH 023/144] Fix the function to reload shared RC file. --- rc_shared.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index a2f9a5a..312b518 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -34,15 +34,14 @@ function update-shared { branch="dev" fi - git clone GIT_PROTOCOL://git@GIT_HOSTNAME:$GIT_PORT/env-shared \ - shared-deleteme --branch=$branch + dir="shared-rc-deleteme" - mv -v ~/.rc_shared ~/.bin_shared ~/TRASH/ + git clone https://git.hyperling.com/me/env-shared \ + $dir --branch=$branch - mv -v shared-deleteme/rc_shared.sh ~/.rc_shared - mv -v shared-deleteme/bin_shared ~/.bin_shared + mv -v $dir/rc_shared.sh ~/.rc_shared - mv -v shared-deleteme ~/TRASH/shared-deleteme-`date "+%Y%m%d-%H%M%S"` + mv -v $dir ~/TRASH/"$dir-`date "+%Y%m%d-%H%M%S"`" } alias shared-update="update-shared" alias reload-shared="update-shared" From df8f7f31018086bfde9aa52e18a2d0b75a09f9c6 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 12:19:25 -0700 Subject: [PATCH 024/144] Add output to rc shared updater. --- rc_shared.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 312b518..bf62b62 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -29,6 +29,7 @@ BOLD=`tput bold` # Related specifically to this project. function update-shared { + echo "Reloading the '~/.rc_shared' file from env-shared." branch="$1" if [[ -z "$branch" ]]; then branch="dev" @@ -42,6 +43,8 @@ function update-shared { mv -v $dir/rc_shared.sh ~/.rc_shared mv -v $dir ~/TRASH/"$dir-`date "+%Y%m%d-%H%M%S"`" + + echo "Complete! Please note this does NOT update bin files." } alias shared-update="update-shared" alias reload-shared="update-shared" From f34e02c6414d85975288552fdbf32124c974e978 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 12:20:14 -0700 Subject: [PATCH 025/144] Ensure colors are exported! --- rc_shared.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index bf62b62..4065408 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -7,18 +7,18 @@ export PATH="$PATH:~/bin-shared:~/.bin-shared" # PS1 Colors -PURPLE=`tput setaf 55` -ORANGE=`tput setaf 208` -GREEN=`tput setaf 34` +export PURPLE=`tput setaf 55` +export ORANGE=`tput setaf 208` +export GREEN=`tput setaf 34` -RED=`tput setaf 196` -SCARLET=`tput setaf 160` -YELLOW=`tput setaf 226` +export RED=`tput setaf 196` +export SCARLET=`tput setaf 160` +export YELLOW=`tput setaf 226` -GRAY=`tput setaf 243` +export GRAY=`tput setaf 243` -RESET=`tput sgr0` -BOLD=`tput bold` +export RESET=`tput sgr0` +export BOLD=`tput bold` ## Aliases ## From 890c991f18e94979ad34a181e2be2614c8f21957 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 12:22:41 -0700 Subject: [PATCH 026/144] Use log rather than echo. Add quotes on color assignments. --- rc_shared.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 4065408..b1e8b5c 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -7,18 +7,18 @@ export PATH="$PATH:~/bin-shared:~/.bin-shared" # PS1 Colors -export PURPLE=`tput setaf 55` -export ORANGE=`tput setaf 208` -export GREEN=`tput setaf 34` +export PURPLE="`tput setaf 55`" +export ORANGE="`tput setaf 208"` +export GREEN="`tput setaf 34`" -export RED=`tput setaf 196` -export SCARLET=`tput setaf 160` -export YELLOW=`tput setaf 226` +export RED="`tput setaf 196`" +export SCARLET="`tput setaf 16"0` +export YELLOW="`tput setaf 226"` -export GRAY=`tput setaf 243` +export GRAY="`tput setaf 243`" -export RESET=`tput sgr0` -export BOLD=`tput bold` +export RESET="`tput sgr0`" +export BOLD="`tput bold`" ## Aliases ## @@ -29,7 +29,7 @@ export BOLD=`tput bold` # Related specifically to this project. function update-shared { - echo "Reloading the '~/.rc_shared' file from env-shared." + log "Reloading the '~/.rc_shared' file from env-shared.\n" branch="$1" if [[ -z "$branch" ]]; then branch="dev" @@ -44,7 +44,7 @@ function update-shared { mv -v $dir ~/TRASH/"$dir-`date "+%Y%m%d-%H%M%S"`" - echo "Complete! Please note this does NOT update bin files." + blog "Complete! Please note this does NOT update bin files." } alias shared-update="update-shared" alias reload-shared="update-shared" From bef7091063144777539a411b0bacb3f2308dbaab Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 12:25:04 -0700 Subject: [PATCH 027/144] Fix output for updater. --- rc_shared.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index b1e8b5c..b52f895 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -29,7 +29,7 @@ export BOLD="`tput bold`" # Related specifically to this project. function update-shared { - log "Reloading the '~/.rc_shared' file from env-shared.\n" + log "`date` - Reloading the '~/.rc_shared' file from env-shared.\n" branch="$1" if [[ -z "$branch" ]]; then branch="dev" @@ -44,7 +44,7 @@ function update-shared { mv -v $dir ~/TRASH/"$dir-`date "+%Y%m%d-%H%M%S"`" - blog "Complete! Please note this does NOT update bin files." + log "\n`date` - Complete! Please note this does NOT update bin files." } alias shared-update="update-shared" alias reload-shared="update-shared" From 0e193d430b056f57a32e016e4c9d5911f6debe7f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 12:54:19 -0700 Subject: [PATCH 028/144] Fix misquotes. --- rc_shared.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index b52f895..aaab80b 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -8,12 +8,12 @@ export PATH="$PATH:~/bin-shared:~/.bin-shared" # PS1 Colors export PURPLE="`tput setaf 55`" -export ORANGE="`tput setaf 208"` +export ORANGE="`tput setaf 208`" export GREEN="`tput setaf 34`" export RED="`tput setaf 196`" -export SCARLET="`tput setaf 16"0` -export YELLOW="`tput setaf 226"` +export SCARLET="`tput setaf 160`" +export YELLOW="`tput setaf 226`" export GRAY="`tput setaf 243`" From 7ff5431e836bde9332df332e07566910a19f73c7 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 13:27:01 -0700 Subject: [PATCH 029/144] Change do-while to while. --- bin-shared/send_master.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index bf1f2e0..001c01f 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -25,7 +25,7 @@ fi new_dir="${dir//MASTER/clone}" sleep=0 -do +while true; do if (( $sleep > 0 )); then echo "Sleeping for '$sleep' seconds..." sleep $sleep @@ -33,7 +33,10 @@ do #clone -e "ssh -p $PROD_DATA_PORT" ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir echo "FORTEST - Here's the command: 'clone -e "ssh -p $PROD_DATA_PORT" ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir'" sleep=30 -while $loop + if [[ "$loop" == false ]]; + break; + fi +done ## Complete ## From bb542d1d2f3ee0a3cba332f4534c1dbde1952dec Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 13:29:34 -0700 Subject: [PATCH 030/144] Further fix the while loop. --- bin-shared/send_master.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index 001c01f..d922f19 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -31,9 +31,9 @@ while true; do sleep $sleep fi #clone -e "ssh -p $PROD_DATA_PORT" ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir - echo "FORTEST - Here's the command: 'clone -e "ssh -p $PROD_DATA_PORT" ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir'" + echo "FORTEST - Here's the command: 'clone -e 'ssh -p $PROD_DATA_PORT' ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir'" sleep=30 - if [[ "$loop" == false ]]; + if [[ "$loop" == false ]]; then break; fi done From 945563aa28e189fc6591f4cb4a17a5a6b903b4f7 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 13:30:44 -0700 Subject: [PATCH 031/144] Change double quotes to singles in clone command. --- bin-shared/send_master.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index d922f19..8afd7f3 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -30,7 +30,7 @@ while true; do echo "Sleeping for '$sleep' seconds..." sleep $sleep fi - #clone -e "ssh -p $PROD_DATA_PORT" ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir + #clone -e 'ssh -p $PROD_DATA_PORT' ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir echo "FORTEST - Here's the command: 'clone -e 'ssh -p $PROD_DATA_PORT' ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir'" sleep=30 if [[ "$loop" == false ]]; then From 90a94ec648d92a08b1b4d612b03a7174b92c3e74 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 13:34:38 -0700 Subject: [PATCH 032/144] Move clone and ls aliases to shared. --- rc_shared.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index aaab80b..ad7fb38 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -23,6 +23,17 @@ export BOLD="`tput bold`" ## Aliases ## +# Quickies +alias reload-bash="source ~/.bashrc" +alias bash-reload="reload-bash" +alias shell-reload="reload-bash" +alias reload-shell="reload-bash" +alias reload="reload-bash" + +alias l='ls ' +alias ll='ls -alh ' +alias lh='ls -ash ' + ## Functions ## @@ -54,6 +65,9 @@ alias shared-reload="update-shared" function send-master { send_master.sh; } function goodbye { update -y; bye; } +function clone { + rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build' $1 $2 $3 $4 $5 +} # Enhance Bin Scripts From c09e5560e65074ea42830e16247990904a5b4970 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 13:37:50 -0700 Subject: [PATCH 033/144] Change clone to use all-params ($@). --- rc_shared.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index ad7fb38..2f79799 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -65,9 +65,7 @@ alias shared-reload="update-shared" function send-master { send_master.sh; } function goodbye { update -y; bye; } -function clone { - rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build' $1 $2 $3 $4 $5 -} +function clone { rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build' $@; } # Enhance Bin Scripts From 9243bd54800ff31cf7a0e71e83e1203b9a283c62 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 13:44:40 -0700 Subject: [PATCH 034/144] Add exporting of functions needed for scripts. --- rc_shared.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 2f79799..598b3f5 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -65,7 +65,11 @@ alias shared-reload="update-shared" function send-master { send_master.sh; } function goodbye { update -y; bye; } -function clone { rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build' $@; } + +function clone { + rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build' $@ +} +export -f clone # Enhance Bin Scripts @@ -77,6 +81,7 @@ function send-masters { cd .. done } +export -f send-masters # Audio From 0a3b339921b004a3d8d6c3665676ee78b242c935 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 14:03:08 -0700 Subject: [PATCH 035/144] Finalize changes needed to get send-master to work!! Yay! --- bin-shared/send_master.sh | 11 ++++++++--- rc_shared.sh | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index 8afd7f3..8d3f6ab 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -24,14 +24,19 @@ fi new_dir="${dir//MASTER/clone}" +echo "`date` - Sending '$dir' to" \ + "'$PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_PORT$PROD_DATA_DIR/$new_dir'" + sleep=0 while true; do if (( $sleep > 0 )); then echo "Sleeping for '$sleep' seconds..." sleep $sleep fi - #clone -e 'ssh -p $PROD_DATA_PORT' ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir - echo "FORTEST - Here's the command: 'clone -e 'ssh -p $PROD_DATA_PORT' ./ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir'" + clone -e "ssh -p $PROD_DATA_PORT" ./ \ + $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir && + echo "`date` - Success!" || + echo "`date` - Failed!" sleep=30 if [[ "$loop" == false ]]; then break; @@ -40,5 +45,5 @@ done ## Complete ## -echo "Done!" +echo "`date` - $PROG complete." exit 0 diff --git a/rc_shared.sh b/rc_shared.sh index 598b3f5..845a260 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -67,7 +67,7 @@ function send-master { send_master.sh; } function goodbye { update -y; bye; } function clone { - rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build' $@ + rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build' "$@" } export -f clone From 4ef51915fbd8577a66191528053419e17da13035 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 14:03:52 -0700 Subject: [PATCH 036/144] Update TBD's. --- bin-shared/send_master.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index 8d3f6ab..d46d2e5 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash # TBD: -# - test the script :) -# - add parameter to set loop=true +# - add parameter to set loop=true, and accept a value for sleep seconds # - allow passing the script a variable for the dir, rather than assuming curr ## Variables ## From ae556e03e819a710160069f5e4c6d613f4e55eff Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 14:10:03 -0700 Subject: [PATCH 037/144] Enhance output of sending all masters. --- rc_shared.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 845a260..ab303bb 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -74,12 +74,14 @@ export -f clone # Enhance Bin Scripts function send-masters { + echo -e "`date` - Looping through MASTER directories.\n" ls | grep MASTER | while read dir; do - echo "Preparing to sync '$dir' to '$SERVER_NAME'." + echo -e "`date` - Found '$dir'..." cd $dir send-master cd .. done + echo -e "\n`date` - Done checking for MASTER directories." } export -f send-masters From fb36a5f11b8b80ab8d047094008098be76058cb5 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 14:17:06 -0700 Subject: [PATCH 038/144] Bring some of the video processing functions to from Termux to Shared for desktop usage! --- rc_shared.sh | 238 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 230 insertions(+), 8 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index ab303bb..cf1c893 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -3,10 +3,12 @@ ## Variables ## -# Environment Usability +# Environment Usability # + export PATH="$PATH:~/bin-shared:~/.bin-shared" -# PS1 Colors +# PS1 Colors # + export PURPLE="`tput setaf 55`" export ORANGE="`tput setaf 208`" export GREEN="`tput setaf 34`" @@ -23,7 +25,8 @@ export BOLD="`tput bold`" ## Aliases ## -# Quickies +# Quickies # + alias reload-bash="source ~/.bashrc" alias bash-reload="reload-bash" alias shell-reload="reload-bash" @@ -37,7 +40,7 @@ alias lh='ls -ash ' ## Functions ## -# Related specifically to this project. +# Related specifically to this project. # function update-shared { log "`date` - Reloading the '~/.rc_shared' file from env-shared.\n" @@ -61,7 +64,7 @@ alias shared-update="update-shared" alias reload-shared="update-shared" alias shared-reload="update-shared" -# Shortcuts +# Shortcuts # function send-master { send_master.sh; } function goodbye { update -y; bye; } @@ -71,7 +74,7 @@ function clone { } export -f clone -# Enhance Bin Scripts +# Enhance Bin Scripts # function send-masters { echo -e "`date` - Looping through MASTER directories.\n" @@ -85,9 +88,228 @@ function send-masters { } export -f send-masters -# Audio +# Audio # -# Video +# Video # + +# Optimize the bitrate and audio levels for an edited video. +function process-video-usage { + echo "USAGE: process-video oldFile newFile [videoBitrate] [audioBitrate] [sizeRating] [numPasses] [forceBitrate]" + echo -n "Purpose: Call ffmpeg with preferred video posting settings. " + echo -n "Bitrates default to 2000k and 192k, size is 720, passes is 1, and force is N." + echo "These work well on Odysee and are fairly small as backups." + echo "Examples:" + echo "- Create a small file for quick streaming." + echo " process-video youcut.mp4 20240210.mp4 1200k 128k 480" + echo "- Create a larger file for something like YouTube." + echo " process-video youcut.mp4 20240210_1080p.mp4 5000k 256k 1080" +} +function process-video { + # Parameters + file="$1" + newfile="$2" + video="$3" + audio="$4" + size="$5" + passes="$6" + force="$7" + + # Validations + if [[ -z $file || ! -e $file ]]; then + echo "ERROR: Original file '$file' does not exist." >&2 + process-video-usage + return 1 + fi + + if [[ -z $newfile ]]; then + echo "ERROR: New file's name must be provided." >&2 + process-video-usage + return 1 + elif [[ -e $newfile ]]; then + echo "ERROR: New file '$newfile' already exists." >&2 + du -h "$newfile" + process-video-usage + return 1 + fi + + echo "`date` - Converting '$file' to '$newfile'." + + if [[ -z $video ]]; then + video="2000k" + fi + if [[ $force == "Y" ]]; then + video="-b:v $video" + else + video="-b:v $video -minrate 0 -maxrate $video -bufsize $video" + fi + + if [[ -z $audio ]]; then + audio="192k" + fi + audio="-b:a $audio" + + if [[ -z $size ]]; then + size="720" + fi + size="-filter:v scale=-1:$size" + + if [[ -z $passes ]]; then + passes=1 + fi + pass="" + if [[ $passes != 1 ]]; then + passes=2 + pass="-pass 2" + fi + + ## Main ## + # More information on two-pass processing with ffmpeg + # https://cinelerra-gg.org/download/CinelerraGG_Manual/Two_pass_Encoding_with_FFmp.html + if [[ $passes == 2 ]]; then + set -x + ffmpeg -nostdin -hide_banner -loglevel quiet \ + -i "$file" $size $video $audio \ + -filter:a "dynaudnorm=f=33:g=65:p=0.66:m=33.3" \ + -vcodec libx264 -movflags +faststart \ + -pass 1 -f mp4 /dev/null -y + status=$? + set +x + echo "`date` - Done with the first pass." + if [[ $status != 0 ]]; then + echo "Received unsuccessful status, exiting." + return 1 + fi + fi + + set -x && + ffmpeg -nostdin -hide_banner -loglevel quiet \ + -i "$file" $size $video $audio \ + -filter:a "dynaudnorm=f=33:g=65:p=0.66:m=33.3" \ + -vcodec libx264 -movflags +faststart \ + $pass "$newfile" + status="$?" + set +x + echo "`date` - Done with the final pass." + + if [[ $passes == 2 && $status == 0 ]]; then + mv -v ffmpeg2pass*.log* ~/TRASH/ + fi + + sync + sleep 10 + sync + if [[ -s $newfile ]]; then + echo "`date` - Getting file sizes." + du -h "$file" + du -h "$newfile" + else + echo "ERROR: New file not created or has a 0 size." >&2 + fi + + echo -e "\n`date` - Finished with status '$status'." + return $status +} +alias pv="process-video" +alias qpv="pv ./raw/YouCut*.mp4 `basename $(pwd)`.mp4" + +# Allow converting video to audio and other smaller +# tasks than what process-video is intended to do. +function basic-process-usage { + echo "basic-process INPUT OUTPUT NORMALIZE [EXTRA]" + echo -n "Pass a file through ffmpeg with the option" + echo "to easily normalize the audio with a Y." + echo "Examples:" + echo "- Normalize audio on a video." + echo " basic-process video.mp4 normalized.mp4 Y" + echo "- Convert a video to audio at 192k." + echo " basic-process video.mp4 audio.mp3 N '-b:a 192k'" +} +function basic-process { + # Parameters + input="$1" + output="$2" + typeset -u normalize + normalize="$3" + extra="$4" + + echo "`date` - Starting basic-process" + + # Validations + if [[ -z $input || ! -e $input ]]; then + echo "ERROR: Input file '$input' does not exist." >&2 + basic-process-usage + return 1 + fi + + if [[ -z $output ]]; then + echo "ERROR: Output file's name must be provided." >&2 + basic-process-usage + return 1 + elif [[ -e $output ]]; then + echo "ERROR: Output file '$output' already exists." >&2 + du -h "$output" + basic-process-usage + return 1 + fi + + if [[ $normalize == "Y" ]]; then + echo "Normalize set to TRUE." + normal="-filter:a dynaudnorm=f=33:g=65:p=0.66:m=33.3" + else + echo "No audio normalization is being done." + fi + + # Main + echo "`date` - Converting '$input' to '$output'." + set -x + ffmpeg -nostdin -hide_banner -loglevel quiet \ + -i "$input" $extra $normal "$output" + status=$? + set +x + + if [[ $status != 0 ]]; then + echo "`date` - WARNING: ffmpeg exited with status '$status'." >&2 + fi + + # Finish + if [[ ! -s $output ]]; then + echo "`date` - ERROR: Output '$output' not created or has 0 size." >&2 + return 1 + fi + + sync + echo "`date` - '$output' has been created successfully." + sleep 3 + du -h "$input" + du -h "$output" + + echo "`date` - Finished basic-process" + return 0 +} +alias bp="basic-process" +alias bv="bp" + +# Function to automatically append the Y. +function fix-audio { basic-process "$1" "$2" Y; } +function eq { fix-audio "$1" "$2"; } + +# Function to easily turn a video to audio without typing the audio name. +function convert-to-audio { + video="$1" + audio="$2" + if [[ -z "$2" || "$2" == "Y" ]]; then + audio="${1//mp4/mp3}" + fi + volume="" + if [[ ( "$2" == "Y" && -z "$3" ) || "$3" == "Y" ]]; then + $volume="Y" + fi + basic-process "$video" "$audio" $volume +} +alias v2a="convert-to-audio" +alias vta="v2a" +alias pull-audio="v2a" +alias pa="v2a" ## Complete! ## From c58496e6a665da7ce2da622cf8984cc3ca0fc2b9 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 14:18:57 -0700 Subject: [PATCH 039/144] Move scan to be in shared env. --- rc_shared.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index cf1c893..1b86362 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -37,6 +37,10 @@ alias l='ls ' alias ll='ls -alh ' alias lh='ls -ash ' +# Networking # + +alias scan="nmap -A -p- --script=vuln " + ## Functions ## From 50e06f919682e00e1069737a24f4c6564568d14f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 14:24:34 -0700 Subject: [PATCH 040/144] Move `now` and `today` to shared env. Export all functions. --- rc_shared.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 1b86362..27b87b6 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -76,7 +76,9 @@ function goodbye { update -y; bye; } function clone { rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build' "$@" } -export -f clone + +function now { date "+%Y%m%d-%H%M%S"; } +function today { date "+%Y%m%d"; } # Enhance Bin Scripts # @@ -90,7 +92,6 @@ function send-masters { done echo -e "\n`date` - Done checking for MASTER directories." } -export -f send-masters # Audio # @@ -315,6 +316,9 @@ alias vta="v2a" alias pull-audio="v2a" alias pa="v2a" +# Export all functions! # +eval "$(declare -F | sed 's/-f /-fx /')" + ## Complete! ## From cbacd3db509745b5043fe34a319c257593b81efa Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 14:41:27 -0700 Subject: [PATCH 041/144] Only export functions without underscores. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 27b87b6..845c05c 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -317,7 +317,7 @@ alias pull-audio="v2a" alias pa="v2a" # Export all functions! # -eval "$(declare -F | sed 's/-f /-fx /')" +eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" ## Complete! ## From d0b8afa2fb86cd1bd55c4b34a9c4a013143fbd36 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 15:09:20 -0700 Subject: [PATCH 042/144] Add vimrc file. --- vimrc-shared.vim | 1 + 1 file changed, 1 insertion(+) create mode 100644 vimrc-shared.vim diff --git a/vimrc-shared.vim b/vimrc-shared.vim new file mode 100644 index 0000000..2b7dcb2 --- /dev/null +++ b/vimrc-shared.vim @@ -0,0 +1 @@ +TBD! \ No newline at end of file From 24047f4fbbec9b74dbee32db5a643e2813df26fc Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 15:11:20 -0700 Subject: [PATCH 043/144] Add code for qq in Vim. --- vimrc-shared.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimrc-shared.vim b/vimrc-shared.vim index 2b7dcb2..8e69006 100644 --- a/vimrc-shared.vim +++ b/vimrc-shared.vim @@ -1 +1 @@ -TBD! \ No newline at end of file +nnoremap qq :qa! \ No newline at end of file From c27aed102b2559e38e1dd377171d96efb6b6dcb8 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 15:13:00 -0700 Subject: [PATCH 044/144] Rename file to just be a generic vimrc. --- vimrc-shared.vim => vimrc.vim | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename vimrc-shared.vim => vimrc.vim (100%) diff --git a/vimrc-shared.vim b/vimrc.vim similarity index 100% rename from vimrc-shared.vim rename to vimrc.vim From 1cc57721f74830b9104f219cdb909f7e0d1b4428 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 28 Mar 2026 16:25:19 -0700 Subject: [PATCH 045/144] Add full set of vimrc commands from Ansible. --- vimrc.vim | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/vimrc.vim b/vimrc.vim index 8e69006..745f841 100644 --- a/vimrc.vim +++ b/vimrc.vim @@ -1 +1,11 @@ -nnoremap qq :qa! \ No newline at end of file +" Turn off syntax, flashy lights, etc. Make VIM into a basic editor. +syntax off +set nohlsearch +set noautoindent noautowrite noshowmatch wrapmargin=0 report=1 ts=3 +set ignorecase + +" Turn off auto-commenting. +autocmd Filetype * set fo-=c fo-=r fo-=o + +" qq shortcut for immediately exiting all files without saving. +nnoremap qq :qa! From 7dcf55629d9509a9018d44bd4556852792699ee7 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 29 Mar 2026 16:57:03 -0700 Subject: [PATCH 046/144] Add script to pull clones easily. --- bin-shared/pull-clone.sh | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 bin-shared/pull-clone.sh diff --git a/bin-shared/pull-clone.sh b/bin-shared/pull-clone.sh new file mode 100755 index 0000000..c8aad48 --- /dev/null +++ b/bin-shared/pull-clone.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +# TBD: +# - merge into send-master script and use a variable to control push vs pull. + +## Variables ## + +PROG="$(basename -- "${BASH_SOURCE[0]}")" +loop=false + +DIR="`pwd`" +dir="`basename $DIR`" + +## Validations ## + +if [[ "$DIR" != *"-clone" ]]; then + echo "'$DIR' is not labeled as a clone. Skipping download." + exit 0 +fi + +## Main ## + +echo "`date` - Pulling" \ + "'$PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_PORT$PROD_DATA_DIR/$dir'" \ + "to '$dir'." + +sleep=0 +while true; do + if (( $sleep > 0 )); then + echo "Sleeping for '$sleep' seconds..." + sleep $sleep + fi + clone -e "ssh -p $PROD_DATA_PORT" \ + $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir \ + . && + echo "`date` - Success!" || + echo "`date` - Failed!" + sleep=30 + if [[ "$loop" == false ]]; then + break; + fi +done + +## Complete ## + +echo "`date` - $PROG complete." +exit 0 From e6bc85e7615b14c40418000368f6e3c25d7111c0 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 29 Mar 2026 16:58:36 -0700 Subject: [PATCH 047/144] Add functions for pulling clones. Also add a dash to MASTER check. --- rc_shared.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 845c05c..359aade 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -71,6 +71,8 @@ alias shared-reload="update-shared" # Shortcuts # function send-master { send_master.sh; } +function pull-clone { pull_clone.sh; } + function goodbye { update -y; bye; } function clone { @@ -84,7 +86,7 @@ function today { date "+%Y%m%d"; } function send-masters { echo -e "`date` - Looping through MASTER directories.\n" - ls | grep MASTER | while read dir; do + ls | grep '-MASTER' | while read dir; do echo -e "`date` - Found '$dir'..." cd $dir send-master @@ -93,6 +95,17 @@ function send-masters { echo -e "\n`date` - Done checking for MASTER directories." } +function pull-clones { + echo -e "`date` - Looping through clone directories.\n" + ls | grep '-clone' | while read dir; do + echo -e "`date` - Found '$dir'..." + cd $dir + send-master + cd .. + done + echo -e "\n`date` - Done checking for clone directories." +} + # Audio # # Video # From 6f8074d56bfb28b8b7fd8e957ce1bb3722d9060a Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 29 Mar 2026 16:59:32 -0700 Subject: [PATCH 048/144] Add dash to MASTER, so things like SPACEMASTER would not get considered. --- bin-shared/send_master.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index d46d2e5..4fbc53a 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -14,7 +14,7 @@ dir="`basename $DIR`" ## Validations ## -if [[ "$DIR" != *"MASTER" ]]; then +if [[ "$DIR" != *"-MASTER" ]]; then echo "'$DIR' is not labeled as a MASTER. Skipping upload." exit 0 fi From 40b53ce8a74e67509cf811477d310c3f1be28a1c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 29 Mar 2026 17:30:13 -0700 Subject: [PATCH 049/144] Fix filename to properly have an underscore. --- bin-shared/{pull-clone.sh => pull_clone.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename bin-shared/{pull-clone.sh => pull_clone.sh} (100%) diff --git a/bin-shared/pull-clone.sh b/bin-shared/pull_clone.sh similarity index 100% rename from bin-shared/pull-clone.sh rename to bin-shared/pull_clone.sh From 076641fc9de1f364e14a05d13fe98c138075a7b1 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 29 Mar 2026 17:30:46 -0700 Subject: [PATCH 050/144] Fix pull-clones to use pull-clone. ;) --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 359aade..521e358 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -100,7 +100,7 @@ function pull-clones { ls | grep '-clone' | while read dir; do echo -e "`date` - Found '$dir'..." cd $dir - send-master + pull-clone cd .. done echo -e "\n`date` - Done checking for clone directories." From f8c8036e5fe11f1cd4e0c952fbae49683611980d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 29 Mar 2026 17:54:39 -0700 Subject: [PATCH 051/144] Fix the remote directory name for pulling. --- bin-shared/pull_clone.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin-shared/pull_clone.sh b/bin-shared/pull_clone.sh index c8aad48..f196e57 100755 --- a/bin-shared/pull_clone.sh +++ b/bin-shared/pull_clone.sh @@ -31,7 +31,7 @@ while true; do sleep $sleep fi clone -e "ssh -p $PROD_DATA_PORT" \ - $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$new_dir \ + $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$dir/ \ . && echo "`date` - Success!" || echo "`date` - Failed!" From 3399b0703104b05ef5f44f41125dc4778af78445 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 29 Mar 2026 17:57:34 -0700 Subject: [PATCH 052/144] The dashes need escaped even though they are quoted. --- rc_shared.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 521e358..35fbdcd 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -86,7 +86,7 @@ function today { date "+%Y%m%d"; } function send-masters { echo -e "`date` - Looping through MASTER directories.\n" - ls | grep '-MASTER' | while read dir; do + ls | grep '\-MASTER' | while read dir; do echo -e "`date` - Found '$dir'..." cd $dir send-master @@ -97,7 +97,7 @@ function send-masters { function pull-clones { echo -e "`date` - Looping through clone directories.\n" - ls | grep '-clone' | while read dir; do + ls | grep '\-clone' | while read dir; do echo -e "`date` - Found '$dir'..." cd $dir pull-clone From 588007fe3735b2b1f2480096213f9cb57e40c6ad Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 30 Mar 2026 10:43:03 -0700 Subject: [PATCH 053/144] Change pull script to only do subdirectories in music. --- bin-shared/pull_clone.sh | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/bin-shared/pull_clone.sh b/bin-shared/pull_clone.sh index f196e57..756284c 100755 --- a/bin-shared/pull_clone.sh +++ b/bin-shared/pull_clone.sh @@ -18,6 +18,12 @@ if [[ "$DIR" != *"-clone" ]]; then exit 0 fi +# Only pull the existing subdirectories rather than ALL content. +subdirs_only="false" +if [[ "$dir" == "music-clone" ]]; then + subdirs_only="true" +fi + ## Main ## echo "`date` - Pulling" \ @@ -30,11 +36,23 @@ while true; do echo "Sleeping for '$sleep' seconds..." sleep $sleep fi - clone -e "ssh -p $PROD_DATA_PORT" \ - $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$dir/ \ - . && - echo "`date` - Success!" || - echo "`date` - Failed!" + + if [[ "$subdirs_only" == "true" ]]; then + ls $DIR | while read subdir; do + clone -e "ssh -p $PROD_DATA_PORT" \ + $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$dir/$subdir/ \ + ./$subdir && + echo "`date` - Success!" || + echo "`date` - Failed!" + done + else + clone -e "ssh -p $PROD_DATA_PORT" \ + $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$dir/ \ + . && + echo "`date` - Success!" || + echo "`date` - Failed!" + fi + sleep=30 if [[ "$loop" == false ]]; then break; From ef097e973e4cd09d3fb35848128f13940db52491 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 30 Mar 2026 11:16:59 -0700 Subject: [PATCH 054/144] Change where the newline is so each MASTER is in its own log section. --- rc_shared.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 35fbdcd..363d058 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -85,9 +85,9 @@ function today { date "+%Y%m%d"; } # Enhance Bin Scripts # function send-masters { - echo -e "`date` - Looping through MASTER directories.\n" + echo -e "`date` - Looping through MASTER directories." ls | grep '\-MASTER' | while read dir; do - echo -e "`date` - Found '$dir'..." + echo -e "\n`date` - Found '$dir'..." cd $dir send-master cd .. From 5351df572b51097bf0feca476428cb85353f5b4e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 30 Mar 2026 11:25:11 -0700 Subject: [PATCH 055/144] Change where the newline is so each clone is in its own log section. --- rc_shared.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 363d058..f65be72 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -96,9 +96,9 @@ function send-masters { } function pull-clones { - echo -e "`date` - Looping through clone directories.\n" + echo -e "`date` - Looping through clone directories." ls | grep '\-clone' | while read dir; do - echo -e "`date` - Found '$dir'..." + echo -e "\n`date` - Found '$dir'..." cd $dir pull-clone cd .. From be0469fb942abcf2a9248eb765dc9460c4580494 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 30 Mar 2026 13:33:01 -0700 Subject: [PATCH 056/144] Enhance logging for subdir datasets. --- bin-shared/pull_clone.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin-shared/pull_clone.sh b/bin-shared/pull_clone.sh index 756284c..db02cb7 100755 --- a/bin-shared/pull_clone.sh +++ b/bin-shared/pull_clone.sh @@ -39,6 +39,7 @@ while true; do if [[ "$subdirs_only" == "true" ]]; then ls $DIR | while read subdir; do + echo -e "\n`date` - Working subdirectory '$subdir'..." clone -e "ssh -p $PROD_DATA_PORT" \ $PROD_DATA_USER@$PROD_DATA_HOST:$PROD_DATA_DIR/$dir/$subdir/ \ ./$subdir && @@ -61,5 +62,5 @@ done ## Complete ## -echo "`date` - $PROG complete." +echo -e "\n`date` - $PROG complete." exit 0 From c859b4dcd8b0b8c3de9b4d636826b1f3d1fea211 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 31 Mar 2026 17:54:22 -0700 Subject: [PATCH 057/144] Process folders named as SYNC as both a MASTER and CLONE. --- bin-shared/pull_clone.sh | 4 ++-- bin-shared/send_master.sh | 4 ++-- rc_shared.sh | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin-shared/pull_clone.sh b/bin-shared/pull_clone.sh index db02cb7..75e77e8 100755 --- a/bin-shared/pull_clone.sh +++ b/bin-shared/pull_clone.sh @@ -13,8 +13,8 @@ dir="`basename $DIR`" ## Validations ## -if [[ "$DIR" != *"-clone" ]]; then - echo "'$DIR' is not labeled as a clone. Skipping download." +if [[ "$DIR" != *"-clone" || "$DIR" != *"-SYNC" ]]; then + echo "'$DIR' is not labeled as a CLONE or SYNC. Skipping download." exit 0 fi diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index 4fbc53a..3d4e1a8 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -14,8 +14,8 @@ dir="`basename $DIR`" ## Validations ## -if [[ "$DIR" != *"-MASTER" ]]; then - echo "'$DIR' is not labeled as a MASTER. Skipping upload." +if [[ "$DIR" != *"-MASTER" || "$DIR" != *"-SYNC" ]]; then + echo "'$DIR' is not labeled as a MASTER or SYNC. Skipping upload." exit 0 fi diff --git a/rc_shared.sh b/rc_shared.sh index f65be72..44e22d9 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -85,25 +85,25 @@ function today { date "+%Y%m%d"; } # Enhance Bin Scripts # function send-masters { - echo -e "`date` - Looping through MASTER directories." - ls | grep '\-MASTER' | while read dir; do + echo -e "`date` - Looping through MASTER & SYNC directories." + ls | grep '\-MASTER\|\-SYNC' | while read dir; do echo -e "\n`date` - Found '$dir'..." cd $dir send-master cd .. done - echo -e "\n`date` - Done checking for MASTER directories." + echo -e "\n`date` - Done checking for MASTER & SYNC directories." } function pull-clones { - echo -e "`date` - Looping through clone directories." - ls | grep '\-clone' | while read dir; do + echo -e "`date` - Looping through clone & SYNC directories." + ls | grep "\-clone\|\-SYNC" | while read dir; do echo -e "\n`date` - Found '$dir'..." cd $dir pull-clone cd .. done - echo -e "\n`date` - Done checking for clone directories." + echo -e "\n`date` - Done checking for clone & SYNC directories." } # Audio # From bc81d1bedd2d14ec1cd96e22194a108e0d49337f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 31 Mar 2026 19:43:47 -0700 Subject: [PATCH 058/144] Add aliases for accidentally typed rewords of commands. --- rc_shared.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 44e22d9..a82c56a 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -71,7 +71,10 @@ alias shared-reload="update-shared" # Shortcuts # function send-master { send_master.sh; } +alias push-master="send-master" + function pull-clone { pull_clone.sh; } +alias get-clone="pull-clone" function goodbye { update -y; bye; } @@ -94,6 +97,7 @@ function send-masters { done echo -e "\n`date` - Done checking for MASTER & SYNC directories." } +alias push-masters="send-masters" function pull-clones { echo -e "`date` - Looping through clone & SYNC directories." @@ -105,6 +109,7 @@ function pull-clones { done echo -e "\n`date` - Done checking for clone & SYNC directories." } +alias get-clones="pull-clones" # Audio # From 3edd0628528867f3b78ca39b2920ad0f7bde4145 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 31 Mar 2026 19:44:34 -0700 Subject: [PATCH 059/144] Change single quotes to double so regex works. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index a82c56a..9de44c7 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -89,7 +89,7 @@ function today { date "+%Y%m%d"; } function send-masters { echo -e "`date` - Looping through MASTER & SYNC directories." - ls | grep '\-MASTER\|\-SYNC' | while read dir; do + ls | grep "\-MASTER\|\-SYNC" | while read dir; do echo -e "\n`date` - Found '$dir'..." cd $dir send-master From 89c0d0589c9490bace31a722e933c2675e89d91f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 31 Mar 2026 19:51:26 -0700 Subject: [PATCH 060/144] Fix OR's to be AND's for checking SYNC folders. --- bin-shared/pull_clone.sh | 2 +- bin-shared/send_master.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin-shared/pull_clone.sh b/bin-shared/pull_clone.sh index 75e77e8..9420325 100755 --- a/bin-shared/pull_clone.sh +++ b/bin-shared/pull_clone.sh @@ -13,7 +13,7 @@ dir="`basename $DIR`" ## Validations ## -if [[ "$DIR" != *"-clone" || "$DIR" != *"-SYNC" ]]; then +if [[ "$DIR" != *"-clone" && "$DIR" != *"-SYNC" ]]; then echo "'$DIR' is not labeled as a CLONE or SYNC. Skipping download." exit 0 fi diff --git a/bin-shared/send_master.sh b/bin-shared/send_master.sh index 3d4e1a8..f03bcdd 100755 --- a/bin-shared/send_master.sh +++ b/bin-shared/send_master.sh @@ -14,7 +14,7 @@ dir="`basename $DIR`" ## Validations ## -if [[ "$DIR" != *"-MASTER" || "$DIR" != *"-SYNC" ]]; then +if [[ "$DIR" != *"-MASTER" && "$DIR" != *"-SYNC" ]]; then echo "'$DIR' is not labeled as a MASTER or SYNC. Skipping upload." exit 0 fi From 0bfdc8d4113ce082c83f7d2f99fa4e9fff435d3d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 31 Mar 2026 19:58:23 -0700 Subject: [PATCH 061/144] Add shortcut to process the entire Clones collection. --- rc_shared.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 9de44c7..c7209f9 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -111,6 +111,10 @@ function pull-clones { } alias get-clones="pull-clones" +function sync-all { push-masters; pull-clones; } +alias sync-clones="sync-all" + + # Audio # # Video # From ec9b74d3d85a2f0172dbf04f1a60c563bb6cdfef Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 1 Apr 2026 08:22:01 -0700 Subject: [PATCH 062/144] Add aliases for push and pull called sync, both for individual folders as well as groups. --- rc_shared.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index c7209f9..6fc1c31 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -72,9 +72,11 @@ alias shared-reload="update-shared" function send-master { send_master.sh; } alias push-master="send-master" +alias sync-master="send-master" function pull-clone { pull_clone.sh; } alias get-clone="pull-clone" +alias sync-clone="pull-clone" function goodbye { update -y; bye; } @@ -98,6 +100,7 @@ function send-masters { echo -e "\n`date` - Done checking for MASTER & SYNC directories." } alias push-masters="send-masters" +alias sync-masters="send-masters" function pull-clones { echo -e "`date` - Looping through clone & SYNC directories." @@ -110,9 +113,9 @@ function pull-clones { echo -e "\n`date` - Done checking for clone & SYNC directories." } alias get-clones="pull-clones" +alias sync-clones="pull-clones" function sync-all { push-masters; pull-clones; } -alias sync-clones="sync-all" # Audio # From bdb06cd0b4f7aea3df307b4eae43b07b6f30ea02 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 1 Apr 2026 08:35:53 -0700 Subject: [PATCH 063/144] Split SYNC folders out to have their own commands -- for safety! :) --- rc_shared.sh | 60 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 6fc1c31..13f5e19 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -78,6 +78,18 @@ function pull-clone { pull_clone.sh; } alias get-clone="pull-clone" alias sync-clone="pull-clone" +alias send-sync="send-master" +alias push-sync="send-master" +alias pull-sync="pull-clone" +alias get-sync="pull-clone" +function sync-sync { + cat <<- EOF + Command not implemented, too dangerous guessing the state of the folder. + + Please use push-sync and pull-sync in the correct order for its current state. + EOF +} + function goodbye { update -y; bye; } function clone { @@ -89,34 +101,70 @@ function today { date "+%Y%m%d"; } # Enhance Bin Scripts # +# MASTER and CLONE folders. + function send-masters { - echo -e "`date` - Looping through MASTER & SYNC directories." - ls | grep "\-MASTER\|\-SYNC" | while read dir; do + echo -e "`date` - Looping through MASTER directories." + ls | grep "\-MASTER" | while read dir; do echo -e "\n`date` - Found '$dir'..." cd $dir send-master cd .. done - echo -e "\n`date` - Done checking for MASTER & SYNC directories." + echo -e "\n`date` - Done checking for MASTER directories." } alias push-masters="send-masters" alias sync-masters="send-masters" function pull-clones { - echo -e "`date` - Looping through clone & SYNC directories." - ls | grep "\-clone\|\-SYNC" | while read dir; do + echo -e "`date` - Looping through clone directories." + ls | grep "\-clone" | while read dir; do echo -e "\n`date` - Found '$dir'..." cd $dir pull-clone cd .. done - echo -e "\n`date` - Done checking for clone & SYNC directories." + echo -e "\n`date` - Done checking for clone directories." } alias get-clones="pull-clones" alias sync-clones="pull-clones" function sync-all { push-masters; pull-clones; } +# SYNC folders. + +function send-syncs { + echo -e "`date` - Looping through SYNC directories." + ls | grep "\-SYNC" | while read dir; do + echo -e "\n`date` - Found '$dir'..." + cd $dir + send-master + cd .. + done + echo -e "\n`date` - Done checking for SYNC directories." +} +alias push-syncs="send-syncs" + +function pull-syncs { + echo -e "`date` - Looping through SYNC directories." + ls | grep "\-SYNC" | while read dir; do + echo -e "\n`date` - Found '$dir'..." + cd $dir + pull-clone + cd .. + done + echo -e "\n`date` - Done checking for SYNC directories." +} +alias get-syncs="pull-syncs" + +function sync-syncs { + cat <<- EOF + Command not implemented, too dangerous guessing the state of the folder. + + Please use push-syncs and pull-syncs in the correct order for its current state. + EOF +} + # Audio # From 074f0a29bffc65f9a6cbafcf71b1dd29229f2498 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 1 Apr 2026 08:45:19 -0700 Subject: [PATCH 064/144] Explicitly note in sync-all that SYNC folders are not being handled. --- rc_shared.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 13f5e19..3ad42df 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -129,7 +129,18 @@ function pull-clones { alias get-clones="pull-clones" alias sync-clones="pull-clones" -function sync-all { push-masters; pull-clones; } +function sync-all { + push-masters + echo -e "\n" + pull-clones + + echo -e "\n`date` - Skipping SYNC folders! Please do their loads separately." + ls | grep "\-SYNC" | while read dir; do + echo "- $dir" + done + + echo -e "`date` - \nDone." +} # SYNC folders. From 7fa1430b34f973b47b2ffaaca0ccfcca3b7e32e0 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 10 Apr 2026 13:11:13 -0700 Subject: [PATCH 065/144] Move log functions to shared, --- rc_shared.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 3ad42df..3ecbc68 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -99,6 +99,13 @@ function clone { function now { date "+%Y%m%d-%H%M%S"; } function today { date "+%Y%m%d"; } +function log { + echo -e "$1" +} +function blog { + echo -e "\n\n$1\n\n" +} + # Enhance Bin Scripts # # MASTER and CLONE folders. @@ -141,6 +148,13 @@ function sync-all { echo -e "`date` - \nDone." } +function sync-all-loop { + while true; do + sync-all + echo -e "\n\n*** Sleeping... ***\n\n" + sleep 30 + done +} # SYNC folders. From 186519fb0ea8a7c2c53858ad77998bc180d5e76f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 10 Apr 2026 13:12:30 -0700 Subject: [PATCH 066/144] Minify log functions. --- rc_shared.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 3ecbc68..3af0bb0 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -99,12 +99,8 @@ function clone { function now { date "+%Y%m%d-%H%M%S"; } function today { date "+%Y%m%d"; } -function log { - echo -e "$1" -} -function blog { - echo -e "\n\n$1\n\n" -} +function log { echo -e "$1"; } +function blog { echo -e "\n\n$1\n\n"; } # Enhance Bin Scripts # From a87c205a807b1f7ceb55695656bec554adbf76f3 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 10 Apr 2026 18:08:45 -0700 Subject: [PATCH 067/144] Finish changes to reload-shared which adds scripts to the local bin. --- rc_shared.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 3af0bb0..a49ce5f 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -60,6 +60,21 @@ function update-shared { mv -v $dir/rc_shared.sh ~/.rc_shared + local_bin="$HOME/bin" + remote_bin="shared-rc-deleteme/bin-shared" + if [[ -d "$local_bin" ]]; then + log "\n`date` - Found '$local_bin', adding scripts.\n" + refactor_script="refactor_music_library.sh" + wget -O "$refactor_script" \ + https://git.hyperling.com/me/shell-music-refactor-library/src/branch/main/refactor_music_library.sh + mv -v $refactor_script "$local_bin"/ + + mv -v $remote_bin/*.sh "$local_bin"/ + else + echo "Did not find '$local_bin', did not copy scripts." + fi + + log "\n`date` - Done! Removing git clone.\n" mv -v $dir ~/TRASH/"$dir-`date "+%Y%m%d-%H%M%S"`" log "\n`date` - Complete! Please note this does NOT update bin files." From a76cb8b5ec5a9a2c4c89025468247e7928b97d4c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 10 Apr 2026 18:09:40 -0700 Subject: [PATCH 068/144] Change order in which the scripts are added; do the project's first, then the downloads. --- rc_shared.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index a49ce5f..fa8e9e5 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -64,12 +64,12 @@ function update-shared { remote_bin="shared-rc-deleteme/bin-shared" if [[ -d "$local_bin" ]]; then log "\n`date` - Found '$local_bin', adding scripts.\n" + mv -v $remote_bin/*.sh "$local_bin"/ + refactor_script="refactor_music_library.sh" wget -O "$refactor_script" \ https://git.hyperling.com/me/shell-music-refactor-library/src/branch/main/refactor_music_library.sh mv -v $refactor_script "$local_bin"/ - - mv -v $remote_bin/*.sh "$local_bin"/ else echo "Did not find '$local_bin', did not copy scripts." fi From 391b0a0b09b4a6b85a3c372f89274543db78766b Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 11 Apr 2026 09:31:45 -0700 Subject: [PATCH 069/144] Add even shorter aliases for sending and pushing clones, and also allow them to handle Git repos! --- rc_shared.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index fa8e9e5..568878f 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -117,6 +117,22 @@ function today { date "+%Y%m%d"; } function log { echo -e "$1"; } function blog { echo -e "\n\n$1\n\n"; } +function pull { + if [[ -d .git ]]; then + git pull --recurse-submodules + else + pull-clone + fi +} + +function push { + if [[ -d .git ]]; then + git push && load-stage && load-prod + else + send-master + fi +} + # Enhance Bin Scripts # # MASTER and CLONE folders. From 9d609568f78a17c0106271ce69c76eef046bad17 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 13 Apr 2026 14:06:49 -0700 Subject: [PATCH 070/144] Ensure bin files are executable. --- rc_shared.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 568878f..e0055bf 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -70,6 +70,8 @@ function update-shared { wget -O "$refactor_script" \ https://git.hyperling.com/me/shell-music-refactor-library/src/branch/main/refactor_music_library.sh mv -v $refactor_script "$local_bin"/ + + chmod 755 -Rv "$local_bin" else echo "Did not find '$local_bin', did not copy scripts." fi From 495a140805d6679c08f2ebd045c75024bfe16180 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 13 Apr 2026 19:13:06 -0700 Subject: [PATCH 071/144] Fix the newline to be after the output. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index e0055bf..6cce55f 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -175,7 +175,7 @@ function sync-all { echo "- $dir" done - echo -e "`date` - \nDone." + echo -e "`date` - Done.\n" } function sync-all-loop { while true; do From e2ec550fab164629076e38ccbdc42d3a7e81c40f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Apr 2026 08:39:20 -0700 Subject: [PATCH 072/144] Increase sleep timer for sync-all-loop and allow a custom time to be passed. --- rc_shared.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 6cce55f..48dc427 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -178,10 +178,18 @@ function sync-all { echo -e "`date` - Done.\n" } function sync-all-loop { + typeset -i sleep_time + if [[ "$1" ]]; then + sleep_time="$1" + fi + if [[ -z "$sleep_time" || "$sleep_time" == 0 ]]; then + sleep_time="300" + fi + log "`date` - Sleep timeer set for '$sleep_time' seconds." while true; do sync-all echo -e "\n\n*** Sleeping... ***\n\n" - sleep 30 + sleep 300 done } From 890bc05e4dafc6b2a1174ca8ca3c9aa16c73c69d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 17 Apr 2026 15:20:34 -0700 Subject: [PATCH 073/144] Add shortcuts to get to clones. --- rc_shared.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 48dc427..4b356ab 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -37,6 +37,17 @@ alias l='ls ' alias ll='ls -alh ' alias lh='ls -ash ' +function cl { + if [[ -d /sdcard ]]; then + cd /sdcard/Library/Clones + else + cd $HOME/Clones + fi +} +alias clones="cl" +alias cdl="cl" +alias cdc="cl" + # Networking # alias scan="nmap -A -p- --script=vuln " From 21b2ddf4a56a3486bab46fcdaf82d025447502b8 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 17 Apr 2026 15:34:42 -0700 Subject: [PATCH 074/144] Begin adding code for checking for updates upon terminal opening. --- rc_shared.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 4b356ab..cf63a94 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -96,6 +96,16 @@ alias shared-update="update-shared" alias reload-shared="update-shared" alias shared-reload="update-shared" +project="$HOME/.env-shared" +function update-shared2 { + if [[ ! -d $project ]]; then + + fi +} +if [[ -d $project ]]; then + git -C $project status +fi & + # Shortcuts # function send-master { send_master.sh; } From 209af037775fa745447482e3668ff5e697d2c897 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 17 Apr 2026 15:46:04 -0700 Subject: [PATCH 075/144] Modify how the default branch is determined. --- rc_shared.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index cf63a94..1b50de1 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -57,12 +57,20 @@ alias scan="nmap -A -p- --script=vuln " # Related specifically to this project. # +branch="$BRANCH" +if [[ -z "$branch" ]]; then + branch="$PROD_GIT_BRANCH" +fi +if [[ -z "$branch" ]]; then + branch="dev" +fi + function update-shared { log "`date` - Reloading the '~/.rc_shared' file from env-shared.\n" - branch="$1" - if [[ -z "$branch" ]]; then - branch="dev" - fi + + if [[ -n "$1" ]]; then + branch="$1" + fi dir="shared-rc-deleteme" @@ -99,11 +107,12 @@ alias shared-reload="update-shared" project="$HOME/.env-shared" function update-shared2 { if [[ ! -d $project ]]; then - + git clone https://git.hyperling.com/me/env-shared \ + $dir --branch=$branch fi } if [[ -d $project ]]; then - git -C $project status + git -C $project status | grep TBD fi & # Shortcuts # From 6887a1e1315bf105b65cbdbe2f7e1b3cdfb3508b Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 17 Apr 2026 15:52:20 -0700 Subject: [PATCH 076/144] Add what will happen if updates are found. --- rc_shared.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 1b50de1..de9ab82 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -112,7 +112,8 @@ function update-shared2 { fi } if [[ -d $project ]]; then - git -C $project status | grep TBD + git -C $project status | grep TBD && + echo "`date` - Updates to env-shared are available." fi & # Shortcuts # From 1989377b8b8ea5d46db43318d02062c716e67bf6 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 17 Apr 2026 15:56:30 -0700 Subject: [PATCH 077/144] Begin adding the code which syncs up the project and distributes the files. --- rc_shared.sh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index de9ab82..cfb9d2f 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -106,9 +106,29 @@ alias shared-reload="update-shared" project="$HOME/.env-shared" function update-shared2 { - if [[ ! -d $project ]]; then + if [[ -d $project ]]; then + log "`date` - Updating '$project'.\n" + cd "$project" + git switch "$branch" + git pull --recurse-submodules + else + log "`date` - Downloading '$project'.\n" git clone https://git.hyperling.com/me/env-shared \ - $dir --branch=$branch + $project --branch=$branch + fi + + if [[ -d "$local_bin" ]]; then + log "\n`date` - Found '$local_bin', adding scripts.\n" + mv -v $remote_bin/*.sh "$local_bin"/ + + refactor_script="refactor_music_library.sh" + wget -O "$refactor_script" \ + https://git.hyperling.com/me/shell-music-refactor-library/src/branch/main/refactor_music_library.sh + mv -v $refactor_script "$local_bin"/ + + chmod 755 -Rv "$local_bin" + else + echo "Did not find '$local_bin', did not copy scripts." fi } if [[ -d $project ]]; then From 71875470c23ab003649e7f3200e02f5b9adb91f1 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 17 Apr 2026 15:57:21 -0700 Subject: [PATCH 078/144] Add missing variables. --- rc_shared.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index cfb9d2f..cebc8c0 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -117,6 +117,8 @@ function update-shared2 { $project --branch=$branch fi + local_bin="$HOME/bin" + remote_bin="$project/bin-shared" if [[ -d "$local_bin" ]]; then log "\n`date` - Found '$local_bin', adding scripts.\n" mv -v $remote_bin/*.sh "$local_bin"/ From e1d9b6cf9496ffd53e73bf6a3aee2ff5b858f4d0 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 17 Apr 2026 16:09:40 -0700 Subject: [PATCH 079/144] Continue enhancing the auto-update version of env-shared. --- rc_shared.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index cebc8c0..9476d35 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -121,7 +121,7 @@ function update-shared2 { remote_bin="$project/bin-shared" if [[ -d "$local_bin" ]]; then log "\n`date` - Found '$local_bin', adding scripts.\n" - mv -v $remote_bin/*.sh "$local_bin"/ + cp -v $remote_bin/*.sh "$local_bin"/ refactor_script="refactor_music_library.sh" wget -O "$refactor_script" \ @@ -133,9 +133,15 @@ function update-shared2 { echo "Did not find '$local_bin', did not copy scripts." fi } +alias shared-update2="update-shared2" +alias reload-shared2="update-shared2" +alias shared-reload2="update-shared2" if [[ -d $project ]]; then - git -C $project status | grep TBD && - echo "`date` - Updates to env-shared are available." + git -C $project fetch && git -C $project status | grep "is behind" \ + | while read status; do + log "\n\n`date` - Updates to env-shared are available via update-shared2." + log ": '$status'\n" + done fi & # Shortcuts # From 340667329c8cb4c34b6728768a1dbd36eac81b2c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 17 Apr 2026 16:10:51 -0700 Subject: [PATCH 080/144] Remove the output from fetch. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 9476d35..89d79fc 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -137,7 +137,7 @@ alias shared-update2="update-shared2" alias reload-shared2="update-shared2" alias shared-reload2="update-shared2" if [[ -d $project ]]; then - git -C $project fetch && git -C $project status | grep "is behind" \ + git -C $project fetch >/dev/null 2>&1 && git -C $project status | grep "is behind" \ | while read status; do log "\n\n`date` - Updates to env-shared are available via update-shared2." log ": '$status'\n" From 56969e9ee95c4ca8ab22bc87238a2c1a7314d26f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 17 Apr 2026 16:13:27 -0700 Subject: [PATCH 081/144] Prevent the code from being spit onto the screen by having it in a subshell. --- rc_shared.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 89d79fc..f2597ef 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -136,13 +136,13 @@ function update-shared2 { alias shared-update2="update-shared2" alias reload-shared2="update-shared2" alias shared-reload2="update-shared2" -if [[ -d $project ]]; then +( if [[ -d $project ]]; then git -C $project fetch >/dev/null 2>&1 && git -C $project status | grep "is behind" \ | while read status; do log "\n\n`date` - Updates to env-shared are available via update-shared2." - log ": '$status'\n" + #log ": '$status'" done -fi & +fi & ) # Shortcuts # From 74d727faa92baf7f3077bce92d095515cbabebfc Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 17 Apr 2026 16:17:03 -0700 Subject: [PATCH 082/144] Fix output for both update shared functions. --- rc_shared.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index f2597ef..e23a277 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -98,7 +98,7 @@ function update-shared { log "\n`date` - Done! Removing git clone.\n" mv -v $dir ~/TRASH/"$dir-`date "+%Y%m%d-%H%M%S"`" - log "\n`date` - Complete! Please note this does NOT update bin files." + log "\n`date` - Complete!" } alias shared-update="update-shared" alias reload-shared="update-shared" @@ -132,6 +132,8 @@ function update-shared2 { else echo "Did not find '$local_bin', did not copy scripts." fi + + log "\n`date` - Complete!" } alias shared-update2="update-shared2" alias reload-shared2="update-shared2" @@ -139,7 +141,7 @@ alias shared-reload2="update-shared2" ( if [[ -d $project ]]; then git -C $project fetch >/dev/null 2>&1 && git -C $project status | grep "is behind" \ | while read status; do - log "\n\n`date` - Updates to env-shared are available via update-shared2." + log "\n\n`date` - Updates to env-shared are available via 'update-shared2'." #log ": '$status'" done fi & ) From cf1b7a160a9ccc0b734eb8b5f76be071db23d22e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 17 Apr 2026 16:20:20 -0700 Subject: [PATCH 083/144] Finalize output (for now). --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index e23a277..216eea5 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -142,7 +142,7 @@ alias shared-reload2="update-shared2" git -C $project fetch >/dev/null 2>&1 && git -C $project status | grep "is behind" \ | while read status; do log "\n\n`date` - Updates to env-shared are available via 'update-shared2'." - #log ": '$status'" + log " '$status'" done fi & ) From 9d604c6e900bf7b54ccc9bb010fa9d945986a940 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 17 Apr 2026 18:06:44 -0700 Subject: [PATCH 084/144] Add missing quotes and do not use `cd`. --- rc_shared.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 216eea5..cabe9a3 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -108,13 +108,13 @@ project="$HOME/.env-shared" function update-shared2 { if [[ -d $project ]]; then log "`date` - Updating '$project'.\n" - cd "$project" - git switch "$branch" - git pull --recurse-submodules + git -C "$project" switch "$branch" + git -C "$project" pull --recurse-submodules || \ + ( echo "Failed to pull project, exiting." && return 1 ) else log "`date` - Downloading '$project'.\n" git clone https://git.hyperling.com/me/env-shared \ - $project --branch=$branch + "$project" --branch=$branch fi local_bin="$HOME/bin" @@ -138,8 +138,8 @@ function update-shared2 { alias shared-update2="update-shared2" alias reload-shared2="update-shared2" alias shared-reload2="update-shared2" -( if [[ -d $project ]]; then - git -C $project fetch >/dev/null 2>&1 && git -C $project status | grep "is behind" \ +( if [[ -d "$project" ]]; then + git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \ | while read status; do log "\n\n`date` - Updates to env-shared are available via 'update-shared2'." log " '$status'" From 4791e1c1683a776d96127b2cddfa395a199e3f93 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 23 Apr 2026 09:15:22 -0700 Subject: [PATCH 085/144] Fix typo. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index cabe9a3..78ccdfd 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -246,7 +246,7 @@ function sync-all-loop { if [[ -z "$sleep_time" || "$sleep_time" == 0 ]]; then sleep_time="300" fi - log "`date` - Sleep timeer set for '$sleep_time' seconds." + log "`date` - Sleep timer set for '$sleep_time' seconds." while true; do sync-all echo -e "\n\n*** Sleeping... ***\n\n" From 0c54259a38c3a3ce4ab96d86010307d55548844c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Apr 2026 07:48:51 -0700 Subject: [PATCH 086/144] Add message to video processing function that a sync is being done. --- rc_shared.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 78ccdfd..859135c 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -396,9 +396,11 @@ function process-video { mv -v ffmpeg2pass*.log* ~/TRASH/ fi + echo "`date` - Syncing data." sync sleep 10 sync + if [[ -s $newfile ]]; then echo "`date` - Getting file sizes." du -h "$file" From 79a35be993d3ba3c8cb91ae461965a4d16f24311 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Apr 2026 08:17:29 -0700 Subject: [PATCH 087/144] Move the update checker to be after all functions are declared so that `log` works properly. --- rc_shared.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 859135c..6b6cecb 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -138,13 +138,6 @@ function update-shared2 { alias shared-update2="update-shared2" alias reload-shared2="update-shared2" alias shared-reload2="update-shared2" -( if [[ -d "$project" ]]; then - git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \ - | while read status; do - log "\n\n`date` - Updates to env-shared are available via 'update-shared2'." - log " '$status'" - done -fi & ) # Shortcuts # @@ -518,6 +511,16 @@ alias pa="v2a" eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" +# Run update checker in background. +( if [[ -d "$project" ]]; then + git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \ + | while read status; do + log "\n\n`date` - Updates to env-shared are available via 'update-shared2'." + log " '$status'" + done +fi & ) + + ## Complete! ## [[ $(whoami) != "root" ]] && From 14ce936e9b176ca2f374bc4b011159af7484f2f9 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Apr 2026 09:15:38 -0700 Subject: [PATCH 088/144] Promote update-shared2 to be the new default. --- rc_shared.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 6b6cecb..114db42 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -65,7 +65,7 @@ if [[ -z "$branch" ]]; then branch="dev" fi -function update-shared { +function update-shared-old { log "`date` - Reloading the '~/.rc_shared' file from env-shared.\n" if [[ -n "$1" ]]; then @@ -100,9 +100,6 @@ function update-shared { log "\n`date` - Complete!" } -alias shared-update="update-shared" -alias reload-shared="update-shared" -alias shared-reload="update-shared" project="$HOME/.env-shared" function update-shared2 { @@ -139,6 +136,11 @@ alias shared-update2="update-shared2" alias reload-shared2="update-shared2" alias shared-reload2="update-shared2" +alias update-shared="update-shared2" +alias shared-update="update-shared" +alias reload-shared="update-shared" +alias shared-reload="update-shared" + # Shortcuts # function send-master { send_master.sh; } From a6b5cd92972051ae2c22ff266e38b043450de6ac Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Apr 2026 09:19:16 -0700 Subject: [PATCH 089/144] Fix the URLs to get the raw file. Thought this was already done! --- rc_shared.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 114db42..51138fd 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -87,7 +87,7 @@ function update-shared-old { refactor_script="refactor_music_library.sh" wget -O "$refactor_script" \ - https://git.hyperling.com/me/shell-music-refactor-library/src/branch/main/refactor_music_library.sh + https://git.hyperling.com/me/shell-music-refactor-library/raw/branch/main/refactor_music_library.sh mv -v $refactor_script "$local_bin"/ chmod 755 -Rv "$local_bin" @@ -122,7 +122,7 @@ function update-shared2 { refactor_script="refactor_music_library.sh" wget -O "$refactor_script" \ - https://git.hyperling.com/me/shell-music-refactor-library/src/branch/main/refactor_music_library.sh + https://git.hyperling.com/me/shell-music-refactor-library/raw/branch/main/refactor_music_library.sh mv -v $refactor_script "$local_bin"/ chmod 755 -Rv "$local_bin" From 332631e3dd55120ec07dc4454e0665b1c67c9eed Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Apr 2026 10:33:21 -0700 Subject: [PATCH 090/144] Move trash related code to shared env. --- rc_shared.sh | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 51138fd..d2aa14b 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -509,10 +509,36 @@ alias vta="v2a" alias pull-audio="v2a" alias pa="v2a" + +## Trash Related ## + +TRASH_ROOT="/" +if [[ -d "/sdcard" ]]; then + # Android / Termux + TRASH_ROOT="/sdcard" +else + # Desktop + TRASH_ROOT="$HOME" +fi +TRASH="$TRASH_ROOT/TRASH" + +alias trash="cd $TRASH" + +alias clean-trash="bash -c 'rm -rfv "$TRASH"/*'; clean-trashed" +alias trash-clean="clean-trash" + +alias check-trash='du -h $TRASH; find "$TRASH_ROOT" -name .Trash"*" -exec du -h {} \; -exec mv -v {} "$TRASH"/ \;' +alias trash-check="check-trash" + +alias check-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -exec mv -v {} "$TRASH"/ \; | sort -h' +alias clean-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -delete | sort -h' + + +## Finalize ## + # Export all functions! # eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" - # Run update checker in background. ( if [[ -d "$project" ]]; then git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \ From de6ca756da3fd0b2918cc8849fd85b37f1e6c82d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 5 May 2026 09:21:02 -0700 Subject: [PATCH 091/144] Add shortcut to get to main library. --- rc_shared.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index d2aa14b..d561ce0 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -48,6 +48,9 @@ alias clones="cl" alias cdl="cl" alias cdc="cl" +alias library="clones && cd .." +alias lib="library" + # Networking # alias scan="nmap -A -p- --script=vuln " From 20b130e9317a7ec151a292ad07223ee2611529ce Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 5 May 2026 09:29:18 -0700 Subject: [PATCH 092/144] Switch order of subshells in case it helps with the file getting called home.mp4 every time. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index d561ce0..77d8407 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -411,7 +411,7 @@ function process-video { return $status } alias pv="process-video" -alias qpv="pv ./raw/YouCut*.mp4 `basename $(pwd)`.mp4" +alias qpv="pv ./raw/YouCut*.mp4 $(basename `pwd`).mp4" # Allow converting video to audio and other smaller # tasks than what process-video is intended to do. From c9889f6a23954c5e5072235250bbb9d639e268bd Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 5 May 2026 09:45:48 -0700 Subject: [PATCH 093/144] Remove the 2 since the updater functions have been merged. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 77d8407..f92fe0c 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -546,7 +546,7 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" ( if [[ -d "$project" ]]; then git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \ | while read status; do - log "\n\n`date` - Updates to env-shared are available via 'update-shared2'." + log "\n\n`date` - Updates to env-shared are available via 'update-shared'." log " '$status'" done fi & ) From eb63e0321c2b8fc291d47a1c65a1f0908ee8f413 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 5 May 2026 15:24:34 -0700 Subject: [PATCH 094/144] Simplify verbiage and shorten the length. --- rc_shared.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index f92fe0c..49ea242 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -546,8 +546,9 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" ( if [[ -d "$project" ]]; then git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \ | while read status; do - log "\n\n`date` - Updates to env-shared are available via 'update-shared'." + log "\n\n`date` - env-shared has been improved." log " '$status'" + log "\n\n`date` - Run 'update-shared' to update." done fi & ) From 6e4f76dc58ca6140f3db4b3e7625d69874341905 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 5 May 2026 15:41:39 -0700 Subject: [PATCH 095/144] Add functions for full level reload and update. --- rc_shared.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 49ea242..7552f59 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -144,6 +144,40 @@ alias shared-update="update-shared" alias reload-shared="update-shared" alias shared-reload="update-shared" +function reload-all { + log "`date` - Reloading BASH" + reload-bash + + log "\n`date` - Reloading Main (Termux/Ansible)" + if [[ -d /sdcard ]]; then + reload-termux + else + scm.sh + fi + reload-bash + + log "\n`date` - Reloading Shared" + reload-shared + reload-bash +} +alias all-reload="reload-all" + +function update-all { + log "`date` - Updating env projects..." + reload-all + + log "\n\n\n`date` - Running system updates..." + update -y + + if [[ $(type -t update-sdk 2>/dev/null 1>&2) ]]; then + log "\n\n\n`date` - Updating SDKs..." + update-sdk + fi + + log "\n\n\n`date` - Done with update-all!" +} +alias all-update="update-all" + # Shortcuts # function send-master { send_master.sh; } From d49116a884fe09df9d82067f0271c4ee7938dcb8 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 09:33:49 -0700 Subject: [PATCH 096/144] Remove the old project as not to clutter the home directory. --- rc_shared.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 7552f59..2163223 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -104,7 +104,7 @@ function update-shared-old { log "\n`date` - Complete!" } -project="$HOME/.env-shared" +project="$HOME/.git-env-shared" function update-shared2 { if [[ -d $project ]]; then log "`date` - Updating '$project'.\n" @@ -178,6 +178,12 @@ function update-all { } alias all-update="update-all" +project_old="$HOME/.env-shared" +if [[ -d "$project_old" ]]; then + log "`date` - Removing old project name '$project_old'." + mv -v "$project_old" "$TRASH"/env-shared-deleteme +fi + # Shortcuts # function send-master { send_master.sh; } From bcfde6c17294e5ddb12554b63fdbb3cbfaf30f8a Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 10:26:45 -0700 Subject: [PATCH 097/144] Hide the .git dir deletion. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 2163223..66cf08e 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -181,7 +181,7 @@ alias all-update="update-all" project_old="$HOME/.env-shared" if [[ -d "$project_old" ]]; then log "`date` - Removing old project name '$project_old'." - mv -v "$project_old" "$TRASH"/env-shared-deleteme + mv -v "$project_old" "$TRASH"/env-shared-deleteme | grep -v ".git" fi # Shortcuts # From aec0449ed27a630902ebd86027a6394149b9c081 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 14:50:33 -0700 Subject: [PATCH 098/144] No longer push the update information to the screen, use notifications. --- rc_shared.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 66cf08e..39db11e 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -586,9 +586,18 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" ( if [[ -d "$project" ]]; then git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \ | while read status; do - log "\n\n`date` - env-shared has been improved." - log " '$status'" - log "\n\n`date` - Run 'update-shared' to update." + #log "\n\n`date` - env-shared has been improved." + #log " '$status'" + #log "\n\n`date` - Run 'update-shared' to update." + title="env-shared Updates Available" + message="Please run reload-shared to pull the latest changes." + if [[ -d /sdcard ]]; then + termux-notification \ + -t "$title" \ + -c "$message" + else + notify-send "$title" "$message" + fi done fi & ) From 5a7bd88c706be9e677ee0713351b1488aa1537c9 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 14:57:30 -0700 Subject: [PATCH 099/144] Ensure path is quoted just in case. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 39db11e..36d9978 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -121,7 +121,7 @@ function update-shared2 { remote_bin="$project/bin-shared" if [[ -d "$local_bin" ]]; then log "\n`date` - Found '$local_bin', adding scripts.\n" - cp -v $remote_bin/*.sh "$local_bin"/ + cp -v "$remote_bin"/*.sh "$local_bin"/ refactor_script="refactor_music_library.sh" wget -O "$refactor_script" \ From a28d00d3ad8c80a99f7793e5a5dca9ee7d12c87e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 15:02:09 -0700 Subject: [PATCH 100/144] Only show the changed permissions. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 36d9978..cb2c40a 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -128,7 +128,7 @@ function update-shared2 { https://git.hyperling.com/me/shell-music-refactor-library/raw/branch/main/refactor_music_library.sh mv -v $refactor_script "$local_bin"/ - chmod 755 -Rv "$local_bin" + chmod 755 -Rc "$local_bin" else echo "Did not find '$local_bin', did not copy scripts." fi From 3f74195968f7ff277d71a97d6b8148a741f94fe6 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 15:06:59 -0700 Subject: [PATCH 101/144] Shorten the message. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index cb2c40a..41b5bcc 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -590,7 +590,7 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" #log " '$status'" #log "\n\n`date` - Run 'update-shared' to update." title="env-shared Updates Available" - message="Please run reload-shared to pull the latest changes." + message="Widate with 'reload-shared'." if [[ -d /sdcard ]]; then termux-notification \ -t "$title" \ From 000c52417cefde98bf8333645b490909ea0c02a3 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 15:24:32 -0700 Subject: [PATCH 102/144] Fix the '$project' variable being shared across environments incorrectly. --- rc_shared.sh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 41b5bcc..39817ae 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -93,7 +93,7 @@ function update-shared-old { https://git.hyperling.com/me/shell-music-refactor-library/raw/branch/main/refactor_music_library.sh mv -v $refactor_script "$local_bin"/ - chmod 755 -Rv "$local_bin" + chmod 755 -Rc "$local_bin" else echo "Did not find '$local_bin', did not copy scripts." fi @@ -104,21 +104,21 @@ function update-shared-old { log "\n`date` - Complete!" } -project="$HOME/.git-env-shared" +PROJECT_SHARED="$HOME/.git-env-shared" function update-shared2 { - if [[ -d $project ]]; then - log "`date` - Updating '$project'.\n" - git -C "$project" switch "$branch" - git -C "$project" pull --recurse-submodules || \ + if [[ -d $shared ]]; then + log "`date` - Updating '$PROJECT_SHARED'.\n" + git -C "$PROJECT_SHARED" switch "$branch" + git -C "$PROJECT_SHARED" pull --recurse-submodules || \ ( echo "Failed to pull project, exiting." && return 1 ) else - log "`date` - Downloading '$project'.\n" + log "`date` - Downloading '$PROJECT_SHARED'.\n" git clone https://git.hyperling.com/me/env-shared \ - "$project" --branch=$branch + "$PROJECT_SHARED" --branch=$branch fi local_bin="$HOME/bin" - remote_bin="$project/bin-shared" + remote_bin="$PROJECT_SHARED/bin-shared" if [[ -d "$local_bin" ]]; then log "\n`date` - Found '$local_bin', adding scripts.\n" cp -v "$remote_bin"/*.sh "$local_bin"/ @@ -178,10 +178,10 @@ function update-all { } alias all-update="update-all" -project_old="$HOME/.env-shared" -if [[ -d "$project_old" ]]; then - log "`date` - Removing old project name '$project_old'." - mv -v "$project_old" "$TRASH"/env-shared-deleteme | grep -v ".git" +PROJECT_SHARED_OLD01="$HOME/.env-shared" +if [[ -d "$PROJECT_SHARED_OLD01" ]]; then + log "`date` - Removing old project name '$PROJECT_SHARED_OLD01'." + mv -v "$PROJECT_SHARED_OLD01" "$TRASH"/env-shared-deleteme | grep -v ".git" fi # Shortcuts # @@ -583,8 +583,10 @@ alias clean-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -del eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" # Run update checker in background. -( if [[ -d "$project" ]]; then - git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \ +( if [[ -d "$PROJECT_SHARED" ]]; then + git -C "$PROJECT_SHARED" fetch >/dev/null 2>&1 \ + && git -C "$PROJECT_SHARED" status \ + | grep "is behind" \ | while read status; do #log "\n\n`date` - env-shared has been improved." #log " '$status'" From 142317d46b42471e76f47f8502fb4a77c1a638c2 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 16:46:30 -0700 Subject: [PATCH 103/144] Fix typo in Update. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 39817ae..ca7df28 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -592,7 +592,7 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" #log " '$status'" #log "\n\n`date` - Run 'update-shared' to update." title="env-shared Updates Available" - message="Widate with 'reload-shared'." + message="Update with 'reload-shared'." if [[ -d /sdcard ]]; then termux-notification \ -t "$title" \ From facb2836c9a1efbba20499faea6870722fe26cf3 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 16:49:14 -0700 Subject: [PATCH 104/144] Just auto update, yo! --- rc_shared.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index ca7df28..cdc9a94 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -591,8 +591,15 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" #log "\n\n`date` - env-shared has been improved." #log " '$status'" #log "\n\n`date` - Run 'update-shared' to update." - title="env-shared Updates Available" - message="Update with 'reload-shared'." + title=TBD + message=TBD + reload-shared && ( + title="env-shared Updated" + message="Updated with 'reload-shared'." + ) || ( + title="env-shared Updates Available" + message="Update with 'reload-shared'." + ) if [[ -d /sdcard ]]; then termux-notification \ -t "$title" \ From 9f9cdf036172404082339160e57ba2ddcb8bc466 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:10:22 -0700 Subject: [PATCH 105/144] Add missing copy of rc_shared, as well as some comments. --- rc_shared.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index cdc9a94..50d761a 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -106,6 +106,7 @@ function update-shared-old { PROJECT_SHARED="$HOME/.git-env-shared" function update-shared2 { + # Refresh the local env-shared repo. if [[ -d $shared ]]; then log "`date` - Updating '$PROJECT_SHARED'.\n" git -C "$PROJECT_SHARED" switch "$branch" @@ -117,6 +118,10 @@ function update-shared2 { "$PROJECT_SHARED" --branch=$branch fi + # Tha main piece! Reload the shared RC file. + cp -v "$PROJECT_SHARED"/rc_shared.sh ~/.rc_shared + + # Copy the scripts from the shared bin to the home bin. local_bin="$HOME/bin" remote_bin="$PROJECT_SHARED/bin-shared" if [[ -d "$local_bin" ]]; then From 6c5dc2c8bf4350ba63e8483ea3236494a771f3ec Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:11:25 -0700 Subject: [PATCH 106/144] Also add copy of the vimrc file. --- rc_shared.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/rc_shared.sh b/rc_shared.sh index 50d761a..145dcf2 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -120,6 +120,7 @@ function update-shared2 { # Tha main piece! Reload the shared RC file. cp -v "$PROJECT_SHARED"/rc_shared.sh ~/.rc_shared + cp -v "$PROJECT_SHARED"/vimrc.vim ~/.vimrc # Copy the scripts from the shared bin to the home bin. local_bin="$HOME/bin" From de1628353f7887e57c9b2c645708700635303075 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:15:30 -0700 Subject: [PATCH 107/144] Add filesize sorting to trash checking. --- rc_shared.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 145dcf2..e767f16 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -576,11 +576,11 @@ alias trash="cd $TRASH" alias clean-trash="bash -c 'rm -rfv "$TRASH"/*'; clean-trashed" alias trash-clean="clean-trash" -alias check-trash='du -h $TRASH; find "$TRASH_ROOT" -name .Trash"*" -exec du -h {} \; -exec mv -v {} "$TRASH"/ \;' +alias check-trash='du -h $TRASH | sort -h; find "$TRASH_ROOT" -name .Trash"*" -exec du -h {} \; -exec mv -v {} "$TRASH"/ \;' alias trash-check="check-trash" -alias check-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -exec mv -v {} "$TRASH"/ \; | sort -h' -alias clean-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -delete | sort -h' +alias check-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} | sort -h \; -exec mv -v {} "$TRASH"/ \; | sort -h' +alias clean-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} | sort -h \; -delete | sort -h' ## Finalize ## From 4ee3dc69c996897060dc8c2f62145cdae244e47e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:22:05 -0700 Subject: [PATCH 108/144] Remove the middle sorts which threw a weird error. --- rc_shared.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index e767f16..b1059f5 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -579,8 +579,8 @@ alias trash-clean="clean-trash" alias check-trash='du -h $TRASH | sort -h; find "$TRASH_ROOT" -name .Trash"*" -exec du -h {} \; -exec mv -v {} "$TRASH"/ \;' alias trash-check="check-trash" -alias check-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} | sort -h \; -exec mv -v {} "$TRASH"/ \; | sort -h' -alias clean-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} | sort -h \; -delete | sort -h' +alias check-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -exec mv -v {} "$TRASH"/ \; | sort -h' +alias clean-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -delete | sort -h' ## Finalize ## From 0d450e9172d0cc092e5d0923535c1609813c2bc7 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:28:48 -0700 Subject: [PATCH 109/144] Try to fix auto-update notification as well as output. --- rc_shared.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index b1059f5..0b19fd8 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -599,13 +599,13 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" #log "\n\n`date` - Run 'update-shared' to update." title=TBD message=TBD - reload-shared && ( + reload-shared && { title="env-shared Updated" message="Updated with 'reload-shared'." - ) || ( + } || { title="env-shared Updates Available" message="Update with 'reload-shared'." - ) + } if [[ -d /sdcard ]]; then termux-notification \ -t "$title" \ @@ -614,7 +614,7 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" notify-send "$title" "$message" fi done -fi & ) +fi & ) >> $Home/Reports/env-shared.log 2>&1 ## Complete! ## From d3a5bbc9c315778fcd595c3d3010d4105a682801 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:34:17 -0700 Subject: [PATCH 110/144] Try to do the output redirect a different way, fork at the very very end,. --- rc_shared.sh | 54 +++++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 0b19fd8..947317b 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -589,32 +589,34 @@ alias clean-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -del eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" # Run update checker in background. -( if [[ -d "$PROJECT_SHARED" ]]; then - git -C "$PROJECT_SHARED" fetch >/dev/null 2>&1 \ - && git -C "$PROJECT_SHARED" status \ - | grep "is behind" \ - | while read status; do - #log "\n\n`date` - env-shared has been improved." - #log " '$status'" - #log "\n\n`date` - Run 'update-shared' to update." - title=TBD - message=TBD - reload-shared && { - title="env-shared Updated" - message="Updated with 'reload-shared'." - } || { - title="env-shared Updates Available" - message="Update with 'reload-shared'." - } - if [[ -d /sdcard ]]; then - termux-notification \ - -t "$title" \ - -c "$message" - else - notify-send "$title" "$message" - fi - done -fi & ) >> $Home/Reports/env-shared.log 2>&1 +( + if [[ -d "$PROJECT_SHARED" ]]; then + git -C "$PROJECT_SHARED" fetch >/dev/null 2>&1 \ + && git -C "$PROJECT_SHARED" status \ + | grep "is behind" \ + | while read status; do + #log "\n\n`date` - env-shared has been improved." + #log " '$status'" + #log "\n\n`date` - Run 'update-shared' to update." + title=TBD + message=TBD + reload-shared && { + title="env-shared Updated" + message="Updated with 'reload-shared'." + } || { + title="env-shared Updates Available" + message="Update with 'reload-shared'." + } + if [[ -d /sdcard ]]; then + termux-notification \ + -t "$title" \ + -c "$message" + else + notify-send "$title" "$message" + fi + done + fi +) >> $Home/Reports/env-shared.log 2>&1 & ## Complete! ## From 487399e18f6565e70347bbf672e968b2aa53d6ca Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:36:27 -0700 Subject: [PATCH 111/144] Try fixing the notification message from being TBD/TBD. --- rc_shared.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 947317b..905fde8 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -600,13 +600,15 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" #log "\n\n`date` - Run 'update-shared' to update." title=TBD message=TBD - reload-shared && { + success=0 + reload-shared || success=1 + if [[ $success == 0 ]]; then title="env-shared Updated" message="Updated with 'reload-shared'." - } || { + else title="env-shared Updates Available" message="Update with 'reload-shared'." - } + fi if [[ -d /sdcard ]]; then termux-notification \ -t "$title" \ From 032fa387b6bb450f3efb59a15efeab0f7342911e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:37:04 -0700 Subject: [PATCH 112/144] Fix the report location. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 905fde8..7a804d4 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -618,7 +618,7 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" fi done fi -) >> $Home/Reports/env-shared.log 2>&1 & +) >> "$HOME"/Reports/env-shared.log 2>&1 & ## Complete! ## From deffc60730e050c09946ab6e63020270436d0d54 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:47:16 -0700 Subject: [PATCH 113/144] Remove old terminal output ommands fior updater. --- rc_shared.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 7a804d4..538d960 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -595,9 +595,6 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" && git -C "$PROJECT_SHARED" status \ | grep "is behind" \ | while read status; do - #log "\n\n`date` - env-shared has been improved." - #log " '$status'" - #log "\n\n`date` - Run 'update-shared' to update." title=TBD message=TBD success=0 From e063f4c4b77d69ae507d4f11c896c992edb4a593 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:48:24 -0700 Subject: [PATCH 114/144] Double wrap the updater commands so that the DONE code does not appear in the terminl. --- rc_shared.sh | 54 +++++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 538d960..734f202 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -590,32 +590,34 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" # Run update checker in background. ( - if [[ -d "$PROJECT_SHARED" ]]; then - git -C "$PROJECT_SHARED" fetch >/dev/null 2>&1 \ - && git -C "$PROJECT_SHARED" status \ - | grep "is behind" \ - | while read status; do - title=TBD - message=TBD - success=0 - reload-shared || success=1 - if [[ $success == 0 ]]; then - title="env-shared Updated" - message="Updated with 'reload-shared'." - else - title="env-shared Updates Available" - message="Update with 'reload-shared'." - fi - if [[ -d /sdcard ]]; then - termux-notification \ - -t "$title" \ - -c "$message" - else - notify-send "$title" "$message" - fi - done - fi -) >> "$HOME"/Reports/env-shared.log 2>&1 & + ( + if [[ -d "$PROJECT_SHARED" ]]; then + git -C "$PROJECT_SHARED" fetch >/dev/null 2>&1 \ + && git -C "$PROJECT_SHARED" status \ + | grep "is behind" \ + | while read status; do + title=TBD + message=TBD + success=0 + reload-shared || success=1 + if [[ $success == 0 ]]; then + title="env-shared Updated" + message="Updated with 'reload-shared'." + else + title="env-shared Updates Available" + message="Update with 'reload-shared'." + fi + if [[ -d /sdcard ]]; then + termux-notification \ + -t "$title" \ + -c "$message" + else + notify-send "$title" "$message" + fi + done + fi + ) >> "$HOME"/Reports/env-shared.log 2>&1 & +) ## Complete! ## From 4a13b5cea8455b367f4b81d9a5984310966c4fba Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:50:29 -0700 Subject: [PATCH 115/144] Add note that bash will still need reloaded after automatic updates, lol. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 734f202..e85ce7d 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -602,7 +602,7 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" reload-shared || success=1 if [[ $success == 0 ]]; then title="env-shared Updated" - message="Updated with 'reload-shared'." + message="Reloaded automatically, please reload BASH. :)" else title="env-shared Updates Available" message="Update with 'reload-shared'." From ee325db486553b9205c7988be723ef1df384184b Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:55:05 -0700 Subject: [PATCH 116/144] Change log files to txt files because Android file haanddler is dumb. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index e85ce7d..2d0d50c 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -616,7 +616,7 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" fi done fi - ) >> "$HOME"/Reports/env-shared.log 2>&1 & + ) >> "$HOME"/Reports/env-shared.txt.log 2>&1 & ) From 13c22faa9dffe122e0242e0be31f47fa393cb8e2 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:57:28 -0700 Subject: [PATCH 117/144] Put the file extension on the wrong side. :) --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 2d0d50c..347c44b 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -616,7 +616,7 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" fi done fi - ) >> "$HOME"/Reports/env-shared.txt.log 2>&1 & + ) >> "$HOME"/Reports/env-shared.log.txt 2>&1 & ) From c7d2dafa118dced8cfb32efded0a246ec36ee300 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 18:01:56 -0700 Subject: [PATCH 118/144] Hopefully fix the reason that the shared rc has not always been updating correctly. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 347c44b..41bd0cd 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -107,7 +107,7 @@ function update-shared-old { PROJECT_SHARED="$HOME/.git-env-shared" function update-shared2 { # Refresh the local env-shared repo. - if [[ -d $shared ]]; then + if [[ -d $PROJECT_SHARED ]]; then log "`date` - Updating '$PROJECT_SHARED'.\n" git -C "$PROJECT_SHARED" switch "$branch" git -C "$PROJECT_SHARED" pull --recurse-submodules || \ From 7a53a8ced6ed0ddbf28620388c4f1db7b2c90e6f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 8 May 2026 10:39:04 -0700 Subject: [PATCH 119/144] Add quotes to variable in conditional. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 41bd0cd..9479ea0 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -600,7 +600,7 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" message=TBD success=0 reload-shared || success=1 - if [[ $success == 0 ]]; then + if [[ "$success" == 0 ]]; then title="env-shared Updated" message="Reloaded automatically, please reload BASH. :)" else From b3bc6984cbe99264871a0be109df689c21f1573d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 12 May 2026 05:49:10 -0700 Subject: [PATCH 120/144] Move the TRASH variable up and ensure it is exported. --- rc_shared.sh | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 9479ea0..33a7f84 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -55,6 +55,29 @@ alias lib="library" alias scan="nmap -A -p- --script=vuln " +# Trash Related # + +export TRASH_ROOT="/" +if [[ -d "/sdcard" ]]; then + # Android / Termux + export TRASH_ROOT="/sdcard" +else + # Desktop + export TRASH_ROOT="$HOME" +fi +export TRASH="$TRASH_ROOT/TRASH" + +alias trash="cd $TRASH" + +alias clean-trash="bash -c 'rm -rfv "$TRASH"/*'; clean-trashed" +alias trash-clean="clean-trash" + +alias check-trash='du -h $TRASH | sort -h; find "$TRASH_ROOT" -name .Trash"*" -exec du -h {} \; -exec mv -v {} "$TRASH"/ \;' +alias trash-check="check-trash" + +alias check-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -exec mv -v {} "$TRASH"/ \; | sort -h' +alias clean-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -delete | sort -h' + ## Functions ## @@ -559,30 +582,6 @@ alias pull-audio="v2a" alias pa="v2a" -## Trash Related ## - -TRASH_ROOT="/" -if [[ -d "/sdcard" ]]; then - # Android / Termux - TRASH_ROOT="/sdcard" -else - # Desktop - TRASH_ROOT="$HOME" -fi -TRASH="$TRASH_ROOT/TRASH" - -alias trash="cd $TRASH" - -alias clean-trash="bash -c 'rm -rfv "$TRASH"/*'; clean-trashed" -alias trash-clean="clean-trash" - -alias check-trash='du -h $TRASH | sort -h; find "$TRASH_ROOT" -name .Trash"*" -exec du -h {} \; -exec mv -v {} "$TRASH"/ \;' -alias trash-check="check-trash" - -alias check-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -exec mv -v {} "$TRASH"/ \; | sort -h' -alias clean-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -delete | sort -h' - - ## Finalize ## # Export all functions! # From 672d8d424a993a73fa37dc3f9fdbc0dfc8109361 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 12 May 2026 05:50:08 -0700 Subject: [PATCH 121/144] Add export to other variable(s). Fix some spacing. --- rc_shared.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 33a7f84..22cc0ba 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -127,7 +127,7 @@ function update-shared-old { log "\n`date` - Complete!" } -PROJECT_SHARED="$HOME/.git-env-shared" +export PROJECT_SHARED="$HOME/.git-env-shared" function update-shared2 { # Refresh the local env-shared repo. if [[ -d $PROJECT_SHARED ]]; then @@ -355,7 +355,6 @@ function sync-syncs { EOF } - # Audio # # Video # From c0762fb23e8419785cff25c16eacdd5d644c57e0 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 19 May 2026 15:28:02 -0700 Subject: [PATCH 122/144] Ensure the subcommands are run via the alias, not by sourcing the file. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 22cc0ba..389197b 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -479,7 +479,7 @@ function process-video { return $status } alias pv="process-video" -alias qpv="pv ./raw/YouCut*.mp4 $(basename `pwd`).mp4" +alias qpv='pv ./raw/YouCut*.mp4 $(basename `pwd`).mp4' # Allow converting video to audio and other smaller # tasks than what process-video is intended to do. From 18b4ef7a8ab243e87e7291a959330c2fd050dc31 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 27 May 2026 08:09:58 -0700 Subject: [PATCH 123/144] Move the download-website function to shared, plus add random wait and wait retry options and enhance final output slightly. --- rc_shared.sh | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 389197b..e61725d 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -581,6 +581,75 @@ alias pull-audio="v2a" alias pa="v2a" +### Web ### + +function download-website { + website="$1" + if [[ -z "$website" ]]; then + echo "ERROR: Website not provided. $website" + return + fi + if [[ "$website" != "http"* ]]; then + website="http://$website" + fi + # https://simpleit.rocks/linux/how-to-download-a-website-with-wget-the-right-way/ + # Does not simplify the links for offline usage. + # wget --wait=2 \ + # --level=inf \ + # --limit-rate=20K \ + # --recursive \ + # --page-requisites \ + # --user-agent=Mozilla \ + # --no-parent \ + # --convert-links \ + # --adjust-extension \ + # --no-clobber \ + # -e robots=off \ + # $website && + + # https://www.digitalcitizen.life/how-to-download-entire-website-for-offline-viewing/ + # This one is supposed to work too and is much smaller. + # wget --mirror \ + # --convert-links \ + # --adjust-extension \ + # --page-requisites \ + # --no-parent \ + # $website && + + # Combine the two by using mirow and removing the rate limit. + wget --mirror \ + --wait=2 \ + --level=inf \ + --recursive \ + --page-requisites \ + --user-agent=Mozilla \ + --no-parent \ + --convert-links \ + --adjust-extension \ + --no-clobber \ + -e robots=off \ + --timeout=15 \ + --tries=0 \ + --continue \ + --waitretry=5 \ + --random-wait \ + $website && + { + echo -e "\nSuccess!" + } || { + echo -e "\nERROR: Command reported a failure. (Error code '$?')" + echo "This may mean that the URL was not converted to local links." + echo "Please check the error and contents and try again if needed." + } +} +alias website-download="download-website" +alias curl-site="download-website" +alias pull-site="download-website" +alias curl-www="download-website" +alias pull-www="download-website" +alias www-pull="download-website" + + ## Finalize ## # Export all functions! # From 40d64504282b877d42f4dae73bbd62261b1dde93 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 27 May 2026 09:40:03 -0700 Subject: [PATCH 124/144] Defer the functions which have not been defined yet at this point. --- rc_shared.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index e61725d..48d908c 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -257,7 +257,7 @@ function pull { function push { if [[ -d .git ]]; then - git push && load-stage && load-prod + git push && eval load-stage && eval load-prod else send-master fi @@ -691,3 +691,5 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" [[ $(whoami) != "root" ]] && echo "`date` - Shared RC Config - Complete!" + +export _LOADED_SHARED_RC=true From af9009f1e4137dffbd9b12e66bb5747afd0892dd Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 27 May 2026 19:32:59 -0700 Subject: [PATCH 125/144] Add TBD for running a locally downloaded website, plus extra aliases. --- rc_shared.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 48d908c..31c5e17 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -645,10 +645,20 @@ function download-website { alias website-download="download-website" alias curl-site="download-website" alias pull-site="download-website" +alias site-pull="download-website" alias curl-www="download-website" alias pull-www="download-website" alias www-pull="download-website" +function run-site { + # TBD: Run a folder with HTML as a website on port $1 (8080 default) +} +alias run-html="run-site" +alias exec-site="run-site" +alias exec-html="run-site" +alias site-host="run-site" +alias host-site="run-site" + ## Finalize ## From 35a64c49a3868c24495947a88004c9c3fce5035a Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 28 May 2026 15:12:23 -0700 Subject: [PATCH 126/144] Add a counter to the sync loop, plus actually use the sleep timer variable. --- rc_shared.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 31c5e17..78790fb 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -306,7 +306,7 @@ function sync-all { echo -e "`date` - Done.\n" } function sync-all-loop { - typeset -i sleep_time + typeset -i sleep_time count if [[ "$1" ]]; then sleep_time="$1" fi @@ -314,10 +314,12 @@ function sync-all-loop { sleep_time="300" fi log "`date` - Sleep timer set for '$sleep_time' seconds." + count=0 while true; do sync-all - echo -e "\n\n*** Sleeping... ***\n\n" - sleep 300 + count=$(( count + 1 )) + echo -e "\n\n*** Sleeping for '$sleep_time' after run# '$count'! ***\n\n" + sleep $sleep_time done } From 0fccd614e7856fd300093e91a905ff00af1e6672 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 28 May 2026 15:30:35 -0700 Subject: [PATCH 127/144] Add something to the TBD function. --- rc_shared.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/rc_shared.sh b/rc_shared.sh index 78790fb..af64f5f 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -654,6 +654,7 @@ alias www-pull="download-website" function run-site { # TBD: Run a folder with HTML as a website on port $1 (8080 default) + sleep 0 } alias run-html="run-site" alias exec-site="run-site" From d523ae939a126459efcabf18a9d3712fa6bef821 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 3 Jun 2026 09:54:02 -0700 Subject: [PATCH 128/144] Add command for running a local HTML server. --- rc_shared.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index af64f5f..7f57db9 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -653,8 +653,7 @@ alias pull-www="download-website" alias www-pull="download-website" function run-site { - # TBD: Run a folder with HTML as a website on port $1 (8080 default) - sleep 0 + python3 -m http.server } alias run-html="run-site" alias exec-site="run-site" From 4a6de24d26b6234ca18da87be9da21d2f20d08ae Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 18 Jun 2026 17:21:16 -0700 Subject: [PATCH 129/144] Do not run the update checker for Root. --- rc_shared.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 7f57db9..68a578c 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -668,7 +668,7 @@ alias host-site="run-site" eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" # Run update checker in background. -( +if [[ "$USER" != "root" ]]; then ( if [[ -d "$PROJECT_SHARED" ]]; then git -C "$PROJECT_SHARED" fetch >/dev/null 2>&1 \ @@ -696,7 +696,7 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" done fi ) >> "$HOME"/Reports/env-shared.log.txt 2>&1 & -) +fi ## Complete! ## From 55fa6357b30779c6a3d307a2e895cceabadcd0fe Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 19 Jun 2026 08:00:51 -0700 Subject: [PATCH 130/144] Fix updater output from showing up. --- rc_shared.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 68a578c..5dbb9dd 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -694,8 +694,8 @@ if [[ "$USER" != "root" ]]; then notify-send "$title" "$message" fi done - fi - ) >> "$HOME"/Reports/env-shared.log.txt 2>&1 & + fi >> "$HOME"/Reports/env-shared.log.txt 2>&1 & + ) fi From c7099e632c10efcc48d1b9091b06e165c8e9d563 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 26 Jun 2026 10:44:31 -0700 Subject: [PATCH 131/144] Move the folder name shortcut to its own alias and use it for qpv. --- rc_shared.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 5dbb9dd..12554d2 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -481,7 +481,8 @@ function process-video { return $status } alias pv="process-video" -alias qpv='pv ./raw/YouCut*.mp4 $(basename `pwd`).mp4' +alias fn='basename `pwd`' # Folder Name +alias qpv='pv ./raw/YouCut*.mp4 `fn`.mp4' # Quick Process Video # Allow converting video to audio and other smaller # tasks than what process-video is intended to do. From 0473f784ce405b351d4e097bce1f1adfa2d9bff1 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 30 Jun 2026 19:32:43 -0700 Subject: [PATCH 132/144] Testing some changes to process-video to see if uploads can get more compressed than we're already doing. --- rc_shared.sh | 53 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 12554d2..ac4153f 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -420,7 +420,12 @@ function process-video { if [[ -z $size ]]; then size="720" fi - size="-filter:v scale=-1:$size" + # Lanczos is good for upscaling, but this is usually used for downscaling. + if [[ ! -z "$PV_VERTICAL_ASPECT_RATIO" ]]; then + size="-filter:v scale=$size:-1" #:flags=lanczos" + else + size="-filter:v scale=-1:$size" #:flags=lanczos" + fi if [[ -z $passes ]]; then passes=1 @@ -431,15 +436,35 @@ function process-video { pass="-pass 2" fi + v2="" + if [[ ! -z "$PV_V2" ]]; then + v2="-preset veryslow -c:a aac -ar 48000" # -profile:v high + fi + + time="" + if [[ ! -z "$PV_TIME" ]]; then + time="`which time`" + fi + + quiet="-hide_banner -loglevel quiet" + if [[ ! -z "$PV_TIME" && -z "$time" ]]; then + quiet="" + fi + + if [[ ! -z "$PV_CBR" ]]; then + video="-crf 18 -preset veryslow" + fi + ## Main ## # More information on two-pass processing with ffmpeg # https://cinelerra-gg.org/download/CinelerraGG_Manual/Two_pass_Encoding_with_FFmp.html if [[ $passes == 2 ]]; then set -x - ffmpeg -nostdin -hide_banner -loglevel quiet \ + $time ffmpeg -nostdin $quiet \ -i "$file" $size $video $audio \ -filter:a "dynaudnorm=f=33:g=65:p=0.66:m=33.3" \ -vcodec libx264 -movflags +faststart \ + $v2 \ -pass 1 -f mp4 /dev/null -y status=$? set +x @@ -451,10 +476,11 @@ function process-video { fi set -x && - ffmpeg -nostdin -hide_banner -loglevel quiet \ + $time ffmpeg -nostdin $quiet \ -i "$file" $size $video $audio \ -filter:a "dynaudnorm=f=33:g=65:p=0.66:m=33.3" \ -vcodec libx264 -movflags +faststart \ + $v2 \ $pass "$newfile" status="$?" set +x @@ -477,6 +503,11 @@ function process-video { echo "ERROR: New file not created or has a 0 size." >&2 fi + unset PV_VERTICAL_ASPECT_RATIO + unset PV_V2 + unset PV_TIME + unset PV_CBR + echo -e "\n`date` - Finished with status '$status'." return $status } @@ -484,6 +515,22 @@ alias pv="process-video" alias fn='basename `pwd`' # Folder Name alias qpv='pv ./raw/YouCut*.mp4 `fn`.mp4' # Quick Process Video +alias set-pv-short='export PV_VERTICAL_ASPECT_RATIO="y" ' +alias pvs='set-pv-short; pv ' + +alias set-pv2='export PV_V2="y" ' +alias pv2='set-pv2; pv ' +alias pvs2='set-pv-short; set-pv2; pv ' + +alias set-pv-time='export PV_TIME="y" ' +alias tpv='set-tpv; pv ' +alias tpv2='set-tpv; set-pv2; pv ' +alias tpvs='set-tpv; set-pv-short; pv ' +alias tpvs2='set-tpv; set-pv-short; set-pv2; pv ' + +alias set-pv-verbose='export PV_VERBOSE="y" ' +alias set-pv-all="" + # Allow converting video to audio and other smaller # tasks than what process-video is intended to do. function basic-process-usage { From 35d21e4b7af72b0173f120fc62a9274f78f26981 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 30 Jun 2026 20:44:36 -0700 Subject: [PATCH 133/144] Finalize the new pv2 code including improvements to log output and simpler aliases. --- rc_shared.sh | 66 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index ac4153f..32a815e 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -431,14 +431,15 @@ function process-video { passes=1 fi pass="" - if [[ $passes != 1 ]]; then + if [[ $passes != 1 || ! -z "$PV_2PASS" ]]; then passes=2 pass="-pass 2" fi v2="" if [[ ! -z "$PV_V2" ]]; then - v2="-preset veryslow -c:a aac -ar 48000" # -profile:v high + v2="-crf 18 -preset veryslow -c:a aac -ar 48000" + #-profile:v high - Letting ffmpeg use the default profile. fi time="" @@ -446,13 +447,12 @@ function process-video { time="`which time`" fi - quiet="-hide_banner -loglevel quiet" - if [[ ! -z "$PV_TIME" && -z "$time" ]]; then - quiet="" + quiet="-hide_banner -loglevel warning" + if [[ ! -z "$PV_PROGRESS" ]]; then + quiet="-hide_banner -loglevel level+info" fi - - if [[ ! -z "$PV_CBR" ]]; then - video="-crf 18 -preset veryslow" + if [[ ! -z "$PV_VERBOSE" ]]; then + quiet="-loglevel level+verbose" fi ## Main ## @@ -506,7 +506,9 @@ function process-video { unset PV_VERTICAL_ASPECT_RATIO unset PV_V2 unset PV_TIME - unset PV_CBR + unset PV_PROGRESS + unset PV_VERBOSE + unset PV_2PASS echo -e "\n`date` - Finished with status '$status'." return $status @@ -515,21 +517,41 @@ alias pv="process-video" alias fn='basename `pwd`' # Folder Name alias qpv='pv ./raw/YouCut*.mp4 `fn`.mp4' # Quick Process Video -alias set-pv-short='export PV_VERTICAL_ASPECT_RATIO="y" ' -alias pvs='set-pv-short; pv ' - -alias set-pv2='export PV_V2="y" ' -alias pv2='set-pv2; pv ' -alias pvs2='set-pv-short; set-pv2; pv ' - +alias set-pv-vertical='export PV_VERTICAL_ASPECT_RATIO="y" ' alias set-pv-time='export PV_TIME="y" ' -alias tpv='set-tpv; pv ' -alias tpv2='set-tpv; set-pv2; pv ' -alias tpvs='set-tpv; set-pv-short; pv ' -alias tpvs2='set-tpv; set-pv-short; set-pv2; pv ' - +alias set-pv-progress='export PV_PROGRESS="y" ' alias set-pv-verbose='export PV_VERBOSE="y" ' -alias set-pv-all="" +alias set-pv-2pass='export PV_2PASS="y" ' +alias set-pv-v2='export PV_V2="y"; set-pv-2pass ' + +alias set-pv-vert='set-pv-vertical ' +alias set-pv2='set-pv-v2; set-pv-2pass; set-pv-progress ' + +alias pvs='set-pv-vert; pv ' +alias pv2='set-pv2; pv ' + +alias pv2s='set-pv2; set-pv-vert; pv ' +alias pvs2='pv2s ' + +function set-pv-all { + #export PV_VERTICAL_ASPECT_RATIO="y" + export PV_V2="y" + export PV_TIME="y" + export PV_PROGRESS="y" + export PV_VERBOSE="y" + export PV_2PASS="y" +} +alias set-pv-everything='set-pv-all ' + +function unset-pv-all { + unset PV_VERTICAL_ASPECT_RATIO + unset PV_V2 + unset PV_TIME + unset PV_PROGRESS + unset PV_VERBOSE + unset PV_2PASS +} +alias unset-pv-everything='unset-pv-all ' # Allow converting video to audio and other smaller # tasks than what process-video is intended to do. From 6f0189fd903074af34f7249a0bcc2ec0cba0108e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 30 Jun 2026 20:47:17 -0700 Subject: [PATCH 134/144] Add log level to quiet output too. --- rc_shared.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 32a815e..e6da525 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -447,7 +447,7 @@ function process-video { time="`which time`" fi - quiet="-hide_banner -loglevel warning" + quiet="-hide_banner -loglevel level+warning" if [[ ! -z "$PV_PROGRESS" ]]; then quiet="-hide_banner -loglevel level+info" fi From 380e64aa57d9f96669df223e0f21849f78cb7437 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 30 Jun 2026 20:51:04 -0700 Subject: [PATCH 135/144] Add shortcut for quick processing with v2. --- rc_shared.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index e6da525..45bcbc6 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -533,6 +533,8 @@ alias pv2='set-pv2; pv ' alias pv2s='set-pv2; set-pv-vert; pv ' alias pvs2='pv2s ' +alias qpv2='set-pv2; qpv ' + function set-pv-all { #export PV_VERTICAL_ASPECT_RATIO="y" export PV_V2="y" From 38d8c1fd4db7841139f0466c09d279a3810a3a31 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 1 Jul 2026 08:51:44 -0700 Subject: [PATCH 136/144] Add function which can set a vaiable to a value dynamically. --- rc_shared.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 45bcbc6..d1e2895 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -263,6 +263,24 @@ function push { fi } +function set-variable { + var="$1" + val="$2" + echo -n "export $var=\"$val\" - " + + export $var="$val" + status="$?" + + if [[ "$val" == "${!var}" ]]; then + echo "Success!" + return 0 + fi + + echo "Failed with status '$status', $var is '${!var}'." + return $status +} +alias set-var="set-variable " + # Enhance Bin Scripts # # MASTER and CLONE folders. From 5309a4d86308ff06045a76675ae1be6699e32c00 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 1 Jul 2026 16:17:11 -0700 Subject: [PATCH 137/144] Use the new set-variable function for working with pv. --- rc_shared.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index d1e2895..517ed21 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -535,12 +535,12 @@ alias pv="process-video" alias fn='basename `pwd`' # Folder Name alias qpv='pv ./raw/YouCut*.mp4 `fn`.mp4' # Quick Process Video -alias set-pv-vertical='export PV_VERTICAL_ASPECT_RATIO="y" ' -alias set-pv-time='export PV_TIME="y" ' -alias set-pv-progress='export PV_PROGRESS="y" ' -alias set-pv-verbose='export PV_VERBOSE="y" ' -alias set-pv-2pass='export PV_2PASS="y" ' -alias set-pv-v2='export PV_V2="y"; set-pv-2pass ' +alias set-pv-vertical='set-var PV_VERTICAL_ASPECT_RATIO "y" ' +alias set-pv-time='set-var PV_TIME "y" ' +alias set-pv-progress='set-var PV_PROGRESS "y" ' +alias set-pv-verbose='set-var PV_VERBOSE "y" ' +alias set-pv-2pass='set-var PV_2PASS "y" ' +alias set-pv-v2='set-var PV_V2 "y" ' alias set-pv-vert='set-pv-vertical ' alias set-pv2='set-pv-v2; set-pv-2pass; set-pv-progress ' @@ -554,12 +554,12 @@ alias pvs2='pv2s ' alias qpv2='set-pv2; qpv ' function set-pv-all { - #export PV_VERTICAL_ASPECT_RATIO="y" - export PV_V2="y" - export PV_TIME="y" - export PV_PROGRESS="y" - export PV_VERBOSE="y" - export PV_2PASS="y" + #set-var PV_VERTICAL_ASPECT_RATIO "y" + set-var PV_V2 "y" + set-var PV_TIME "y" + set-var PV_PROGRESS "y" + set-var PV_VERBOSE "y" + set-var PV_2PASS "y" } alias set-pv-everything='set-pv-all ' From 5cdb4261673a8f7872c9441122b0fb93f5e3a3e1 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 3 Jul 2026 12:49:43 -0700 Subject: [PATCH 138/144] Add output regarding how the folder is being pushed. --- rc_shared.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 517ed21..034b6d4 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -257,8 +257,10 @@ function pull { function push { if [[ -d .git ]]; then + echo "Recognized git project, promoting branch to stage and prod." git push && eval load-stage && eval load-prod else + echo "Not a git repo, attempting to sync to SFTP server." send-master fi } From e38e602d83dd0a84cffa1841dad455c30e307d14 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 3 Jul 2026 14:43:31 -0700 Subject: [PATCH 139/144] Also add more output for the pull function. --- rc_shared.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rc_shared.sh b/rc_shared.sh index 034b6d4..a1c59d0 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -249,8 +249,10 @@ function blog { echo -e "\n\n$1\n\n"; } function pull { if [[ -d .git ]]; then + echo "Recognized git project, pulling latest changes." git pull --recurse-submodules else + echo "Not a git repo, attempting to sync with SFTP server." pull-clone fi } @@ -260,7 +262,7 @@ function push { echo "Recognized git project, promoting branch to stage and prod." git push && eval load-stage && eval load-prod else - echo "Not a git repo, attempting to sync to SFTP server." + echo "Not a git repo, attempting to sync with SFTP server." send-master fi } From 2564be90a4a718a01d86f85dd3acfa75cb08213a Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 13 Jul 2026 15:10:06 -0700 Subject: [PATCH 140/144] Add a super compression function based on what YTS/YIFY may be doing. --- rc_shared.sh | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index a1c59d0..98e6034 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -545,6 +545,7 @@ alias set-pv-progress='set-var PV_PROGRESS "y" ' alias set-pv-verbose='set-var PV_VERBOSE "y" ' alias set-pv-2pass='set-var PV_2PASS "y" ' alias set-pv-v2='set-var PV_V2 "y" ' +alias set-pv-v2='set-var PV_YIFY "y" ' alias set-pv-vert='set-pv-vertical ' alias set-pv2='set-pv-v2; set-pv-2pass; set-pv-progress ' @@ -557,6 +558,75 @@ alias pvs2='pv2s ' alias qpv2='set-pv2; qpv ' +# 20260713 - Attempt at compressing videos as well as done for torrented movies. +function pv-yify { + # ffmpeg -i input.mkv -c:v libx264 -crf 27 -x264-params cabac=1:ref=5:analyse=0x133:me=umh:subme=9:chroma-me=1:deadzone-inter=21:deadzone-intra=11:b-adapt=2:rc-lookahead=60:vbv-maxrate=10000:vbv-bufsize=10000:qpmax=69:bframes=5:direct=auto:crf-max=51:weightp=2:merange=24:chroma-qp-offset=-1:sync-lookahead=2:psy-rd=1.00,0.15:trellis=2:min-keyint=23:partitions=all -c:a aac -ar 44100 -b:a 128k -map 0 output.mp4 + input="$1" + output="$2" + ratio="$3" + audio="$4" + + if [[ -z "$input" ]]; then + cat <<- EOF + Usage: pv-yify INPUT_FILE [OUTPUT_FILE] [ASPECT_RATIO] + + Examples: + + - Create file raw.mp4.pv-yify.mp4 without changing aspect ratio: + $ pv-yify raw.mp4 + + - Compress a video and ensures it is 720p: + $ pv-yify raw.mp4 compressed.mp4 1280:720 + + - Compress a video ensuring that it is 720 pixels tall: + $ pv-yify raw.mp4 vertical.mp4 720:-1 + EOF + fi + + if [[ -z "$output" ]]; then + output="$input.pv-yify.mp4" + fi + + echo -e "\n`date` - Converting '$input' with YIFY-like compression to '$output'." + + if [[ -f "$output" ]]; then + echo -e "\n`date` - Moving '$output' to TRASH." + mv -v "$output" ~/TRASH/ + fi + + if [[ -n "$ratio" ]]; then + if [[ "$ratio" != *":"* ]]; then + echo "ERROR: Optional ratio parameter needs to be like '-1:720' (horizontal) or '720:-1' (vertical)". + return 1 + fi + size="-filter:v scale=$ratio" + fi + + if [[ -z "$audio" ]]; then + audio="128k" + fi + + echo -e "\n`date` - Starting FFMPEG...\n" + set -x + ffmpeg -i "$input" \ + -hide_banner -loglevel level+warning \ + -c:v libx264 -crf 27 -c:a aac -ar 44100 -b:a "$audio" -map 0 \ + -x264-params cabac=1:ref=5:analyse=0x133:me=umh:subme=9:chroma-me=1:deadzone-inter=21:deadzone-intra=11:b-adapt=2:rc-lookahead=60:vbv-maxrate=10000:vbv-bufsize=10000:qpmax=69:bframes=5:direct=auto:crf-max=51:weightp=2:merange=24:chroma-qp-offset=-1:sync-lookahead=2:psy-rd=1.00,0.15:trellis=2:min-keyint=23:partitions=all \ + $ratio \ + "$output" + set +x + echo -e "\n`date` - Finished FFMPEG." + + echo -e "\n`date` - Syncing and checking file sizes." + sync + sleep 5 + ls -lh "$input" "$output" + + echo -e "\n`date` - Done!" +} +alias yify="pv-yify " +alias yify-pv="pv-yify " + function set-pv-all { #set-var PV_VERTICAL_ASPECT_RATIO "y" set-var PV_V2 "y" From a1898c03b53b29e003037e0c94690d98e7a60e94 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 16 Jul 2026 15:33:33 -0700 Subject: [PATCH 141/144] Move checking git projects via code-check to shared and make it generic. Code-check will reference it. --- rc_shared.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 98e6034..05a2ee1 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -825,6 +825,39 @@ alias exec-html="run-site" alias site-host="run-site" alias host-site="run-site" +function git-check { + dir="`pwd`" + if [[ -n "$1" ]]; then + dir="$1" + fi + + echo "Checking '$dir' for git changes." + ls -d "$dir"/* | while read project; do + if [[ ! -d $project ]]; then + continue + fi + echo -e "\n*** `basename $project` ***" + cd $project + if [[ -d .git ]]; then + git ls-remote --exit-code --heads origin dev + dev_exists="$?" + if [[ "$dev_exists" == 0 ]]; then + git switch dev + elif [[ "$dev_exists" == 2 ]]; then + git switch main + else + echo "ERROR: Unknown status for dev_exists, '$dev_exists'." + continue + fi + git pull + git push + else + echo "Not a Git project, skipping!" + fi + done + echo -e "\nDone!" +} + ## Finalize ## From 1ea50e600eda266745a820fa7240ea2bac0845b3 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 16 Jul 2026 15:49:15 -0700 Subject: [PATCH 142/144] Add function to check all the terminal colors of a system. --- rc_shared.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/rc_shared.sh b/rc_shared.sh index 05a2ee1..951a83f 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -825,6 +825,7 @@ alias exec-html="run-site" alias site-host="run-site" alias host-site="run-site" +# TBD: Move this to a different section? function git-check { dir="`pwd`" if [[ -n "$1" ]]; then @@ -858,6 +859,28 @@ function git-check { echo -e "\nDone!" } +# TBD: Move this to a different section? +function check-colors { + min=0 + max=255 + unset i + for (( i = min; i <= max; i++ )); do + tput setaf $i + printf "%03d" "$i" + tput sgr0 + if (( i < max )); then + printf " " + fi + done + printf "\n" +} +alias color-check="check-colors" +alias show-colors="check-colors" +alias test-colors="check-colors" +alias colors="check-colors" +alias term-colors="check-colors" +alias display-colors="check-colors" + ## Finalize ## From 8041037eda433bcc7a0ee22e795b7ffefe8faf23 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 16 Jul 2026 16:52:16 -0700 Subject: [PATCH 143/144] Properly handle terminals which do not have 256 colors. --- rc_shared.sh | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 951a83f..ac31d97 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -9,15 +9,39 @@ export PATH="$PATH:~/bin-shared:~/.bin-shared" # PS1 Colors # -export PURPLE="`tput setaf 55`" -export ORANGE="`tput setaf 208`" -export GREEN="`tput setaf 34`" +colors=`tput colors` +if (( colors >= 256 )); then + export PURPLE="`tput setaf 55`" + export ORANGE="`tput setaf 208`" + export GREEN="`tput setaf 34`" -export RED="`tput setaf 196`" -export SCARLET="`tput setaf 160`" -export YELLOW="`tput setaf 226`" + export RED="`tput setaf 196`" + export SCARLET="`tput setaf 160`" + export YELLOW="`tput setaf 226`" + + export GRAY="`tput setaf 243`" +elif (( colors == 16 )); then + export PURPLE="`tput setaf 13`" + export ORANGE="`tput setaf 11`" + export GREEN="`tput setaf 02`" + + export RED="`tput setaf 09`" + export SCARLET="`tput setaf 01`" + export YELLOW="`tput setaf 11`" + + export GRAY="`tput setaf 08`" +else + export PURPLE="`tput setaf 05`" + export ORANGE="`tput setaf 03`" + export GREEN="`tput setaf 02`" + + export RED="`tput setaf 05`" + export SCARLET="`tput setaf 01`" + export YELLOW="`tput setaf 03`" + + export GRAY="`tput setaf 07`" +fi -export GRAY="`tput setaf 243`" export RESET="`tput sgr0`" export BOLD="`tput bold`" @@ -862,8 +886,10 @@ function git-check { # TBD: Move this to a different section? function check-colors { min=0 - max=255 + max=256 unset i + echo "Current terminal supports '`tput colors`' colors." + echo "Displaying examples..." for (( i = min; i <= max; i++ )); do tput setaf $i printf "%03d" "$i" From 77300f3b8251f0c95626ef4ba8dda07fe9bed4cb Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 3 Aug 2026 11:30:25 -0700 Subject: [PATCH 144/144] clones, create the directory if it doesn't exist. --- rc_shared.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index ac31d97..dd46b5e 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -61,14 +61,15 @@ alias l='ls ' alias ll='ls -alh ' alias lh='ls -ash ' -function cl { +function clones { + export CLONES_PATH="$HOME/Clones" if [[ -d /sdcard ]]; then - cd /sdcard/Library/Clones - else - cd $HOME/Clones + export CLONES_PATH="/sdcard/Library/Clones" fi + mkdir -pv "$CLONES_PATH" + cd "$CLONES_PATH" } -alias clones="cl" +alias cl="clones" alias cdl="cl" alias cdc="cl"