feat: add various infrastructure check and automation scripts

This commit is contained in:
2026-11-15 17:17:41 -05:00
parent 336b7759d0
commit b301aa3ece
232 changed files with 8274 additions and 298 deletions

View File

@@ -0,0 +1,40 @@
import paramiko
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect("140.44.4.71", username="snarf", password="Katzir476!", timeout=10)
py_code = """
import sqlite3
db_path = '/var/lib/docker-data/heimdall/config/www/app.sqlite'
con = sqlite3.connect(db_path)
cur = con.cursor()
print('=== PRAGMA table_info(items) ===')
for col in cur.execute('PRAGMA table_info(items)').fetchall():
print(col)
print('=== ITEMS COUNT ===')
print('Count:', cur.execute('SELECT count(*) FROM items').fetchone()[0])
print('=== SAMPLE ITEMS ===')
for row in cur.execute('SELECT * FROM items').fetchall()[:10]:
print(row)
print('=== SETTINGS ===')
for row in cur.execute('SELECT * FROM settings').fetchall():
print(row)
"""
stdin, stdout, stderr = c.exec_command("cat > /tmp/inspect_heimdall_real.py")
stdin.write(py_code)
stdin.close()
stdout.channel.recv_exit_status()
_, o, e = c.exec_command("echo Katzir476! | sudo -S python3 /tmp/inspect_heimdall_real.py")
print(o.read().decode())
print(e.read().decode())
c.close()