Skip to content

Instantly share code, notes, and snippets.

View taimax13's full-sized avatar
🎯
Focusing

Talex Maxim taimax13

🎯
Focusing
View GitHub Profile
@taimax13
taimax13 / connect-gcp-compute-engine.sh
Created June 9, 2021 15:05 — forked from ronniejoshua/connect-gcp-compute-engine.sh
Automate external ip white listing and connecting to gcp compute engine using shell script
#!/bin/bash
GCLOUD="/Users/<your-username>/google-cloud-sdk/bin"
${GCLOUD}/gcloud compute firewall-rules update <gcp-firewall-rule-name> --project=<gcp-project-id> --source-ranges=$(curl ifconfig.me)
external_ip=$(${GCLOUD}/gcloud compute instances describe <gcp-compute-engine> --zone=<gcp-ce-zone> --format='get(networkInterfaces[0].accessConfigs[0].natIP)')
ssh naya@$external_ip -p 122
@taimax13
taimax13 / bash_cheatsheet.md
Created March 11, 2019 10:41 — forked from lee2sman/bash_cheatsheet.md
bash scripting cheatsheet

Bash scripting cheatsheet

  • by Lee2sman
  • Updated 2017-09-18

Bash shebang

  • #!/usr/bin/env bash for portability, or less good, #!/bin/bash

Commenting