Skip to content

Instantly share code, notes, and snippets.

View sandromello's full-sized avatar

Sandro Mello sandromello

View GitHub Profile
@sandromello
sandromello / kaniko-custom
Created October 18, 2019 18:35
kaniko-custom
FROM gcr.io/kaniko-project/executor:debug-v0.13.0
FROM node:8.9.4-alpine
COPY --from=0 /kaniko/* /kaniko/
COPY --from=0 /kaniko/.docker/config.json /kaniko/.docker/config.json
COPY --from=0 /busybox/ /busybox/
VOLUME /busybox
COPY --from=0 /kaniko/ssl/certs/ /kaniko/ssl/certs/
@sandromello
sandromello / metabase-on-gcp.md
Last active August 12, 2019 16:47
Metabase Install
  1. Create a postgres instance on GCP
  2. Create a debian machine instance
  3. Install Docker
apt-get update
apt-get install -y \
    apt-transport-https \
    ca-certificates \
 curl \
@sandromello
sandromello / universe-specs.yaml
Last active June 7, 2019 19:20
Universe Specs yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: payout
annotations:
description: |-
TBD.
labels:
dependencies: wallet
spec:
@sandromello
sandromello / help.md
Last active May 24, 2019 11:51
Buy Wildcard
  1. Logar no painel da digicert
  2. Selecionar a aba "Buy Certificates"
  3. Selecionar o produto wildcard i
@sandromello
sandromello / tf-in-docker.sh
Created March 1, 2019 00:36
Terraform Inside Docker
#!/bin/bash
set -eo pipefail
: "${AWS_DEFAULT_REGION:?Need to set AWS_DEFAULT_REGION}"
: "${AWS_ACCESS_KEY_ID:?Need to set AWS_ACCESS_KEY_ID}"
: "${AWS_SECRET_ACCESS_KEY:?Need to set AWS_SECRET_ACCESS_KEY}"
TF_ACTION=$1
TF_VOLUMES="-v ${PWD}/terraform:/root -v ${PWD}/.terraform:/.terraform"
@sandromello
sandromello / groups.yaml
Last active February 12, 2019 19:45
Groups YAML Spec
# Groups
kind: GroupList
items:
- name: 'opscenter:taf:admin'
description: Cluster Admin for Taf clusters
namespaces:
- c5e493
- c635ed
- cbcb57
- kong
@sandromello
sandromello / config-coredump.sh
Last active January 9, 2019 18:57
Configure Container Linux core dump on the fly
#!/bin/bash
while true; do
for node in $(kubectl get nodes --no-headers |grep -v master |awk {'print $1'}); do
echo "=====> Configuring $node"
ssh -l core -o StrictHostKeyChecking=no -i /root/id_rsa $node "sudo sed -i 's/#ProcessSizeMax.*/ProcessSizeMax=900G/g;s/#ExternalSizeMax.*/ExternalSizeMax=900G/g' /etc/systemd/coredump.conf"
ssh -l core -o StrictHostKeyChecking=no -i /root/id_rsa $node "sudo systemctl daemon-reload"
done
echo "Done! sleeping for 60 minutes ..."
sleep 3600
done
@sandromello
sandromello / config.go
Last active November 9, 2018 12:15
Node Init - Kubeadm
package nodeinit
import "strings"
// https://coredns.io/plugins/kubernetes/
type CoreDNSOptions struct {
// the URL for a remote k8s API endpoint
KubernetesEndpoint string
// exposes the k8s namespaces listed
Namespaces string
@sandromello
sandromello / check_liveness.py
Last active April 24, 2018 02:28
Check liveness
#!/usr/bin/env python
# for ns in $(kubectl get ns |grep -i ctaf |awk {'print $1'}); do python -W ignore check_ingress.py host01 host02; done
import requests
import sys
def has_via(url):
r = requests.get(url, verify=False, timeout=1)
return r.headers.get('Via')
### Keybase proof
I hereby claim:
* I am sandromello on github.
* I am sandromello (https://keybase.io/sandromello) on keybase.
* I have a public key ASCYSq7XPh9uaSG_HXdIFOFxNUUijP6mSXEvreRBQsbJ1Qo
To claim this, I am signing this object: