Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function format_bytes($bytes){
- if ($bytes < 1024){ return $bytes; }
- else if ($bytes < 1048576){ return round($bytes / 1024, 2).'K'; }
- else if ($bytes < 1073741824){ return round($bytes / 1048576, 2).'MB'; }
- else if ($bytes < 1099511627776){ return round($bytes / 1073741824, 2).'GB'; }
- else{ return round($bytes / 1099511627776, 2).'TB'; }
- }
- $uptime = exec('uptime');
- $last_reboot = exec('last reboot -1 | head -n 1');
- $harddrive_info = explode(' ', preg_replace('/\s\s+/', ' ', nl2br(exec('df -h /'))));
- $harddrive_out = $harddrive_info[2].'<small> / '.$harddrive_info[1].' <small>('.(100-trim($harddrive_info[4],'%')).'% Free)</small></small>';
- preg_match('/ (.+) up (.+) user(.+): (.+)/', $uptime, $update_out);
- $users_out = substr($update_out[2], strrpos($update_out[2], ' ')+1);
- $uptime_out = substr($update_out[2], 0, strrpos($update_out[2], ' ')-2);
- $load_out = str_replace(', ',', <small>',$update_out[4]).str_repeat('</small>',2);
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>ZyberScape</title>
- <meta name="robots" content="noindex, nofollow, noarchive, nosnippet, noodp" />
- <style type="text/css">
- span { color: #fff;display: block;font-size: 1.3em;margin-bottom: .5em;padding: 0 .5em; }
- html { background-color: #000;color: #777;font-family: sans-serif;font-size: 2em;padding: 1em 2em; }
- div { float: right;text-align: right; }
- a { color: #68c;display: block;font-size: 2em;text-decoration: none; }
- small { color: #bbb; }
- small>small { color: #777; }
- </style>
- </head>
- <body>
- <div id="links">bros <a href="#">wutno</a></div>
- server time<span><?=date("Y-F-j H:i:s", time());?></span>
- uptime<span><?=$uptime_out;?></span>
- users logged in<span><?=$users_out;?></span>
- load<span><?=$load_out;?></span>
- disk<span><?=$harddrive_out;?></span>
- </body>
- </html>
Add Comment
Please, Sign In to add comment