Skip to content

Instantly share code, notes, and snippets.

@jbeda
jbeda / gist:43f0c3f31b8e53174fb4
Created October 21, 2015 20:16
Generic nginx config for many sites
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@jbeda
jbeda / gist:aadf3c144fbe2ad30f2d
Created February 20, 2016 05:21
Rethinking graphviz
NB: This is a stream of consciousness after a minimum of thought. It is possible that the graphviz community has already been over all of this. Please don't take this too seriously.
Graphviz is awesome. It allows you to logically describe a graph and then lay it out.
Graphviz is one of the most frustrating pieces of software I've ever used. It is easy to get everything you *want* in the diagram but increadibly hard to make it actually look the way you imagine it.
The fundamental problem, in my mind, is that there is an unfortunate incosistency around subgraphs. Most of the layout algorithms tend to do global layout when complex diagrams often times require different layout algorithms for different parts of the project.
To fix this I'd do the following:
* Allow true subgraph layout of nodes and edges completely contained in the subgraph. Allow users to easily mix and match layout algorithms in the same diagram.
@jbeda
jbeda / describe-self.sh
Last active May 30, 2016 19:29
Describe GCE instance from within instance
gcloud compute instances describe \
--zone $(/usr/share/google/get_metadata_value zone | cut -d / -f 4) \
$(/usr/share/google/get_metadata_value hostname | cut -d . -f 1)

We assume we have a set of master nodes (master-{1..N}) and a set of worker nodes (worker-{1..M}). We also assume that the container runtime (Docker, rkt) is already installed. For now, also assume that networking is configured. In my mind it is an open issue how much networking should be driven by kubernetes.

workstation$ ssh master-1

Start the kubelet. Here we just start it directly in the background for simplicity.

@jbeda
jbeda / gist:0fb9748db43ecb14f72f8662516a8047
Last active March 8, 2019 20:33
I love `git commit --fixup`
# Have origin be your fork, upstream is upstream.
$ git remote -v
origin [email protected]:jbeda/kubernetes.git (fetch)
origin [email protected]:jbeda/kubernetes.git (push)
upstream [email protected]:kubernetes/kubernetes.git (fetch)
upstream [email protected]:kubernetes/kubernetes.git (push)
# Make some changes to a bunch of files in a multi commit PR
# Find the commit you want to tweak, copy the hash
@jbeda
jbeda / gist:60db714598f6c6a7a0558086e2225ab4
Last active March 5, 2017 19:25
Install old docker on Ubuntu Xenial
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo sh -c "echo 'deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main' > /etc/apt/sources.list.d/docker.list"
sudo apt-get install docker-engine=1.12.6-0~ubuntu-xenial
sudo apt-mark hold docker-engine
@jbeda
jbeda / 01 Install Unison Linux
Last active September 8, 2023 07:47
Unison install
# linux
UNISON_VERSION=2.48.4
sudo apt-get -y install inotify-tools ocaml-nox build-essential
curl -L https://github.com/bcpierce00/unison/archive/${UNISON_VERSION}.tar.gz | tar zxv -C /tmp
cd /tmp/unison-${UNISON_VERSION}
sed -i -e 's/GLIBC_SUPPORT_INOTIFY 0/GLIBC_SUPPORT_INOTIFY 1/' src/fsmonitor/linux/inotify_stubs.c
make UISTYLE=text NATIVE=true STATIC=true
cp src/unison src/unison-fsmonitor ~/bin
# You should modify your path to include ~/bin
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: flannel
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: flannel
@jbeda
jbeda / Ubuntu 16.04
Created April 6, 2017 01:10
Install prev kubeadm versions
sudo apt-get -y install kubectl=1.5.3-00 kubelet=1.5.3-00 kubernetes-cni=0.3.0.1-07a8a2-00
curl -Lo /tmp/old-kubeadm.deb https://apt.k8s.io/pool/kubeadm_1.6.0-alpha.0.2074-a092d8e0f95f52-00_amd64_0206dba536f698b5777c7d210444a8ace18f48e045ab78687327631c6c694f42.deb
sudo dpkg -i /tmp/old-kubeadm.deb
sudo apt-get install -f
sudo apt-mark hold kubeadm kubectl kubelet kubernetes-cni
@jbeda
jbeda / update-centos-7.sh
Last active February 9, 2022 11:50
Install prev kubeadm versions
kubeadm init --use-kubernetes-version=v1.5.6