Skip to content

Instantly share code, notes, and snippets.

@joaoluiznaufel
Last active September 6, 2018 14:23
Show Gist options
  • Save joaoluiznaufel/c0b4afdc55a806ba5d4af597838ccd6e to your computer and use it in GitHub Desktop.
Save joaoluiznaufel/c0b4afdc55a806ba5d4af597838ccd6e to your computer and use it in GitHub Desktop.
gcloud commands
#get all the compute instances
gcloud compute instances list
#start a ssh connection
gcloud compute ssh mongo --zone us-west1-b
#using scp to send files recursive
gcloud compute scp ~/path/file <instance name>:/path/file --zone us-west1-b --recurse
#create ssh tunnel
gcloud compute ssh --zone <your zone> <instance name> -- -f -N -L <local_port>:localhost:<remote_port>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment