1
Fork 0
mirror of https://github.com/thegeneralist01/config.git synced 2026-12-04 18:56:56 +01:00

feat(shell): add SSH tunnel helper

This commit is contained in:
TheGeneralist 2026-10-09 21:47:11 +02:00
parent 828609f738
commit 7dfe1c85e8
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4

View file

@ -344,6 +344,17 @@ def --env mcg [path: path]: nothing -> nothing {
jj git init --colocate jj git init --colocate
} }
# Forward a local port to a port on an SSH host.
def ssh-tunnel [
local_port: int
remote_port: int
user: string
remote_host: string
--server_alive_interval: int = 60
]: nothing -> nothing {
^ssh -N -o ExitOnForwardFailure=yes -o $"ServerAliveInterval=($server_alive_interval)" -L $"127.0.0.1:($local_port):127.0.0.1:($remote_port)" $"($user)@($remote_host)"
}
# ls files sorted by latest DESC # ls files sorted by latest DESC
def latest [ def latest [
path: path = . path: path = .