Guest User

Untitled

a guest
Feb 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. <?php
  2. function format_bytes($bytes){
  3. if ($bytes < 1024){ return $bytes; }
  4. else if ($bytes < 1048576){ return round($bytes / 1024, 2).'K'; }
  5. else if ($bytes < 1073741824){ return round($bytes / 1048576, 2).'MB'; }
  6. else if ($bytes < 1099511627776){ return round($bytes / 1073741824, 2).'GB'; }
  7. else{ return round($bytes / 1099511627776, 2).'TB'; }
  8. }
  9. $uptime = exec('uptime');
  10. $last_reboot = exec('last reboot -1 | head -n 1');
  11. $harddrive_info = explode(' ', preg_replace('/\s\s+/', ' ', nl2br(exec('df -h /'))));
  12. $harddrive_out = $harddrive_info[2].'<small> / '.$harddrive_info[1].' <small>('.(100-trim($harddrive_info[4],'%')).'% Free)</small></small>';
  13. preg_match('/ (.+) up (.+) user(.+): (.+)/', $uptime, $update_out);
  14. $users_out = substr($update_out[2], strrpos($update_out[2], ' ')+1);
  15. $uptime_out = substr($update_out[2], 0, strrpos($update_out[2], ' ')-2);
  16. $load_out = str_replace(', ',', <small>',$update_out[4]).str_repeat('</small>',2);
  17. ?>
  18. <!DOCTYPE html>
  19. <html>
  20. <head>
  21. <title>ZyberScape</title>
  22. <meta name="robots" content="noindex, nofollow, noarchive, nosnippet, noodp" />
  23. <style type="text/css">
  24. span { color: #fff;display: block;font-size: 1.3em;margin-bottom: .5em;padding: 0 .5em; }
  25. html { background-color: #000;color: #777;font-family: sans-serif;font-size: 2em;padding: 1em 2em; }
  26. div { float: right;text-align: right; }
  27. a { color: #68c;display: block;font-size: 2em;text-decoration: none; }
  28. small { color: #bbb; }
  29. small>small { color: #777; }
  30. </style>
  31. </head>
  32. <body>
  33. <div id="links">bros <a href="#">wutno</a></div>
  34. server time<span><?=date("Y-F-j H:i:s", time());?></span>
  35. uptime<span><?=$uptime_out;?></span>
  36. users logged in<span><?=$users_out;?></span>
  37. load<span><?=$load_out;?></span>
  38. disk<span><?=$harddrive_out;?></span>
  39. </body>
  40. </html>
Add Comment
Please, Sign In to add comment