Skip to content

Instantly share code, notes, and snippets.

@agonzalezro
agonzalezro / watchers.go
Last active July 14, 2017 09:30
go run watchers.go -kubeconfig ~/.kube/config
package main
import (
"flag"
"fmt"
"log"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/watch"
#!/bin/bash -x
set -euo pipefail
@agonzalezro
agonzalezro / bulk-neo4j-import-original.sh
Created May 11, 2016 20:22 — forked from jexp/bulk-neo4j-import-original.sh
Panama Papers Import Scripts for Neo4j and Docker
export NEO4J_HOME=${NEO4J_HOME-~/Downloads/neo4j-community-3.0.1}
if [ ! -f data-csv.zip ]; then
curl -OL https://cloudfront-files-1.publicintegrity.org/offshoreleaks/data-csv.zip
fi
export DATA=${PWD}/import
rm -rf $DATA
@agonzalezro
agonzalezro / spacemacs_key_bindings.md
Last active December 10, 2021 16:39
Interesting spacemacs keys that I should remember
  • SPC h
  • SPC ?: search keybinding
  • SPC f e h: help about current layer
  • SPC T h: themes
  • SPC m g g: go to definition
  • SPC m t [p|P|s|t]: run tests
  • SPC a k: launch paradox (package manager)
  • SPC t -: lock the cursor at the center of the screen
  • SPC SPC a: avy word search
  • SPC w =: balance split windows
#!/bin/zsh -f
export GOOGLE_APPLICATION_CREDENTIALS=~/Desktop/Vision-74543b759180.json
imagesnap -w 1 /tmp/pic.jpg
result=`pigeon /tmp/pic.jpg`
cat $result
type=`echo $result|jq ".[0].labelAnnotations[0].description"`
type=`echo $type|sed "s/ /%20/g"`
gcloud config set project pygrunn-xxx
sudo gcloud components update kubectl
sudo gcloud components update
gcloud container clusters get-credentials cluster-1 -z us-east1-d
@agonzalezro
agonzalezro / gist:e2335feac23cdb377810
Created October 15, 2015 14:35
Base64 `dockercfg` for pulling images from private repos into Kubernetes
cat $HOME/.docker/config.json|jq '.auths'|sed "s/http:/https:/g"|tr '\n' ' '|tr -d '[[:space:]]'|base64
@agonzalezro
agonzalezro / gist:2e921c2c0fa0fcc1e5ab
Created October 14, 2015 19:03
Get all the nodes external IPs in a Kubernetes cluster
kubectl get nodes -o template --template='{{range.items}}{{range.status.addresses}}{{if eq .type "ExternalIP"}}{{.address}}{{end}}{{end}} {{end}}'
@agonzalezro
agonzalezro / Dockerfile
Last active August 29, 2015 14:27
packetbeat Dockerfile
FROM phusion/baseimage:latest
RUN apt-get update
RUN apt-get -y -q install libpcap0.8 wget
ENV VERSION=1.0.0-beta2 ARCH=x86_64 EXTENSION=tar.gz
ENV FILENAME=packetbeat-${VERSION}-${ARCH}.${EXTENSION}
RUN wget https://download.elastic.co/beats/packetbeat/${FILENAME}
RUN tar zxvf ${FILENAME}