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:
parent
828609f738
commit
7dfe1c85e8
1 changed files with 11 additions and 0 deletions
|
|
@ -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 = .
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue