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>
31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
import socket
|
|
import sys
|
|
|
|
import paramiko
|
|
|
|
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
|
|
HOST = "192.227.152.110"
|
|
DOMAIN = "ypp.smallzhiyuns.com"
|
|
|
|
print("DNS", DOMAIN, "->", socket.getaddrinfo(DOMAIN, 443, type=socket.SOCK_STREAM)[0][4][0])
|
|
print("TCP 22", end=" ")
|
|
s = socket.create_connection((HOST, 22), 15)
|
|
print("ok", s.getpeername())
|
|
s.close()
|
|
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect(HOST, 22, "root", "Leaf448772566", timeout=30, allow_agent=False, look_for_keys=False)
|
|
_, o, e = c.exec_command(
|
|
"uname -a; echo ---; cat /etc/os-release | head -6; echo ---; df -h / | tail -1; echo ---; "
|
|
"free -h | head -2; echo ---; nproc; echo ---; ss -lntp | head -30; echo ---; "
|
|
"command -v git; command -v python3; command -v node; command -v caddy; command -v ffmpeg; "
|
|
"command -v docker; echo ---; ls /opt 2>/dev/null; echo ---; timedatectl | head -5",
|
|
timeout=30,
|
|
)
|
|
print(o.read().decode("utf-8", "replace"))
|
|
print(e.read().decode("utf-8", "replace"))
|
|
c.close()
|