Skip to content

Instantly share code, notes, and snippets.

View petruisfan's full-sized avatar

Petru Isfan petruisfan

View GitHub Profile
@petruisfan
petruisfan / resources.sh
Created October 28, 2015 19:06
Continuous loop that outputs memory and cpu to a csv
#!/usr/bin/env bash
OUT=${1:-out.txt}
echo "Mem Total; Mem Free; Mem cached; Mem Buffered; Total CPU" > $OUT
while :
do
mem_total=$(cat /proc/meminfo | grep "^MemTotal" | tr -d ' ' | cut -f 2 -d ":")
mem_free=$(cat /proc/meminfo | grep "^MemFree" | tr -d ' ' | cut -f 2 -d ":")
@petruisfan
petruisfan / docker
Last active March 1, 2025 15:24
Docker init.d daemon script
#!/usr/bin/env bash
###############
# SysV Init Information
# description: docker daemon.
### BEGIN INIT INFO
# Provides: me
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 5