Skip to content

Instantly share code, notes, and snippets.

View opennikish's full-sized avatar
:octocat:
Risen from the enterprise!

Nikita opennikish

:octocat:
Risen from the enterprise!
View GitHub Profile
# Support multiple connections
ncat -e /bin/cat -k -l 8888
nc -l -p 8888 -c 'xargs -n1 echo'
@opennikish
opennikish / top-pid.sh
Last active August 6, 2022 17:32
Simple process statistic reporter script
PID=$1
INTERVAL=$2
# Usage: ./top-pid.sh 12345 5 | tee report.log
while true; do
top -n 1 -b -pid $PID | tail -2 # Use `-l 1` for `-b` (batchmode) on macos
echo -n "\n"
sleep $INTERVAL
done
@opennikish
opennikish / top.sh
Last active August 6, 2022 17:32
Simple server resource statistic reporter script
#!/bin/bash
# Usage: ./top.sh 5 | tee report.log
INTERVAL=$1
while true; do
top -b -n 1 | head -n 6 # Use `-l 1` for `-b` (batchmode) on macos
sleep $INTERVAL
done