From 7f4996efabf63a8b1e493f8fb60716ac7632ad2b Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Wed, 12 Oct 2022 07:23:56 +0700 Subject: [PATCH] port forwarding feature --- bash/.bashrc | 4 ++++ bin/port-forwarding | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 bin/port-forwarding diff --git a/bash/.bashrc b/bash/.bashrc index 5ed8573..eacaea7 100755 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -125,6 +125,7 @@ PATH=$ME/.poetry/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin:/opt/bin:$ME/.fly/bi PATH=$ME/.fnm:$ME/.rbenv/bin:/opt/julia/bin:/opt/swift/usr/bin:/opt/janet/bin:/opt/python/3.10.6/bin:/opt:/opt/zig:$PATH eval "`fnm env`" +eval "$(fnm env --use-on-cd)" eval "$(rbenv init - bash)" export LIBGL_ALWAYS_INDIRECT=1 @@ -163,3 +164,6 @@ if ! pgrep ssh-agent > /dev/null; then else export SSH_AUTH_SOCK=/tmp/ssh-auth-sock fi + + +eval "$(zoxide init bash)" diff --git a/bin/port-forwarding b/bin/port-forwarding new file mode 100755 index 0000000..503ba64 --- /dev/null +++ b/bin/port-forwarding @@ -0,0 +1,13 @@ +#!/usr/bin/env julia + +print("Target host (or user@host) >") +targethost = lowercase(readline()) + +print("\nFrom host[:port] > ") +fromhost = lowercase(readline()) + +print("\nTo host[:port] > ") +tohost = lowercase(readline()) +print("\n") + +run(`ssh -f -N $targethost -L $fromhost:$tohost`) \ No newline at end of file