Skip to content

Instantly share code, notes, and snippets.

View andrleite's full-sized avatar

Andre Leite andrleite

  • Sao Paulo, SP, Brasil
View GitHub Profile
apiVersion: v1
kind: ServiceAccount
metadata:
name: argo-cluster-mgmt-custom
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: argo-cluster-mgmt-custom
@andrleite
andrleite / create_sqlinstance.sh
Created September 14, 2019 20:38
Create GCP SQL INSTANCE
#!/bin/bash
set -eo pipefail
PROJECT_ID=$1
INSTANCE_NAME=$2
CPU=${3:-1}
MEMORY=${4:-3840MB}
MASTER_PASSWORD=$(openssl rand -hex 4)
@andrleite
andrleite / kill-ns.sh
Created July 31, 2019 18:53 — forked from pagottoo/kill-ns.sh
kill ns
#!/bin/bash
###############################################################################
# Copyright (c) 2018 Red Hat Inc
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
@andrleite
andrleite / utils.md
Last active February 5, 2021 03:00
GCP cli

GCP

Get iam policies per service account

gcloud projects get-iam-policy <GCP-PROJECT> \
  --flatten="bindings[].members" \
  --format='table(bindings.role)' \
  --filter="bindings.members:<SERVICE-ACCOUNT>"

add user do gcp

!--------------------------
! ROFI Color theme
! -------------------------
rofi.color-enabled: true
!rofi.color-window: argb:ee273238, #273238, argb:3a1e2529
rofi.color-window: #000, #000, #000
rofi.color-normal: argb:00273238, #c1c1c1, argb:3a273238, #394249, #ffffff
rofi.color-active: argb:00273238, #80cbc4, argb:3a273238, #394249, #80cbc4
rofi.color-urgent: argb:00273238, #ff1844, argb:3a273238, #394249, #ff1844
rofi.hide-scrollbar: true

Vault get kv

vault kv get -format=json  kv/<k8s-region-dns>/<cluster-id>/ssh_key | jq -r .data.data.key | base64 -D

Jsonpath

kubectl get ns -o=jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.metadata.labels.External_id}{'\n'}{end}"

Logs K8s API

Keybase proof

I hereby claim:

  • I am andrleite on github.
  • I am andrleite (https://keybase.io/andrleite) on keybase.
  • I have a public key ASB6lPyM7reKaTwOEFgYBuuzznxEflxnkvgVGHxQFAhPOAo

To claim this, I am signing this object:

rake db:create
rake db:migrate
rake db:seed:migrate
rake templates:update_templates
rake products_update_versions
@andrleite
andrleite / 0_reuse_code.js
Created November 23, 2016 12:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console