Skip to content

Instantly share code, notes, and snippets.

View jbharter's full-sized avatar
💭
Cloud Plumber

Jacob Harter jbharter

💭
Cloud Plumber
View GitHub Profile
@jbharter
jbharter / findBadSslPolicy.sh
Last active April 28, 2021 16:00
Finds SSL policy on GCP HTTPS proxies given a gcp project id.
#!/bin/bash
# Grab a temp file
tmpFile=$(mktemp)
# Send args to STDERR
function echoerr() {
printf "%s\n" "$*" >&2;
}
## Generating a code signing certificate
# TODO Writeup conf *.cnf
# generate key and csr
openssl req -new -newkey rsa:4096 -keyout codesign.key -config conf.cnf -out codesign.csr
# Sign csr
openssl x509 -req -CA /path/to/ca.pem -CAkey /path/to/ca.key -CAcreateserial -in codesign.csr -out codesign.crt -extfile conf.cnf -extensions v3_req
# convert it into PKCS#12 (pfx) container, that can be used from various soft
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFxa7uABEACkrqIHkjXPrdb3eYLMNPE3BqMAp6VDuImcy78+Teq7KU4YfP/L
sDUfZxXeAqU8v0+eCazB6uCXsTslfuvyMwGKZgxiMISztu2ADgCuiJPCo28lAst7
302uyXhprCPN4m+cgaiSXcUf+oVgwKxf+ZtqjoJAmcvHI9d+QNbfXdBnx+AHB6/6
644QSGSrF/a0jf1q7hU9GXHP9NXERNR3B2aP1nT4BTOFhk5+eIBsvQ+AwCUL0tEM
cgIhOu7GxZ3O8OIawebXowWfQaR8IAhURfawPLsNkIZbF09qhfKkpympsCX9AXKj
Tbbc6F8ZOMzj3ft5+1wWEVfGcAhV/Di/kg4OpgwGSfKS1OTDSnVxJTODfQ9+BNSL
Q1pIrFGLVuqsJtHtI6f7TyHrqAwYt1cU/xi+Eo+gms7m9HITQv2pHE9pC7sxF6Wu
MiLCwbxRFSyuGEXhZsYxeGqvcZRg/Ed4By8tCVSxI5180YV3mYQaqaJzH6keIoiF
@jbharter
jbharter / .tmux.conf
Last active January 8, 2019 19:14
Tmux config w/ powerline & more
source-file "${HOME}/GitHub/jimeh/tmux-themepack/powerline/block/blue.tmuxtheme"
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
#set -g status-left-length 150
@jbharter
jbharter / catchupAll.sh
Created October 30, 2018 13:32
Do you have a bunch of git repositories in a directory, and want to get them all up to date in one fell swoop? There's a script for that.
#!/bin/bash
for d in */;
do
echo $d
cd $d
git fetch
git pull
@jbharter
jbharter / .bash_profile
Last active January 8, 2019 18:58
Current bash profile, been working with Kubernetes a lot lately.
##### Bash Setup
# Lots of inspiration and straight up copypasta from Nathaniel Landau
# https://natelandau.com/my-mac-osx-bash_profile/
# source potential .bashrc?
if [ -f $HOME/.bashrc ];
then
source "$HOME/.bashrc"
fi
@jbharter
jbharter / DateParser.java
Created April 23, 2018 20:02
Simple Date Parser
/**
* Parse an incoming date string.
* Handles some common input strings; truncates them if they are greater than what <insert name> service expects.
*
* <br><b>Acceptable Inputs:</b>
* <table>
* <tr><th> Char Count </th><th> Characters </th><th> Date Interpretation </th></tr>
* <tr><td> (8 char) </td><td> YYYYMMDD </td><td> YYYY-MM-DD </td></tr>
* <tr><td> (9 char) </td><td> EEEEEEEEE </td><td> short epoch </td></tr>
* <tr><td> (10 char) </td><td> EEEEEEEEEE </td><td> short epoch </td></tr>

Keybase proof

I hereby claim:

  • I am jbharter on github.
  • I am altus (https://keybase.io/altus) on keybase.
  • I have a public key ASDECFXQXATwDGWNG7c1eUTVj3EH1ilIL-arOz3lwyrjUQo

To claim this, I am signing this object: