Skip to content

Instantly share code, notes, and snippets.

@eliocamp
Created May 28, 2020 00:58
Show Gist options
  • Save eliocamp/dba1869d03250bf082e84b8272d54fcf to your computer and use it in GitHub Desktop.
Save eliocamp/dba1869d03250bf082e84b8272d54fcf to your computer and use it in GitHub Desktop.
Crea un comando para armar un tunnel y abrir rstudio server
#!/bin/bash
read -p "Usuario en el servidor: " USUARIO
read -p "Servidor: " SERVER
read -p "Puerto [4572]: " PUERTO
PUERTO=${PUERTO:-4572}
read -p "Nombre del tunel (y el comando) [rstudioserver]: " NOMBRE
NOMBRE=${NOMBRE:-rstudioserver}
echo "#!/bin/bash
pkill -f ${NOMBRE}_prc
bash -c \"exec -a ${NOMBRE}_prc ssh -f ${USUARIO}@portal.cima.fcen.uba.ar -L ${PUERTO}:${SERVER}:8787 -N &\"
firefox localhost:${PUERTO}
" > $HOME/bin/$NOMBRE
chmod +x $HOME/bin/$NOMBRE
. $HOME/.profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment