Skip to content

Instantly share code, notes, and snippets.

View puresoul's full-sized avatar

Puresoul puresoul

View GitHub Profile
@puresoul
puresoul / sed cheatsheet
Created May 12, 2025 17:03 — forked from ssstonebraker/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@puresoul
puresoul / mitm.sh
Last active April 12, 2017 12:18
MitM
socat TCP-LISTEN:2525,reuseaddr,fork SYSTEM:`tee -a l2r | socat - "TCP:77.78.110.92:25" | tee -a r2l`
@puresoul
puresoul / *.sh
Last active July 27, 2016 09:39
Xentop batch print with utilization
TOP="`xentop -i2 -d0 -b | wc -l`"; while read LINE; do let CNT=CNT+1; echo "$LINE"; done < <(xentop -i2 -d0 -b | sed -n $((${TOP} / 2 +1)),${TOP}p | sed 's/no\ limit/n\/l/') | column -t
@puresoul
puresoul / *.sh
Last active July 27, 2016 09:36
Script directory
dirname `readlink -f $0`
@puresoul
puresoul / *.sh
Last active July 27, 2016 09:37
Clear if nothing pressed
read ANY && test "$ANY" = "" && clear