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
import requests, os
import json
from flask import render_template, Blueprint, \
request, flash, redirect, url_for # pragma: no cover
pdns_host = os.environ['PDNS_SERVER_1_PORT_8081_TCP_ADDR']
pdns_port = os.environ['PDNS_SERVER_1_PORT_8081_TCP_PORT']
url = 'http://%s:%s/servers/localhost/zones' % (pdns_host, pdns_port)
headers = { 'X-API-Key': 'totvs' }
*node data
rodrigo_gomes rm69871
danilo_rocha rm70415
andre_leite rm69925
hebert_costa rm66719
paulo_angelis rm68786
pedro_venancio rm66816
raphael_bigal rm70669
@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
rake db:create
rake db:migrate
rake db:seed:migrate
rake templates:update_templates
rake products_update_versions

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:

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

!--------------------------
! 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
@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

@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