Skip to content

Instantly share code, notes, and snippets.

Avatar

Ivan Pedrazas ipedrazas

View GitHub Profile
@ipedrazas
ipedrazas / 1_kubernetes_on_macOS.md
Created May 11, 2019 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry
View 1_kubernetes_on_macOS.md

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@ipedrazas
ipedrazas / push_node_exporter.sh
Created Mar 16, 2018 — forked from marcusdb/push_node_exporter.sh
push node_exporter metrics to push gateway
View push_node_exporter.sh
curl -s http://localhost:9100/metrics | curl --data-binary @- http://pushgateway.example.org:9091/metrics/job/some_job/instance/some_instance
View gist:2267ed44e1d53c9b592452e801659fcf

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@ipedrazas
ipedrazas / vaultsealmanager.sh
Created Nov 14, 2016 — forked from ccampanale/vaultsealmanager.sh
Bash shell script to check seal status for local vault server and attempt to unseal using keys secured in vault secret store. Supports HA Vault clusters with TLS with unseal keys stored as secrets in vault (see code). Relies on registered service vault.service.consul, in place DNS configuration, and a single unsealed vault instance in your clust…
View vaultsealmanager.sh
#!/bin/bash
export vault=/usr/local/bin/vault
export VAULT_TOKEN=$(cat /root/.vault-token)
vault_cacert='-ca-cert=/path/to/your/ca.pem'
local_vault="-address=https://$(hostname -f):8200"
unsealed_vault="-address=https://$(getent hosts $(dig +short vault.service.consul | tail -n 1) | awk '{ print $2 }'):8200"
leader_vault="-address=https://$($vault status $vault_cacert $unsealed_vault 2> /dev/null | grep Leader | awk '{ print $2 }' | sed 's/^http\(\|s\):\/\///g'):8200"
vault_read="$vault read $vault_cacert $leader_vault"
vault_unseal="$vault unseal $vault_cacert $local_vault"
@ipedrazas
ipedrazas / System Design.md
Created Apr 19, 2016 — forked from vasanthk/System Design.md
System Design Cheatsheet
View System Design.md

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@ipedrazas
ipedrazas / pod1.yml
Created Nov 10, 2015 — forked from resouer/pod1.yml
How to implement volumes-from in Kubernetes Pod?
View pod1.yml
---
apiVersion: v1
kind: Pod
metadata:
name: server
spec:
containers:
- image: resouer/sample:v2
name: war
lifecycle:
@ipedrazas
ipedrazas / gist:ecf41f4202d4d73ac651
Created Oct 15, 2015 — forked from agonzalezro/gist:e2335feac23cdb377810
Base64 `dockercfg` for pulling images from private repos into Kubernetes
View gist:ecf41f4202d4d73ac651
cat $HOME/.docker/config.json|jq '.auths'|sed "s/http:/https:/g"|tr '\n' ' '|tr -d '[[:space:]]'|base64
@ipedrazas
ipedrazas / README.md
Created Sep 26, 2015 — forked from hbpasti/README.md
fontawesome with i3status
View README.md

fontawesome with i3status

This is my i3 config, using FontAwesome icons for i3status.

Save files to ~/.i3.

View lambda_cloudsearch.js
console.log('Loading event');
var CLOUDSEARCH_ENDPOINT = < INSERT HERE >
var async = require('async');
var jpath = require('json-path')
var zlib = require('zlib');
var aws = require('aws-sdk');
var s3 = new aws.S3({
apiVersion: '2006-03-01'
});
You can’t perform that action at this time.