Auto commit from /home/doc/genesis-tools

This commit is contained in:
DocTator 2025-04-24 08:45:07 -04:00
parent b64bde9d81
commit 77463904be
15 changed files with 36094 additions and 6 deletions

View File

@ -4,7 +4,7 @@ from mastodon import Mastodon
# === Configuration ===
ROOT_DIR = r"/mnt/convert/archives" # Update this path to where your shows live
ROOT_DIR = r"/mnt/archives" # Update this path to where your shows live
ALLOWED_EXTENSIONS = {".mp3", ".wav", ".flac", ".m4a"}
BANNER_FILENAMES = ["banner.jpg", "banner.png", "banner.jpeg"]

35905
miscellaneous/cron_backup.log Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,7 @@ PG_REMOTE_PORT="5432"
PG_LOCAL_PORT="5432"
DUMP_DIR="/tmp/pgbackup_verify"
BACKUP_TARGET="root@thevault.bounceme.net:/mnt/backup3/pgdumps"
CC_TARGET="doc@clustercontrol.sshjunkie.com:/home/doc/backups"
DBS=("mastodon_production" "giteaprod")
LOGFILE="$DUMP_DIR/verify_log_$(date +%Y%m%d_%H%M%S).txt"
mkdir -p "$DUMP_DIR"
@ -78,10 +79,19 @@ if $ALL_OK && [ "${#UPLOAD_LIST[@]}" -eq "${#DBS[@]}" ]; then
echo "All dumps verified, sending to $BACKUP_TARGET" | tee -a "$LOGFILE"
scp "${UPLOAD_LIST[@]}" "$BACKUP_TARGET"
if [ $? -eq 0 ]; then
echo "Uploads successful." | tee -a "$LOGFILE"
echo "Uploads to thevault successful." | tee -a "$LOGFILE"
# --NEW: Also upload to ClusterControl controller
echo "Uploading to ClusterControl controller at $CC_TARGET" | tee -a "$LOGFILE"
scp "${UPLOAD_LIST[@]}" "$CC_TARGET"
if [ $? -eq 0 ]; then
echo "Uploads to ClusterControl successful." | tee -a "$LOGFILE"
rm -f "${UPLOAD_LIST[@]}"
else
echo "Upload failed!" | tee -a "$LOGFILE"
echo "[WARN] Upload to ClusterControl controller failed!" | tee -a "$LOGFILE"
mastodon_alert "⚠️ Database backup verified, but upload to ClusterControl at $CC_TARGET failed on $(hostname) at $(date). See log: $LOGFILE"
fi
else
echo "[FAIL] Upload to thevault failed!" | tee -a "$LOGFILE"
mastodon_alert "🚨 Database backup/verify FAILED: Upload to $BACKUP_TARGET failed on $(hostname) at $(date). See log: $LOGFILE"
fi
else

20
miscellaneous/freezer.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
# Find all venvs, freeze their packages to requirements.txt
BASE_DIR="$HOME" # Or wherever your projects are
echo "Scanning for venvs under $BASE_DIR ..."
find "$BASE_DIR" -type f -name "pyvenv.cfg" 2>/dev/null | while read cfg; do
venv_dir="$(dirname "$cfg")"
reqfile="$venv_dir/requirements.txt"
echo "🔒 Freezing $venv_dir$reqfile"
"$venv_dir/bin/python" -m pip freeze > "$reqfile"
if [ $? -eq 0 ]; then
echo "✅ Done: $reqfile"
else
echo "❌ Failed to freeze $venv_dir"
fi
done
echo "All venvs processed!"

48
miscellaneous/freezermove.sh Executable file
View File

