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 / Makefile
Created December 23, 2019 20:06 — forked from prwhite/Makefile
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@pbnj
pbnj / log
Created May 3, 2020 04:01
sonic-pi: Critical error! Could not boot server
Sonic Pi Boot Error Report
==================
System Information
----------------
* Sonic Pi version: 2.10.0
* OS: Pop!_OS 20.04 LTS
@pbnj
pbnj / CVE-2019-11253-poc.sh
Created June 19, 2020 17:27 — forked from bgeesaman/CVE-2019-11253-poc.sh
CVE-2019-11253 Kubernetes API Server YAML Parsing Remote Denial of Service PoC aka "Billion Laughs"
#!/usr/bin/env bash
# CVE-2019-11253
# https://github.com/kubernetes/kubernetes/issues/83253
# Shout out: @raesene for poc collab, @iancoldwater + @mauilion for
# HONKing inspiration and other guidance.
# Description: In Kubernetes 1.13 and below, the default configuration
# is that system:anonymous can request a selfsubjectaccessreview
# via mechanisms such as "kubectl auth can-i". This request can
# include POSTed YAML, and just the act of trying to parse it causes
/* https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/JetBrainsMono/Regular/complete/JetBrains%20Mono%20Regular%20Nerd%20Font%20Complete.ttf */
@font-face {
font-family: 'JetBrainsMono Patched';
src: local('JetBrainsMono Patched'), url('https://rawgit.com/ryanoasis/nerd-fonts/master/patched-fonts/JetBrainsMono/Regular/complete/JetBrains%20Mono%20Regular%20Nerd%20Font%20Complete.ttf') format('truetype');
}
@pbnj
pbnj / cloudSettings
Last active October 19, 2020 19:24
VSCode Settings Sync
{"lastUpload":"2020-10-19T19:24:30.935Z","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):

@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"}
# 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 / 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][email protected]' \
@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