#!/usr/bin/env python3 import paramiko, sys sys.stdout.reconfigure(encoding="utf-8", errors="replace") client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect("107.173.30.245", username="root", password="Xiao4669805", timeout=20) cmds = [ "ls -la /var/www/ebook/.next/standalone/.next/server/app/api/pay/invoice/", "python3 - <<'PY'\nimport json\np='/var/www/ebook/.next/standalone/.next/app-path-routes-manifest.json'\ntry:\n print(open(p).read()[:2000])\nexcept Exception as e:\n print('no manifest', e)\nPY", "curl -s -o /dev/null -w 'thanks:%{http_code} get_invoice:%{http_code}\\n' http://127.0.0.1:3000/support/thanks http://127.0.0.1:3000/api/pay/invoice", "curl -s -o /dev/null -w 'thanks:%{http_code}\\n' http://127.0.0.1:3000/support/thanks", "curl -s -o /dev/null -w 'get_inv:%{http_code}\\n' http://127.0.0.1:3000/api/pay/invoice", "ss -tlnp | grep 3000", "pm2 describe ebook | head -40", ] for c in cmds: print("===", c[:80]) _, stdout, stderr = client.exec_command(c, timeout=30) print(stdout.read().decode("utf-8", errors="replace")) err = stderr.read().decode("utf-8", errors="replace") if err.strip(): print("ERR", err[:500]) client.close()