Skip to content

Instantly share code, notes, and snippets.

@traitboundnotsatisfied
Created May 1, 2024 02:16
Show Gist options
  • Save traitboundnotsatisfied/bcaa9681f5281229c04c65b0657f552b to your computer and use it in GitHub Desktop.
Save traitboundnotsatisfied/bcaa9681f5281229c04c65b0657f552b to your computer and use it in GitHub Desktop.
Web Status Script
from flask import Flask
from subprocess import check_output
app = Flask(__name__)
@app.route('/')
def root():
nf = '<pre>' + check_output('neofetch --stdout', shell=True).decode('utf-8') + '</pre>'
lsblk = '<pre>' + check_output('lsblk').decode('utf-8') + '</pre>'
return f'<h1>Server is running!</h1><br>\n{nf}\n<br>\n{lsblk}'
if __name__ == '__main__':
app.run(port=8080)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment