Skip to content

Instantly share code, notes, and snippets.

View erleene's full-sized avatar
🎯
Focusing

Erleene erleene

🎯
Focusing
  • HotelsDotCom
  • London
View GitHub Profile
@erleene
erleene / grafana-dashboard-exporter
Created December 6, 2019 16:47 — forked from crisidev/grafana-dashboard-exporter
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done
@erleene
erleene / 1_kubernetes_on_macOS.md
Created April 14, 2019 20:11 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

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

minikube stop; minikube delete &&
docker stop $(docker ps -aq) &&
rm -rf ~/.kube ~/.minikube &&
sudo rm -rf /usr/local/bin/localkube /usr/local/bin/minikube &&
launchctl stop '*kubelet*.mount' &&
launchctl stop localkube.service &&
launchctl disable localkube.service &&
sudo rm -rf /etc/kubernetes/ &&
docker system prune -af --volumes
@erleene
erleene / tmux-cheatsheet.markdown
Created March 19, 2019 09:45 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@erleene
erleene / Tmux Cheatsheet
Last active January 27, 2019 23:30
Tmux CheatSheet
# session management
tmux ls (or tmux list-sessions)
tmux new -s session-name
Ctrl-b d Detach from session
tmux attach -t [session name]
tmux kill-session -t session-name
Ctrl-b c Create new window
Ctrl-b d Detach current client
@erleene
erleene / create_new_ssh_key.md
Created November 1, 2018 16:32 — forked from JoaquimLey/create_new_ssh_key.md
Generating a new SSH key and adding it to the ssh-agent

##Generating a new ssh-key

Open Terminal. Paste the text below, substituting in your GitHub email address.

ssh-keygen -t rsa -b 4096 -C "[email protected]"

This creates a new ssh key, using the provided email as a label

Generating public/private rsa key pair.

@erleene
erleene / dep.md
Created October 31, 2018 10:34 — forked from subfuzion/dep.md
Concise guide to golang/dep

Overview

This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:

@erleene
erleene / bigquerydocs
Last active August 2, 2018 13:52
bigquery for logging and alerting
BigQuery allows organizations to capture and analyze data in real time using its powerful streaming ingestion
capability so that your insights are always current, and it’s free for up to 1 TB of data analyzed each month and 10 GB of data stored.
Google BigQuery gives you full view of all your data by seamlessly querying data stored in BigQuery’s managed columnar storage,
------
1. export log entries
Created an export of the log we need in Stackdriver from log viewer.
Exports logs by creating a sink that includes a log filter and an export destination.