From e6507ab698b31ad5d03d9166766877966b8055d3 Mon Sep 17 00:00:00 2001 From: DocTator Date: Wed, 7 May 2025 03:45:46 -0400 Subject: [PATCH] Auto-commit from giteapush.sh at 2025-05-07 03:45:46 --- genesishostingmd/dns-check | 50 ++++++++++++++ miscellaneous/bash/db1_backup.sh | 44 ------------ miscellaneous/bash/health.sh | 107 +++++++++++++++++++++++++++++ miscellaneous/bash/sync-trigger.sh | 2 +- recordtheshow/show_schedule.json | 4 +- 5 files changed, 160 insertions(+), 47 deletions(-) create mode 100644 genesishostingmd/dns-check delete mode 100755 miscellaneous/bash/db1_backup.sh create mode 100755 miscellaneous/bash/health.sh diff --git a/genesishostingmd/dns-check b/genesishostingmd/dns-check new file mode 100644 index 0000000..14f5537 --- /dev/null +++ b/genesishostingmd/dns-check @@ -0,0 +1,50 @@ +# 🌐 DNS Access Issues – Troubleshooting Guide + +If you're having trouble reaching **Genesis Radio** or the stream won't load, the issue may be with your DNS provider (the service that turns domain names into IP addresses). + +This happens more often than you'd think — and it's easy to fix. + +--- + +## ✅ Quick Fix: Change Your DNS + +We recommend switching to one of these trusted, fast, privacy-respecting DNS providers: + +| Provider | DNS Servers | +|--------------|-----------------------------| +| **Google** | `8.8.8.8` and `8.8.4.4` | +| **Cloudflare** | `1.1.1.1` and `1.0.0.1` | +| **Quad9** | `9.9.9.9` | + +--- + +## 💻 How to Change Your DNS + +### Windows 10/11 +1. Open **Settings → Network & Internet** +2. Click **Change adapter options** +3. Right-click your active connection → **Properties** +4. Select **Internet Protocol Version 4 (TCP/IPv4)** → Click **Properties** +5. Choose **"Use the following DNS server addresses"** +6. Enter: + - Preferred: `1.1.1.1` + - Alternate: `8.8.8.8` +7. Save and reconnect + +--- + +### macOS +1. Go to **System Preferences → Network** +2. Select your active network → Click **Advanced** +3. Go to the **DNS** tab +4. Click `+` and add: + - `1.1.1.1` + - `8.8.8.8` +5. Apply changes and reconnect + +--- + +### Linux (CLI) +For a quick test: +```bash +sudo resolvectl dns eth0 1.1.1.1 8.8.8.8 diff --git a/miscellaneous/bash/db1_backup.sh b/miscellaneous/bash/db1_backup.sh deleted file mode 100755 index 7abcc80..0000000 --- a/miscellaneous/bash/db1_backup.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# Variables -SOURCE_DIR="/tmp/db1_backup/" -DEST_DIR="thevault:/nexus/postgresql/db1/" -DATE=$(date +%Y%m%d%H%M) -PG_USER="postgres" -SOURCE_SERVER="zcluster.technodrome1.sshjunkie.com" # Source server (database server) -SOURCE_REMOTE="technodrome1" # rclone remote for source server (configured earlier) -DEST_REMOTE="thevault" # rclone remote for destination server (The Vault) - -# Step 1: SSH into the database server and run pg_basebackup -echo "Starting pg_basebackup for db1 on $SOURCE_SERVER..." - -ssh doc@$SOURCE_SERVER "pg_basebackup -h localhost -D $SOURCE_DIR$DATE -U $PG_USER -Ft -z -P" - -# Check if pg_basebackup was successful -if [ $? -eq 0 ]; then - echo "pg_basebackup completed successfully. Proceeding to rclone transfer..." - - # Step 2: Use rclone to copy the backup from the source server to The Vault - rclone copy $SOURCE_REMOTE:$SOURCE_DIR$DATE/ $DEST_REMOTE:$DEST_DIR --progress --checksum - - # Check if rclone was successful - if [ $? -eq 0 ]; then - echo "Rclone transfer completed successfully. Proceeding to snapshot..." - - # Step 3: Create a ZFS snapshot on The Vault - ssh root@thevault.sshjunkie.com "sudo zfs snapshot nexus/postgresql/db1@$DATE" - - # Verify snapshot creation on The Vault - if [ $? -eq 0 ]; then - echo "ZFS snapshot nexus/postgresql/db1@$DATE created successfully on The Vault." - else - echo "Error creating ZFS snapshot on The Vault." - fi - else - echo "Error during rclone transfer. Backup not transferred." - exit 1 - fi -else - echo "Error during pg_basebackup. Backup not created." - exit 1 -fi diff --git a/miscellaneous/bash/health.sh b/miscellaneous/bash/health.sh new file mode 100755 index 0000000..07efab7 --- /dev/null +++ b/miscellaneous/bash/health.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +# List of servers (replace these with your actual server hostnames or IPs) +servers=("thevault.sshjunkie.com" "zcluster.technodrome1.sshjunkie.com" "zcluster.technodrome2.sshjunkie.com" "shredder.sshjunkie.com" "root@chatwithus.live") # Add as many servers as needed + +# Define log file +log_file="/home/doc/system_health_report_$(date +%F).log" + +# Telegram Bot API Token and Chat ID +BOT_TOKEN="8178867489:AAH0VjN7VnZSCIWasSz_y97iBLLjPJA751k" +CHAT_ID="1559582356" +TELEGRAM_API="https://api.telegram.org/bot$BOT_TOKEN/sendMessage" + +# Function to escape Markdown special characters +escape_markdown() { + echo "$1" | sed 's/\([_*[]\)/\\\1/g' # Escape _, *, [, and ] +} + +# Function to send the report to Telegram +send_to_telegram() { + local message=$1 + local chunk_size=4096 + local start=0 + local end=$chunk_size + + while [ ${#message} -gt $start ]; do + chunk="${message:$start:$chunk_size}" + curl -s -X POST $TELEGRAM_API \ + -d chat_id=$CHAT_ID \ + -d text="$chunk" \ + -d parse_mode="Markdown" + start=$end + end=$((start + chunk_size)) + done +} + +# Function to run the checks on each server +check_health() { + server=$1 + server_report="=== Health Check for $server ===\n" + + # Memory Usage (summary) + memory_output=$(ssh $server "free -h") + free_memory=$(echo "$memory_output" | awk 'NR==2 {print $4}') + if [[ "$free_memory" < "1.0Gi" ]]; then + server_report+="Memory: Low memory available! Only $free_memory free, consider adding more RAM.\n" + else + server_report+="Memory: Sufficient memory available ($free_memory free).\n" + fi + + # Swap Usage (summary) + swap_output=$(ssh $server "swapon -s") + swap_used=$(echo "$swap_output" | awk '{if(NR>1) print $3}') + if [[ "$swap_used" > "1Gi" ]]; then + server_report+="Swap: High swap usage ($swap_used used). This may indicate memory pressure.\n" + else + server_report+="Swap: Minimal swap usage ($swap_used used).\n" + fi + + # CPU Load (summary) + cpu_output=$(ssh $server "uptime") + load_avg=$(echo "$cpu_output" | awk '{print $10}' | sed 's/,//') + if (( $(echo "$load_avg > 2.0" | bc -l) )); then + server_report+="CPU Load: High load average ($load_avg). Check if any processes are consuming too much CPU.\n" + else + server_report+="CPU Load: Normal load average ($load_avg).\n" + fi + + # Disk Space (summary) + disk_output=$(ssh $server "df -h") + disk_free=$(echo "$disk_output" | grep -v 'tmpfs' | grep -v 'Filesystem' | awk '{print $4}' | sed 's/[A-Za-z]*//g' | head -n 1) + if [[ "$disk_free" < "10G" ]]; then + server_report+="Disk Space: Low disk space! Only $disk_free free. Consider cleaning up or adding storage.\n" + else + server_report+="Disk Space: Sufficient disk space ($disk_free free).\n" + fi + + # Service Check (example: check if Apache is running) + apache_status=$(ssh $server "systemctl is-active apache2") + if [[ "$apache_status" == "active" ]]; then + server_report+="Apache: Running normally.\n" + else + server_report+="Apache: Not running. Check service logs for issues.\n" + fi + + # Additional Checks (summary: disk I/O, uptime) + iostat_output=$(ssh $server "iostat | head -n 2") # Get summary of disk I/O + uptime_output=$(ssh $server "uptime") + server_report+="Disk I/O: $iostat_output\n" + server_report+="Uptime: $uptime_output\n" + + # Escape Markdown special characters + escaped_report=$(escape_markdown "$server_report") + + # Send the server-specific summary to Telegram + send_to_telegram "$escaped_report" + + # Separator for readability in log file + echo -e "\n=====================\n" >> $log_file +} + +# Main loop to go through each server +for server in "${servers[@]}"; do + check_health $server +done + +echo "Health check completed. Reports sent to Telegram and saved to $log_file." diff --git a/miscellaneous/bash/sync-trigger.sh b/miscellaneous/bash/sync-trigger.sh index b1c30f3..fff1f67 100755 --- a/miscellaneous/bash/sync-trigger.sh +++ b/miscellaneous/bash/sync-trigger.sh @@ -9,7 +9,7 @@ LOG_TAG="[Krang → SPL Sync]" # === Mastodon Alert Settings === MASTODON_INSTANCE="https://chatwithus.live" ACCESS_TOKEN="07w3Emdw-cv_TncysrNU8Ed_sHJhwtnvKmnLqKlHmKA" -TOOT_VISIBILITY="unlisted" +TOOT_VISIBILITY="public" # === Telegram Settings === TELEGRAM_BOT_TOKEN="8178867489:AAH0VjN7VnZSCIWasSz_y97iBLLjPJA751k" diff --git a/recordtheshow/show_schedule.json b/recordtheshow/show_schedule.json index d8c10f7..359103f 100755 --- a/recordtheshow/show_schedule.json +++ b/recordtheshow/show_schedule.json @@ -70,7 +70,7 @@ ] }, "gog": { - "recording": true, + "recording": false, "duration": 10800, "schedule": [ { @@ -243,4 +243,4 @@ } ] } -} +} \ No newline at end of file