52 lines
1.8 KiB
Python
52 lines
1.8 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""Find a working TM LES on physical and clone into ops-neko 1/2 + seed."""
|
|
import sys
|
|
import paramiko
|
|
|
|
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
|
|
CMD = r"""
|
|
echo 4669805 | sudo -S -p '' bash -lc '
|
|
EXT=dhdgffkkebhmkfjojejmpbldmpobfkfo
|
|
echo "=== scan assign + ops profiles on host ==="
|
|
for root in /opt/douyinWEB/backend/data/neko/profiles /opt/douyinWEB/backend/data/ops_neko/profiles; do
|
|
[ -d "$root" ] || continue
|
|
for d in "$root"/*; do
|
|
[ -d "$d" ] || continue
|
|
hit=$(grep -aR -l "YouTube Studio Auto Dismiss" "$d" 2>/dev/null | head -1)
|
|
if [ -n "$hit" ]; then
|
|
echo FOUND "$d" -> "$hit"
|
|
du -sh "$d/Default/Local Extension Settings/$EXT" 2>/dev/null || true
|
|
fi
|
|
done
|
|
done
|
|
echo "=== seed LES ==="
|
|
SEED=/opt/douyinWEB/backend/neko/tampermonkey-seed/Default/Local\ Extension\ Settings/$EXT
|
|
du -sh "$SEED" 2>/dev/null || echo no_seed_les
|
|
grep -aR "YouTube Studio Auto Dismiss" "$SEED" 2>/dev/null | head -1 || echo seed_has_no_script
|
|
|
|
# Also check running assign containers
|
|
for id in 1 2 3 4 5 6 7 8; do
|
|
name=douyinweb-neko-$id
|
|
if docker ps --format "{{.Names}}" | grep -qx "$name"; then
|
|
h=$(docker exec "$name" bash -lc "grep -aR -l \"YouTube Studio Auto Dismiss\" /home/neko/.config/google-chrome/Default/Local\ Extension\ Settings/$EXT 2>/dev/null | head -1")
|
|
if [ -n "$h" ]; then echo FOUND_CONTAINER "$name"; fi
|
|
fi
|
|
done
|
|
'
|
|
"""
|
|
|
|
|
|
def main() -> None:
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect("107.173.30.245", 4014, "eric", "4669805", timeout=40, allow_agent=False, look_for_keys=False)
|
|
_i, o, e = c.exec_command(CMD, timeout=120)
|
|
print((o.read() + e.read()).decode("utf-8", "replace"))
|
|
c.close()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|