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>
38 lines
1.5 KiB
Python
38 lines
1.5 KiB
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
import time
|
|
|
|
import paramiko
|
|
|
|
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
|
|
HOST = "108.174.50.68"
|
|
PASS = "Xiao4669805"
|
|
|
|
CMD = r"""
|
|
name=douyinweb-neko-3
|
|
sleep 5
|
|
docker exec "$name" sh -c 'grep -R -a "YouTube Studio Auto Dismiss" "/home/neko/.config/chromium/Default/Local Extension Settings/dhdgffkkebhmkfjojejmpbldmpobfkfo" 2>/dev/null | wc -c'
|
|
docker exec "$name" sh -c 'ls -la "/home/neko/.config/chromium/Default/Local Extension Settings/dhdgffkkebhmkfjojejmpbldmpobfkfo" 2>/dev/null | head -10'
|
|
docker exec "$name" sh -c 'ls -la "/home/neko/.config/chromium/Default/Managed Extension Settings/dhdgffkkebhmkfjojejmpbldmpobfkfo" 2>/dev/null | head -10'
|
|
docker exec "$name" curl -fsS http://127.0.0.1:18080/tampermonkey-provisioning.json | head -c 120
|
|
echo
|
|
docker exec "$name" python3 -c "import json,urllib.request; tabs=json.load(urllib.request.urlopen('http://127.0.0.1:9222/json/list',timeout=5)); print('tabs',len(tabs)); [print((t.get('url') or '')[:110]) for t in tabs if 'tampermonkey' in (t.get('url') or '') or 'studio.youtube' in (t.get('url') or '')]"
|
|
docker exec "$name" tail -15 /var/log/neko/google-chrome.log 2>/dev/null || true
|
|
"""
|
|
|
|
|
|
def main() -> None:
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect(HOST, 22, "root", PASS, timeout=60, allow_agent=False, look_for_keys=False)
|
|
_i, o, e = c.exec_command(CMD, timeout=120)
|
|
print(o.read().decode("utf-8", "replace"))
|
|
c.close()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|