Skip to content

Instantly share code, notes, and snippets.

global
debug
# log 127.0.0.1 local6
# log 127.0.0.1 local2 info
# chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 2000
# user haproxy
# group haproxy
daemon
#!/usr/bin/env bash
# Simulate a merge from the current branch into the target. Squash that merge
# into a single commit. Make that commit the new HEAD of the current branch.
#
# Based on work from the following sites:
# https://gist.github.com/patik/b8a9dc5cd356f9f6f980
# http://stackoverflow.com/questions/3697178/git-merge-all-changes-from-another-branch-as-a-single-commit
# https://makandracards.com/makandra/527-squash-several-git-commits-into-a-single-commit
against=$1
@rk295
rk295 / minikube start without rbac.md
Last active September 26, 2018 11:07
How to start minikube 0.28.2 without RBAC

Lots of documentation suggests variations on this option, but this is the correct one as of minikube version v0.28.2. Ensure you pay particular attention to the capitalisation of the words and the hyphen between authorization and mode!

minikube start --extra-config=apiserver.authorization-mode=AlwaysAllow

Verifying

To verify this is working do the following:

@rk295
rk295 / jamal.rb
Created September 6, 2018 06:00
Jamal formula for brew
class Jamal < Formula
desc "YAML to JSON and JSON to YAML conversion tool"
homepage "https://github.com/quantumew/jamal"
url "https://github.com/quantumew/jamal/archive/v1.0.0.tar.gz"
version "1.0.0"
sha256 "959d6ced5182114efa28dd9ba0aa06157d7c32842cda7719c2f5ce5a464c4b9d"
revision 1
depends_on "go" => :build
#!/usr/bin/env bash
#
# Sample script which outputs the list of root level directories containing
# modified files in the last commit
#
set -euo pipefail
IFS=$'\n\t'
changedDirs=()
@rk295
rk295 / set_NatGeo_img_as_desktop.sh
Last active June 19, 2018 10:23 — forked from bergeycm/set_NatGeo_img_as_desktop.sh
Sets National Geographic's Image of the Day as Desktop background for Mac OSX
#!/usr/bin/env bash
cd ~/Pictures/NatGeo || exit 1
today="$(date +%Y-%m-%d)"
hostname="https://yourshot.nationalgeographic.com"
originalUrl="$(curl -s https://www.nationalgeographic.com/photography/photo-of-the-day/_jcr_content/.gallery.json | jq -r '.items[0].originalUrl')"
fullPhotoUrl="${hostname}${originalUrl}"
curl -s "$fullPhotoUrl" -o "national-geographic-photo-of-the-day_${today}.jpg"
#!/usr/bin/env bash
# Simulate a merge from the current branch into the target. Squash that merge
# into a single commit. Make that commit the new HEAD of the current branch.
#
# Based on work from the following sites:
# https://gist.github.com/patik/b8a9dc5cd356f9f6f980
# http://stackoverflow.com/questions/3697178/git-merge-all-changes-from-another-branch-as-a-single-commit
# https://makandracards.com/makandra/527-squash-several-git-commits-into-a-single-commit
against=$1
apiVersion: v1
kind: Pod
metadata:
labels:
app: nginx
name: nginx-test
namespace: default
spec:
containers:
- image: nginx
@rk295
rk295 / k8s-ebs-encrypted-volume-example.yaml
Last active November 27, 2017 20:38
Sample deployment of a new StorageClass which uses GP2 encrypted volumes, defines a new PersistentVolumeClaim and finaly maps this volume into a pod.
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
storageclass.beta.kubernetes.io/is-default-class: "false"
labels:
k8s-addon: storage-aws.addons.k8s.io
name: gp2-encrypted
parameters:
#! /bin/sh
### BEGIN INIT INFO
# Provides: mosquitto
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mosquitto MQTT v3.1 message broker
# Description: