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,34 @@
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()
# Set public_front to 1 for user 1 so dashboard tiles are always visible even when logged out!
cur.execute('UPDATE users SET public_front = 1 WHERE id = 1')
con.commit()
print('Updated user 1:')
print(cur.execute('SELECT id, username, email, public_front FROM users WHERE id = 1').fetchone())
con.close()
"""
stdin, stdout, stderr = c.exec_command("cat > /tmp/set_public_front.py")
stdin.write(py_code)
stdin.close()
stdout.channel.recv_exit_status()
_, o, e = c.exec_command("echo Katzir476! | sudo -S python3 /tmp/set_public_front.py")
print(o.read().decode())
if e.read().decode():
print("ERR:", e.read().decode())
c.close()