port forwarding feature

This commit is contained in:
Reinaldy Rafli 2022-10-12 07:23:56 +07:00
parent 979307f9a4
commit 7f4996efab
No known key found for this signature in database
GPG Key ID: EA1B2522C1693EC8
2 changed files with 17 additions and 0 deletions

View File

@ -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)"

13
bin/port-forwarding Executable file
View File

@ -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`)