Skip to content

Instantly share code, notes, and snippets.

View pbar1's full-sized avatar
☄️

Pierce Bartine pbar1

☄️
View GitHub Profile
@pbar1
pbar1 / luks.md
Last active August 21, 2018 00:59
LUKS Cheat Sheet

LUKS Cheat Sheet

Dependencies

  • cryptsetup

Configure LUKS partition

# initialize and set passphrase
cryptsetup -y -v luksFormat /dev/$DEVICE

Keybase proof

I hereby claim:

  • I am pbar1 on github.
  • I am pbar (https://keybase.io/pbar) on keybase.
  • I have a public key ASAWn3HJGZg3rBFQeWQJQ774mS01fgOH_Wqkaley1RLh7Qo

To claim this, I am signing this object:

@pbar1
pbar1 / deployment.yml
Last active February 24, 2020 23:19 — forked from dennybaa/deployment.yml
Using Kubernetes envFrom for environment variables #k8s #envfrom
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@pbar1
pbar1 / README.md
Last active March 27, 2020 23:31
Kubernetes Config Helper Mockup

Kubernetes Config Helper Mockup

Annotations

confighelper.io/autoenv-vault

If set, automatically syncs a Vault KV v2 secret into a Kubernetes Secret. Each key in the Vault secret is mapped to the same key in the Kubernetes Secret.

  • Format: < Vault KV v2 path >:< Kubernetes Secret name >
  • Example: /kv/example-app/environ:example-app-env-secret

confighelper.io/autoenv-consul

If set, automatically syncs a Consul KV entry/directory into a Kubernetes ConfigMap. Each key in the Consul directory is mapped to the same key in the Kubernetes ConfigMap.

@pbar1
pbar1 / awesome-links.md
Last active July 19, 2023 20:36
Awesome Links
@pbar1
pbar1 / testenv-up.sh
Last active October 17, 2022 01:49
Kind cluster with Vault K8s Auth Method
#!/usr/bin/env bash
set -o errexit -o pipefail -x
GIT_ROOT="$(git rev-parse --show-toplevel)"
CLUSTER_NAME=example-test
export KUBECONFIG="${GIT_ROOT}/test/test-kubeconfig.yaml"
# usage: portfwd [namespace] [port]
# assumes service exists with same name as namespace
portfwd() {
@pbar1
pbar1 / configuration.nix
Last active November 27, 2021 20:15
NixOS Notes
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@pbar1
pbar1 / audible-convert
Last active December 17, 2021 16:17
Decrypts Audible aax/mp4 to m4b
#!/usr/bin/env bash
# Decrypts Audible aax/mp4 to m4b
# USAGE: audible-convert FILE
set -o errexit -o pipefail -o nounset
# To get this: https://audible-converter.ml/
ab="${AUDIBLE_BYTES}"
input="$1"
output="${input%.*}.m4b"
#!/usr/bin/env python
import argparse
import json
import re
import sys
import urllib.request
def fetch_ips():