Skip to content

Instantly share code, notes, and snippets.

View pbnj's full-sized avatar
🖖
"May the Force ever be in your favor, Harry" -Gandalf

Peter Benjamin pbnj

🖖
"May the Force ever be in your favor, Harry" -Gandalf
View GitHub Profile
@pbnj
pbnj / .tmux.conf
Last active February 17, 2024 14:07
Toggle-able Terminal in Tmux
bind-key -n 'C-\' run-shell -b ${HOME}/.local/bin/tmux-toggle-term
@pbnj
pbnj / crate-health.md
Created December 19, 2022 21:13 — forked from repi/crate-health.md
Guidelines on evaluating health & quality of third-party crates at Embark

note: I wrote this for our internal documentation & guidelines at Embark so not all of it is likely relevant for other companies, but sharing here as others expressed interest in seeing it


What to evaluate and consider before adding usage of new third-party crates.

These are not exact requirements but questions to investigate and discuss to help reason around the health, safety, maintainability, and more around crates.

This can also be read as an opinionated guide for crate authors of what our (Embark's) guidelines and recommendations are, though should not be taken too literally.

@pbnj
pbnj / Makefile
Created December 6, 2022 20:36 — forked from SteveByerly/Makefile
Makefile for managing a Terraform project
MAKEFLAGS += --warn-undefined-variables
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := help
.SUFFIXES:
# ---------------------------------------------------------
# Local Variables
# ---------------------------------------------------------
#!/bin/bash
# Download terraform docs to search through them locally, because registry.terraform.io is shit!
# set -x
provider=${1:-"aws"}
refs=${2:-"heads"} # or "tags"
version=${3:-"main"} # or "v4.44.0"
@pbnj
pbnj / README.md
Created July 15, 2022 16:18
Night Owl Theme for Cool-Retro-Term

Night Owl Theme for Cool-Retro-Term

[cool-retro-term][] is a retro terminal emulator.

Install

To install the theme:

  1. Download the JSON file.
  2. In cool-retro-term settings, click Import, find and select the downloaded JSON file. The theme should now appear in the list of available themes.
@pbnj
pbnj / qfsign.vim
Last active December 5, 2022 21:52 — forked from BoltsJ/qfsign.vim
Automatically place signs based on the quickfix/location list.
if exists('g:loaded_qfsigns')
finish
endif
let g:loaded_qfsigns=1
sign define QFErr texthl=QFErrMarker text=E
sign define QFWarn texthl=QFWarnMarker text=W
sign define QFInfo texthl=QFInfoMarker text=I
augroup qfsigns
@pbnj
pbnj / login-csrf.sh
Created July 29, 2021 16:42 — forked from whiteinge/login-csrf.sh
Wrapper to fetch CSRF token and authenticate via the login page
#!/usr/bin/env sh
# Wrapper to fetch CSRF token and authenticate via the login page
url='http://localhost:3002'
login="${url}/sign_in"
curl -sS -c cookies.txt "$login" |
htmlstar sel -t -v "//_:input[@name='csrf_token']/@value" -o '
' | xargs -I{} curl -sS -c cookies.txt -b cookies.txt "$login" \
--data-urlencode 'user[email]=me@example.com' \
# Source: https://gist.github.com/6fb3e7da327df9203d9d4c184fcb5831
##############################################################################
# Combining Argo CD (GitOps), Crossplane (Control Plane), And Kubevela (OAM) #
# https://youtu.be/eEcgn_gU3SM #
##############################################################################
# Referenced videos:
# - Argo CD - Applying GitOps Principles To Manage Production Environment In Kubernetes: https://youtu.be/vpWQeoaiRM4
# - Cloud-Native Apps With Open Application Model (OAM) And KubeVela: https://youtu.be/2CBu6sOTtwk
@pbnj
pbnj / cloudSettings
Last active October 8, 2021 17:24
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-10-08T17:24:04.931Z","extensionVersion":"v3.4.3"}
@pbnj
pbnj / macos-tmux-256color.md
Created March 25, 2021 07:13 — forked from bbqtd/macos-tmux-256color.md
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):