From ef375560c3dcfadad97ccc7c0da6591a2809b6f3 Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Mon, 15 Jan 2024 08:40:58 +0100 Subject: [PATCH] feat: add tcpdump http capture alias --- zshrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zshrc b/zshrc index dc3b8c5..aae9661 100644 --- a/zshrc +++ b/zshrc @@ -220,3 +220,7 @@ alias mark_none="printf '\033]708;black\007'" alias gfc='git commit . -m "[git fast commit] $(date +"%d. %h %Y - %H:%M:%S")" && git push' alias cleanhistory="awk '{if (a[$0] < NR || a[$0] == 0){a[$0]=NR}}END{for (i in a){print a[i] " " i}}' file | sort -n | cut 1" +alias connect_synology="ssh -f -o ExitOnForwardFailure=yes -i ~/.ssh/sheppy-master -L 8000:host.docker.internal:22 root@172.16.1.4 sleep 3600 && ssh cheffe@localhost -p 8000" +#alias tcpdump_http=stdbuf -oL -eL /usr/bin/tcpdump -A -s 10240 "tcp port 8000 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)" | egrep -a --line-buffered ".+(GET |HTTP\/|POST )|^[A-Za-z0-9-]+: " | perl -nle 'BEGIN{$|=1} { s/.*?(GET |HTTP\/[0-9.]* |POST )/\n$1/g; print }' +ths_ssh="ssh -f -o ExitOnForwardFailure=yes -i .ssh/sheppy-master -L 8000:host.docker.internal:22 root@172.16.1.4 sleep 3600 && ssh cheffe@localhost -p 8000" +#trap ctrl_c INT; function ctrl_c() {};