This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ver=`uname -r` | |
if [[ $(whoami) != "root" ]]; then | |
echo "Must be root" | |
exit 1 | |
fi | |
if [[ `rpm -q kernel-PAE-devel` ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dnf | |
if __name__ == '__main__': | |
with dnf.Base() as base: | |
base.fill_sack() | |
q = base.sack.query() | |
i = q.installed() | |
pkg32 = pkgnoarch = pkg64 = 0 | |
for pkg in i: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from json import loads | |
from xmlrpc.client import ServerProxy | |
from os import system | |
from sys import argv | |
def ping_server(server_addr): | |
print("Checking the server status...") | |
status = system("ping -c 1 -w 5 " + server_addr + " > /dev/null 2>&1") | |
if status == 0: | |
return ("Up", server_addr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xmlrpc.server import SimpleXMLRPCServer | |
from shutil import disk_usage | |
from json import dumps | |
kilo_bytes = 1024 | |
mega_bytes = 1024 * 1024 | |
giga_bytes = 1024 * 1024 * 1024 | |
def send_to_client(): | |
(total, used, free) = disk_usage ("/") |
NewerOlder