Skip to content

Instantly share code, notes, and snippets.

@febridev
Created October 31, 2023 07:55
Show Gist options
  • Save febridev/951ffd0461b521d2e09d480826e6881d to your computer and use it in GitHub Desktop.
Save febridev/951ffd0461b521d2e09d480826e6881d to your computer and use it in GitHub Desktop.
IP=$1
LPORT=$2
RPORT=$2
ps aux | grep id_rsa | grep ${LPORT} | awk '{print $2}' | tail -1 | xargs kill -9
ssh -i ~/.ssh/id_rsa -o ExitOnForwardFailure=yes -f -N -L ${LPORT}:${IP}:${RPORT} <userssh>@<ipjumphost>
pgcli --host 127.0.0.1 --port $LPORT --username <userdatabase> --dbname STG_FINANCING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment