Auto-commit from giteapush.sh at 2025-05-07 03:45:46
This commit is contained in:
parent
2d6f15179c
commit
e6507ab698
50
genesishostingmd/dns-check
Normal file
50
genesishostingmd/dns-check
Normal file
@ -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
|
@ -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
|
107
miscellaneous/bash/health.sh
Executable file
107
miscellaneous/bash/health.sh
Executable file
@ -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."
|
@ -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"
|
||||
|
@ -70,7 +70,7 @@
|
||||
]
|
||||
},
|
||||
"gog": {
|
||||
"recording": true,
|
||||
"recording": false,
|
||||
"duration": 10800,
|
||||
"schedule": [
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user