import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname="192.168.1.10", username="user", password="pass")
stdin, stdout, stderr = ssh.exec_command("uptime")
print(stdout.read().decode())
ssh.close()
import requests
response = requests.get("https://api.example.com/status")
if response.status_code == 200:
print(response.json())
import pandas as pd
df = pd.read_csv("logs.csv")
errors = df[df["Status"] == 500]
print(errors)
import docker
client = docker.from_env()
container = client.containers.run("nginx", detach=True, ports={"80/tcp": 8080})
print(container.status)
import yaml
with open("config.yaml", "r") as file:
config = yaml.safe_load(file)
config["new_setting"] = "value"
with open("config.yaml", "w") as file:
yaml.safe_dump(config, file)