@ -0,0 +1,48 @@
#!/bin/bash
SRC_ROOT="/home/doc"
TARGET_DIR="/home/doc/genesis-tools/venvrequirements"
DRY_RUN=0
if [[ "$1" == "--dry-run" ]]; then
DRY_RUN=1
echo "Dry run mode enabled: No files will be created or copied."
fi
echo "Scanning for venvs in $SRC_ROOT ..."
found_any=0
for dir in "$SRC_ROOT"/*/; do
venv_name=$(basename "$dir")
req_file="${dir}requirements.txt"
dest_file="$TARGET_DIR/requirements_${venv_name}.txt"
# Only proceed if it's a directory and requirements.txt exists
if [[ -d "$dir" && -f "$req_file" ]]; then
found_any=1
echo "Found: $req_file"
echo "→ Would copy to: $dest_file"
if [[ -f "$dest_file" ]]; then
echo " [SKIP] $dest_file already exists. Skipping."
else
if [[ "$DRY_RUN" -eq 1 ]]; then
echo " [DRY RUN] Would copy $req_file$dest_file"
else
cp "$req_file" "$dest_file"
echo " [OK] Copied $req_file$dest_file"
fi
fi
echo ""
fi
done
if [[ "$found_any" -eq 0 ]]; then
echo "No requirements.txt files found in $SRC_ROOT!"
fi
if [[ "$DRY_RUN" -eq 1 ]]; then
echo "All requirements processed. (Dry run mode)"
else
echo "All requirements copied and organized."
fi

View File

@ -7,10 +7,10 @@ from datetime import datetime
# Function to record the radio show using ffmpeg
def record_show(folder_name, duration, filename_prefix):
# Set the working directory for the recording
working_directory = "/mnt/convert/Genesis Radio"
working_directory = "home/doc/Genesis Radio"
# Ensure the folder exists in archives with the prefix as the folder name
archives_directory = "/mnt/convert/archives"
archives_directory = "/mnt/archives"
target_folder = os.path.join(archives_directory, filename_prefix)
if not os.path.exists(target_folder):
os.makedirs(target_folder)

View File

@ -0,0 +1,24 @@
blinker==1.9.0
blurhash==1.1.4
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
decorator==5.2.1
Flask==3.1.0
Flask-SQLAlchemy==3.1.1
greenlet==3.2.0
idna==3.10
itsdangerous==2.2.0
Jinja2==3.1.6
MarkupSafe==3.0.2
Mastodon.py==2.0.1
psycopg2-binary==2.9.10
python-dateutil==2.9.0.post0
python-magic==0.4.27
requests==2.32.3
six==1.17.0
SQLAlchemy==2.0.40
typing_extensions==4.13.2
urllib3==2.4.0
watchdog==6.0.0
Werkzeug==3.1.3

View File

@ -0,0 +1,5 @@
certifi==2025.1.31
charset-normalizer==3.4.1
idna==3.10
requests==2.32.3
urllib3==2.4.0

View File

@ -0,0 +1,12 @@
bcrypt==4.3.0
certifi==2025.1.31
cffi==1.17.1
charset-normalizer==3.4.1
cryptography==44.0.2
idna==3.10
paramiko==3.5.1
psycopg2-binary==2.9.10
pycparser==2.22
PyNaCl==1.5.0
requests==2.32.3
urllib3==2.4.0

View File

@ -0,0 +1,22 @@
blinker==1.9.0
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
Flask==3.1.0
idna==3.10
itsdangerous==2.2.0
Jinja2==3.1.6
linkify-it-py==2.0.3
markdown-it-py==3.0.0
MarkupSafe==3.0.2
mdit-py-plugins==0.4.2
mdurl==0.1.2
platformdirs==4.3.7
Pygments==2.19.1
requests==2.32.3
rich==14.0.0
textual==3.1.0
typing_extensions==4.13.2
uc-micro-py==1.0.3
urllib3==2.4.0
Werkzeug==3.1.3

View File

View File

@ -0,0 +1,9 @@
APScheduler==3.11.0
blinker==1.9.0
click==8.1.8
Flask==3.1.0
itsdangerous==2.2.0
Jinja2==3.1.6
MarkupSafe==3.0.2
tzlocal==5.3.1
Werkzeug==3.1.3

View File

View File

@ -0,0 +1,33 @@
alembic==1.13.2
blinker==1.8.2
blurhash==1.1.4
certifi==2024.7.4
charset-normalizer==3.3.2
click==8.1.7
decorator==5.1.1
dnspython==2.6.1
email_validator==2.2.0
Flask==3.0.3
Flask-Login==0.6.3
Flask-Migrate==4.0.7
Flask-SQLAlchemy==3.1.1
Flask-WTF==1.2.1
greenlet==3.0.3
idna==3.7
itsdangerous==2.2.0
Jinja2==3.1.4
Mako==1.3.5
MarkupSafe==2.1.5
Mastodon.py==1.8.1
psycopg2-binary==2.9.9
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
python-magic==0.4.27
requests==2.32.3
schedule==1.2.2
six==1.16.0
SQLAlchemy==2.0.31
typing_extensions==4.12.2
urllib3==2.2.2
Werkzeug==3.0.3
WTForms==3.1.2

View File