scc: Session save and push from Mikes-MacBook-Air.local at 2026-04-19 08:34:23

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-04-19 08:34:23 -07:00
parent a8692a9074
commit 41b7648133
7 changed files with 1037 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
SSH Key to Add to OwnCloud VM
=====================================
SSH Public Key:
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDrGbr4EwvQ4P3ZtyZW3ZKkuDQOMbqyAQUul2+JE4K4S azcomputerguru@local
=====================================
Instructions - Run on OwnCloud VM Console:
=====================================
# 1. Access OwnCloud VM via Jupiter WebGUI
# http://172.16.3.20 → VMs → OwnCloud → VNC
# 2. Login as root / Paper123!@#-unifi!
# 3. Create .ssh directory if it doesn't exist
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# 4. Add the SSH key (paste the following command):
cat << 'EOF' >> ~/.ssh/authorized_keys
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDrGbr4EwvQ4P3ZtyZW3ZKkuDQOMbqyAQUul2+JE4K4S azcomputerguru@local
EOF
# 5. Set correct permissions
chmod 600 ~/.ssh/authorized_keys
# 6. Verify key was added
cat ~/.ssh/authorized_keys
# 7. Ensure SSH is running and enabled
systemctl enable sshd --now
systemctl status sshd
# 8. Check firewall (if needed)
firewall-cmd --list-all
# If SSH not allowed:
# firewall-cmd --permanent --add-service=ssh
# firewall-cmd --reload
# 9. Exit console
exit
=====================================
Test SSH Access After Adding Key:
=====================================
From your Mac, run:
ssh -i ~/.ssh/id_ed25519 root@172.16.3.22
Should connect without password!
=====================================

62
temp/check_cleanup_status.sh Executable file
View File

@@ -0,0 +1,62 @@
#!/bin/bash
################################################################################
# Pavon Cleanup Status Checker
# Quick script to check deletion progress
################################################################################
echo "Checking Pavon cleanup status..."
echo ""
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@172.16.1.33 '
echo "==================================================================="
echo "PAVON CLEANUP STATUS"
echo "==================================================================="
echo ""
# Check if cleanup is running
if ps aux | grep -q "[p]avon_cleanup.sh"; then
echo "[RUNNING] Cleanup process is active"
echo ""
# Count deleted files
deleted=$(grep -c "Deleted:" /root/cleanup_logs/cleanup_*.log 2>/dev/null | awk "{sum+=\$1} END {print sum}")
echo "Files deleted: $deleted / 184,120"
percent=$(echo "scale=1; $deleted * 100 / 184120" | bc)
echo "Progress: $percent%"
echo ""
# Show current disk usage
echo "Current disk usage:"
df -h /mnt/user | tail -1
echo ""
# Show recent activity
echo "Recent deletions:"
tail -5 $(ls -t /root/cleanup_logs/cleanup_*.log | head -1)
else
echo "[COMPLETE] Cleanup process finished"
echo ""
# Show final results
latest_log=$(ls -t /root/cleanup_logs/cleanup_*.log | head -1)
echo "Final log: $latest_log"
echo ""
# Count total deleted
deleted=$(grep -c "Deleted:" $latest_log 2>/dev/null)
echo "Total files deleted: $deleted"
echo ""
# Show final disk usage
echo "Final disk usage:"
df -h /mnt/user | tail -1
echo ""
# Check for errors
errors=$(grep -c "Failed:" $latest_log 2>/dev/null)
echo "Failed deletions: $errors"
fi
echo "==================================================================="
' 2>&1

45
temp/owncloud_vm_setup.sh Normal file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
################################################################################
# OwnCloud VM Setup - Install SMB Client
# Run from Jupiter Unraid server
################################################################################
echo "Connecting to OwnCloud VM console..."
echo "Commands to run in the VM console:"
echo ""
echo "==================================================================="
cat << 'VMCMDS'
# Login as root / Paper123!@#-unifi!
# 1. Check if SSH is running
systemctl status sshd
# 2. If not running, start it
systemctl enable sshd --now
# 3. Install SMB client packages
dnf install -y samba-client cifs-utils
# 4. Verify installation
which smbclient
rpm -qa | grep samba
# 5. Restart Apache/httpd for OwnCloud
systemctl restart httpd
# 6. Check OwnCloud service
systemctl status httpd
# 7. Exit console
exit
VMCMDS
echo "==================================================================="
echo ""
echo "Access VM console via:"
echo " Option 1: Jupiter WebGUI (http://172.16.3.20) → VMs → OwnCloud → VNC"
echo " Option 2: Run below command on Jupiter:"
echo ""
echo "ssh root@172.16.3.20 'virsh console OwnCloud'"
echo ""
echo "After installation, refresh OwnCloud admin page."
echo "SMB/CIFS should appear in External Storage dropdown."

291
temp/pavon_cleanup.sh Executable file
View File

@@ -0,0 +1,291 @@
#!/bin/bash
################################################################################
# Pavon Archive Cleanup Script
# Purpose: Delete camera footage older than 3 years (before April 2023)
# Server: 172.16.1.33 (Pavon Unraid)
# Expected Recovery: 25.2TB
# Date: April 12, 2026
################################################################################
# Configuration
BASE_PATH="/mnt/user/Storage"
LOG_DIR="/root/cleanup_logs"
LOG_FILE="${LOG_DIR}/cleanup_$(date +%Y%m%d_%H%M%S).log"
DRY_RUN=1 # 1 = dry-run (preview only), 0 = actual deletion
# Color codes for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Periods to delete (before April 2023)
PERIODS=(
"202212:Dec 2022"
"202301:Jan 2023"
"202302:Feb 2023"
"202303:Mar 2023"
)
################################################################################
# Functions
################################################################################
log() {
echo -e "${GREEN}[$(date '+%Y-%m-%d %H:%M:%S')]${NC} $1" | tee -a "$LOG_FILE" >&2
}
log_warn() {
echo -e "${YELLOW}[$(date '+%Y-%m-%d %H:%M:%S')] WARNING:${NC} $1" | tee -a "$LOG_FILE" >&2
}
log_error() {
echo -e "${RED}[$(date '+%Y-%m-%d %H:%M:%S')] ERROR:${NC} $1" | tee -a "$LOG_FILE" >&2
}
log_info() {
echo -e "${BLUE}[$(date '+%Y-%m-%d %H:%M:%S')] INFO:${NC} $1" | tee -a "$LOG_FILE" >&2
}
# Initialize logging
init_logging() {
mkdir -p "$LOG_DIR"
log "==================================================================="
log "Pavon Archive Cleanup Script - Started"
log "==================================================================="
log "Base Path: $BASE_PATH"
log "Mode: $([ $DRY_RUN -eq 1 ] && echo 'DRY-RUN (preview only)' || echo 'LIVE DELETION')"
log "Log File: $LOG_FILE"
log "-------------------------------------------------------------------"
}
# Calculate total size for a period
calculate_period_size() {
local pattern=$1
local description=$2
log_info "Scanning: $description (pattern: Event${pattern}*.avi)"
local file_count=0
local total_size=0
# Count files and calculate size
while IFS= read -r file; do
((file_count++))
done < <(find "$BASE_PATH"/cam* -type f -name "Event${pattern}*.avi" 2>/dev/null)
if [ $file_count -gt 0 ]; then
total_size=$(find "$BASE_PATH"/cam* -type f -name "Event${pattern}*.avi" -exec du -ch {} + 2>/dev/null | tail -1 | cut -f1)
else
total_size="0"
fi
log_info " Files: $file_count"
log_info " Size: $total_size"
echo "$file_count:$total_size"
}
# Preview what will be deleted
preview_deletion() {
log "==================================================================="
log "DELETION PREVIEW"
log "==================================================================="
local grand_total_files=0
local grand_total_size_kb=0
for period in "${PERIODS[@]}"; do
IFS=':' read -r pattern description <<< "$period"
log ""
log "--- $description ---"
result=$(calculate_period_size "$pattern" "$description")
IFS=':' read -r file_count total_size <<< "$result"
grand_total_files=$((grand_total_files + file_count))
# Show sample files
log_info "Sample files to be deleted:"
find "$BASE_PATH"/cam* -type f -name "Event${pattern}*.avi" 2>/dev/null | head -5 | while read -r file; do
size=$(du -h "$file" 2>/dev/null | cut -f1)
log_info " $size - $(basename "$file")"
done
done
log ""
log "==================================================================="
log "SUMMARY"
log "==================================================================="
log "Total files to delete: $grand_total_files"
log "Expected space recovery: 25.2TB (calculated from audit)"
log "==================================================================="
}
# Delete files for a specific period
delete_period() {
local pattern=$1
local description=$2
log ""
log "==================================================================="
log "Processing: $description"
log "==================================================================="
local deleted_count=0
local failed_count=0
local deleted_size=0
# Find and delete files
while IFS= read -r file; do
if [ $DRY_RUN -eq 1 ]; then
log_info "[DRY-RUN] Would delete: $file"
((deleted_count++))
else
size=$(stat -f%z "$file" 2>/dev/null || stat -c%s "$file" 2>/dev/null)
if rm -f "$file" 2>/dev/null; then
log_info "Deleted: $file"
((deleted_count++))
deleted_size=$((deleted_size + size))
# Progress indicator every 1000 files
if [ $((deleted_count % 1000)) -eq 0 ]; then
log "Progress: $deleted_count files deleted..."
fi
else
log_error "Failed to delete: $file"
((failed_count++))
fi
fi
done < <(find "$BASE_PATH"/cam* -type f -name "Event${pattern}*.avi" 2>/dev/null)
log "-------------------------------------------------------------------"
log "$description Complete:"
log " Deleted: $deleted_count files"
if [ $DRY_RUN -eq 0 ]; then
log " Failed: $failed_count files"
log " Space freed: $(numfmt --to=iec-i --suffix=B $deleted_size 2>/dev/null || echo 'N/A')"
fi
log "-------------------------------------------------------------------"
echo "$deleted_count:$failed_count:$deleted_size"
}
# Clean up empty directories
cleanup_empty_dirs() {
if [ $DRY_RUN -eq 1 ]; then
log_info "[DRY-RUN] Would clean up empty directories"
return
fi
log ""
log "==================================================================="
log "Cleaning up empty directories"
log "==================================================================="
local removed_dirs=0
for cam_dir in "$BASE_PATH"/cam*; do
if [ -d "$cam_dir" ]; then
# Remove empty date directories
find "$cam_dir" -type d -empty -delete 2>/dev/null
((removed_dirs++))
fi
done
log "Empty directories cleaned: $removed_dirs camera folders checked"
}
# Main execution
main() {
init_logging
# Verify base path exists
if [ ! -d "$BASE_PATH" ]; then
log_error "Base path does not exist: $BASE_PATH"
exit 1
fi
# Show preview
preview_deletion
# If dry-run, stop here
if [ $DRY_RUN -eq 1 ]; then
log ""
log "==================================================================="
log "DRY-RUN COMPLETE - No files were deleted"
log "==================================================================="
log "To execute actual deletion, edit this script and set: DRY_RUN=0"
log "Or run with: DRY_RUN=0 $0"
log "==================================================================="
exit 0
fi
# Confirm before deletion
log ""
log_warn "==================================================================="
log_warn "FINAL CONFIRMATION REQUIRED"
log_warn "==================================================================="
log_warn "This will PERMANENTLY delete approximately 25.2TB of data"
log_warn "Files from: Dec 2022 - Mar 2023"
log_warn ""
read -p "Type 'DELETE' to confirm: " confirmation
if [ "$confirmation" != "DELETE" ]; then
log_error "Deletion cancelled by user"
exit 1
fi
# Execute deletion
log ""
log "==================================================================="
log "STARTING DELETION PROCESS"
log "==================================================================="
local grand_total_deleted=0
local grand_total_failed=0
local grand_total_size=0
for period in "${PERIODS[@]}"; do
IFS=':' read -r pattern description <<< "$period"
result=$(delete_period "$pattern" "$description")
IFS=':' read -r deleted failed size <<< "$result"
grand_total_deleted=$((grand_total_deleted + deleted))
grand_total_failed=$((grand_total_failed + failed))
grand_total_size=$((grand_total_size + size))
done
# Clean up empty directories
cleanup_empty_dirs
# Final summary
log ""
log "==================================================================="
log "DELETION COMPLETE"
log "==================================================================="
log "Total files deleted: $grand_total_deleted"
log "Total files failed: $grand_total_failed"
log "Total space freed: $(numfmt --to=iec-i --suffix=B $grand_total_size 2>/dev/null || echo 'N/A')"
log "Log file: $LOG_FILE"
log "==================================================================="
# Show new disk usage
log ""
log "Updated disk usage:"
df -h "$BASE_PATH" | tee -a "$LOG_FILE"
}
################################################################################
# Script execution
################################################################################
# Allow override via environment variable
if [ -n "$DRY_RUN" ]; then
DRY_RUN=$DRY_RUN
fi
main "$@"

18
temp/scan_mac.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
# Scan for MAC address ending in B8:56
echo "[INFO] Scanning local network for MAC ending in B8:56..."
echo "[INFO] Current subnet: 192.168.0.0/24"
echo ""
# Get ARP cache
arp -a | grep -i "b8:56" > /tmp/mac_result.txt
if [ -s /tmp/mac_result.txt ]; then
echo "[SUCCESS] Found device(s):"
cat /tmp/mac_result.txt
else
echo "[INFO] No device with MAC ending in B8:56 found in current ARP cache"
echo "[INFO] Showing all ARP entries:"
arp -a
fi