import paramiko

client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect("192.168.1.50", username="root", password="Vlado7309208104++",
               look_for_keys=False, allow_agent=False)

def run(cmd):
    _, stdout, stderr = client.exec_command(cmd)
    out = stdout.read().decode().strip()
    err = stderr.read().decode().strip()
    if out: print(out)
    if err: print(f"[err] {err}")

print("--- Instalace psycopg2-binary ---")
run("pip3 install psycopg2-binary")

print("\n--- Overeni ---")
run("python3 -c \"import psycopg2; print('psycopg2 OK:', psycopg2.__version__)\"")
run("python3 -c \"import blake3; print('blake3 OK:', blake3.__version__)\"")

client.close()
