Skip to content

Instantly share code, notes, and snippets.

@minherz
minherz / main.py
Created January 22, 2021 16:43
initialize Google client library in Python
creds, project_id = google.auth.default(scopes=['https://www.googleapis.com/auth/compute'])
compute = googleapiclient.discovery.build('compute', 'v1', credentials=creds)
@minherz
minherz / main.py
Created January 22, 2021 16:42
call Kubernetes API get nodes
resp = requests.get(url='https://kubernetes.default.svc/api/v1/nodes/' + node_name,
headers={'Authorization': 'Bearer ' + auth_token}, verify=False)
@minherz
minherz / gist:ed59b2bac559ae8b66e1ccefd087f524
Last active June 3, 2019 05:31
TF_LOG=trace terraform init output
2019/06/03 08:29:00 [INFO] Terraform version: 0.11.14
2019/06/03 08:29:00 [INFO] Go runtime version: go1.12.4
2019/06/03 08:29:00 [INFO] CLI args: []string{"/usr/bin/terraform", "init"}
2019/06/03 08:29:00 [DEBUG] Attempting to open CLI config file: /home/acme/.terraformrc
2019/06/03 08:29:00 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/06/03 08:29:00 [INFO] CLI command args: []string{"init"}
2019/06/03 08:29:00 [DEBUG] command: loading backend config file: /home/acme/workdir/terraform-labs/getting-started
Initializing the backend...
2019/06/03 08:29:00 [TRACE] Preserving existing state lineage "c7d18213-da77-bbef-ed78-34740d2651f5"