Skip to content

Instantly share code, notes, and snippets.

View nekudo's full-sized avatar
💭
Just dropped in to see what condition my condition was in...

Simon Samtleben nekudo

💭
Just dropped in to see what condition my condition was in...
View GitHub Profile
@nekudo
nekudo / clock.sh
Created June 22, 2020 16:18
GenMon Scripts
#!/usr/bin/env bash
# Makes the script more portable
readonly DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
read -r cpu a b c previdle rest < /proc/stat
prevtotal=$((a+b+c+previdle))
sleep 0.5
read -r cpu a b c idle rest < /proc/stat
total=$((a+b+c+idle))
@nekudo
nekudo / LoggerApplication.php
Created June 18, 2012 19:20
Monitoring PHP-CLI scripts with websockets
<?php
namespace WebSocket\Application;
/**
* Websocket-Server demo and test application.
*
* @author Simon Samtleben <[email protected]>
*/
class LoggerApplication extends Application