Skip to content

Instantly share code, notes, and snippets.

@kjivan
kjivan / keybase.md
Created February 1, 2019 01:03
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@kjivan
kjivan / create-self-signed-cert
Created December 14, 2020 20:57
Create self-signed cert and p12 private cert
#!/usr/bin/env bash
set -e
# https://stackoverflow.com/a/41366949
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
-keyout example.key -out example.crt -extensions san -config \
<(echo "[req]";
echo distinguished_name=req;
echo "[san]";
echo subjectAltName=DNS:example.com,DNS:www.example.net,IP:10.0.0.1
@kjivan
kjivan / add-prod-banner.js
Last active January 30, 2021 14:56
Adds a banner to help indicate prod environment
var d = document.createElement("div");
d.style.position = "sticky";
d.style.top = "0px";
d.style.zIndex = "16777271";
d.style.width = "100%";
d.style.height = "30px";
d.style.padding = "2px";
d.style.fontSize = "20px";
d.style.backgroundColor = "red";
d.style.color = "black";
@kjivan
kjivan / shell-prompt-customization.md
Last active March 29, 2021 16:34
Shell Prompt Customization
@kjivan
kjivan / kubectl-reference.md
Last active April 2, 2021 21:52
Kubectl Reference

Extract Truststore from secret

kubectl get secret <secret> \
-o json \
| jq --raw-output '. | .data."<trust-store>.jks"' \
| base64 -D > <trust-store>.jks

Patch Secret with TrustStore

Bash

@kjivan
kjivan / create-self-signed-cert-and-pkcs12.bash
Last active July 2, 2021 19:49
Creates Self Signed Cert and PKCS12
#!/usr/bin/env bash
set -euo pipefail
if [ $# -ne 3 ]
then
echo ""${0##*/}" CN OU FILE_NAME"
exit
fi
# Certificate Attributes

Gradle Linting Plugins

Gradle Dependency Linting

Install

Add the following to the plugins section of build.gradle

id 'nebula.lint' version '16.17.0'

Add the following for gradle dependency linting

@kjivan
kjivan / sql-reference.md
Last active November 12, 2021 22:16
SQL Reference
list="a b"
for x in $list; do
echo $x
done
for x in "a" "b"; do
echo $x
done

Regex Reference

Match one word or the other

(?:apple|banana)