mirror of
https://github.com/curly60e/pyblock.git
synced 2026-08-17 13:07:17 +02:00
Replace insecure patterns that exposed the application to command injection, arbitrary code execution, and data interception attacks. - Replace os.popen/os.system with subprocess.run using argument lists - Migrate pickle config serialization to JSON format - Replace bare except: blocks with specific exception types - Fix insecure HTTP URLs to HTTPS (opreturnbot.com, ascii.live) - Replace shell curl commands with requests library calls - Add migrate_config.py script for pickle-to-JSON config migration - Convert existing SPV config files to JSON format Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 lines
1.1 KiB
Python
28 lines
1.1 KiB
Python
#Developer: Curly60e
|
|
#PyBLOCK its a clock of the Bitcoin blockchain.
|
|
|
|
import os
|
|
import subprocess
|
|
import psutil
|
|
import time as t
|
|
from pblogo import *
|
|
|
|
|
|
def clear(): # clear the screen
|
|
subprocess.run(['cls' if os.name=='nt' else 'clear'])
|
|
|
|
def sysinfoDetail(): #Cpu and memory usage
|
|
# gives a single float value
|
|
while True:
|
|
try:
|
|
clear()
|
|
blogo()
|
|
print(" \033[0;37;40m----------------------------")
|
|
print(" \033[3;33;40mCPU Usage: \033[1;32;40m" + str(psutil.cpu_percent()) + "\033[0;37;40m%")
|
|
print(" \033[3;33;40mMemory Usage: \033[1;32;40m" "{}\033[0;37;40m%".format(int(psutil.virtual_memory().percent)))
|
|
print(" \033[3;33;40mMemory Available: \033[1;32;40m" "{} \033[0;37;40mMB".format(int(psutil.virtual_memory().available / 1024 / 1024)))
|
|
print(" \033[3;33;40mDisk Usage: \033[1;32;40m" "{}%\033[0;37;40m%".format(psutil.disk_usage('/').percent))
|
|
print(" \033[0;37;40m----------------------------")
|
|
t.sleep(1)
|
|
except Exception:
|
|
break
|