Skip to content

Instantly share code, notes, and snippets.

View jessesanford's full-sized avatar

Jesse Sanford jessesanford

View GitHub Profile
@jessesanford
jessesanford / k8s-bookmarks-CKA-CKAD.html
Last active May 16, 2022 13:05 — forked from Piotr1215/k8s-bookmarks-CKA-CKAD.html
K8s bookmarks for CKA, CKAD and CKS exams
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1619134484" LAST_MODIFIED="1652674233" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Bar</H3>
<DL><p>
@jessesanford
jessesanford / vault-aws.sh
Created May 3, 2021 00:26 — forked from mlimotte/vault-aws.sh
A bash function to get Vault (Hashicorp) credentials using AWS backend and set them in environment variables for use by the AWS cli.
#!/bin/bash
function vault-aws () {
VAULT_PATH=$1
if [ -z "$VAULT_PATH" ]; then
echo "Missing VAULT_PATH argument.\nExample: `vault-aws documents-store`"
exit 1
fi
if [ -z "$VAULT_ADDR" ]; then
echo "Missing VAULT_ADDR env variable"
@jessesanford
jessesanford / kubectl-root-in-host-nopriv.pks.sh
Created March 23, 2021 00:38 — forked from jjo/kubectl-root-in-host-nopriv.sh
Yeah. Get a root shell at any Kubernetes *node* via `privileged: true` + `nsenter` sauce. PodSecurityPolicy will save us. DenyExecOnPrivileged didn't (kubectl-root-in-host-nopriv.sh exploits it)
#!/bin/sh
# Launch a Pod ab-using a hostPath mount to land on a Kubernetes node cluster as root
# without requiring `privileged: true`, in particular can abuse `DenyExecOnPrivileged`
# admission controller.
# Pod command in turn runs a privileged container using node's /var/run/docker.sock.
#
# Tweaked for PKS nodes, which run their docker stuff from different
# /var/vcap/... paths
node=${1}
case "${node}" in
@jessesanford
jessesanford / ssl.sh
Last active February 23, 2021 20:35 — forked from alex-leonhardt/ssl.sh
Create signed SSL cert with K8S CA
#! /bin/bash
set -o errexit
export APP="${1:-mutateme}"
export NAMESPACE="${2:-default}"
export CSR_NAME="${APP}.${NAMESPACE}.svc"
echo "... creating ${app}.key"
openssl genrsa -out ${APP}.key 2048
require 'json'
# Rename parameter store paths. Takes:
# - parameter store json file path
# - old path
# - new path to use
old_path, new_path, _rest = ARGV
params = `aws ssm get-parameters-by-path --path #{old_path} --with-decryption`
params = JSON.parse(params, object_class: OpenStruct)
@jessesanford
jessesanford / .chunkwmrc
Created January 3, 2019 19:05 — forked from shihanng/.chunkwmrc
chunkwm + skhd
#!/bin/bash
#
# NOTE: specify the absolutepath to the directory to use when
# loading a plugin. '~' expansion is supported.
#
chunkc core::plugin_dir /usr/local/opt/chunkwm/share/chunkwm/plugins
#
@jessesanford
jessesanford / umbrella
Created February 9, 2018 20:39 — forked from quinncomendant/umbrella
Cisco Umbrella Roaming Client management script for Mac OS X. This makes it easy to manage the background processes of umbrella to start, stop, restart, sleep and get status.
#!/usr/bin/env bash
# Quinn Comendant <quinn@strangecode.com>
# https://gist.github.com/quinncomendant/3be731567e529415d5ee
# Since 25 Jan 2015
# Version 1.2
CMD=$1;
if [[ `id -u` = 0 ]]; then
@jessesanford
jessesanford / docker-migrate.sh
Created October 26, 2016 21:28 — forked from kimh/docker-migrate.sh
Shell script to demonstrate docker migration with CRIU
#!/bin/bash -e
function run-vg-cmd() {
pushd $1
eval $2
popd
}
function usage() {
echo "Usage: $0 container from-vagrant-dir to-vagrant-dir"
@jessesanford
jessesanford / instagram_account_redemption.eml
Last active November 15, 2018 19:46
instagram_account_redemption
Delivered-To: jessesanford@REDACTED
Received: by REDACTED with SMTP id REDACTED;
Thu, 1 Sep 2016 05:35:20 -0700 (PDT)
X-Received: by REDACTED with SMTP id REDACTED;
Thu, 01 Sep 2016 05:35:20 -0700 (PDT)
Return-Path: <instagram-bounce+REDACTED@support.instagram.com>
Received: from mx-out.facebook.com (REDACTED.outmail.facebook.com. [REDACTED])
by mx.foo.com with ESMTPS id REDACTED
for <jessesanford@REDACTED>
@jessesanford
jessesanford / keybase.md
Created September 1, 2016 04:01
keybase.md

Keybase proof

I hereby claim:

  • I am jessesanford on github.
  • I am jessesanford (https://keybase.io/jessesanford) on keybase.
  • I have a public key ASDZSYwDZK1IwDxQPHtQJOjJox9SyIQd6bxBbBMauK9yQAo

To claim this, I am signing this object: