Capture Neko/WG/network hubs, Studio viewer charts, physical deploy docs, and one-shot scripts so VPS vs physical can be toggled later without losing WIP. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
796 B
Python
25 lines
796 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
import sys
|
|
import paramiko
|
|
|
|
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect("82.157.112.245", 22, "ubuntu", "Xiao4669805", timeout=45, allow_agent=False, look_for_keys=False)
|
|
_, o, e = c.exec_command(
|
|
"""
|
|
sudo iptables -t nat -S PREROUTING | grep -E 'NEKO|5230|5200' | head -20
|
|
echo ---POST---
|
|
sudo iptables -t nat -S POSTROUTING | grep NEKO | head -5
|
|
echo ---FWD---
|
|
sudo iptables -S FORWARD | grep NEKO | head -5
|
|
echo ---probe---
|
|
timeout 2 bash -c 'echo >/dev/tcp/10.9.0.2/52300' && echo TCP_OK || echo TCP_FAIL
|
|
sudo ufw status | grep -E '5230|5200|5210|5220' | head -15
|
|
""",
|
|
timeout=40,
|
|
)
|
|
print((o.read() + e.read()).decode())
|
|
c.close()
|