Skip to content

Instantly share code, notes, and snippets.

View clocklear's full-sized avatar
🕹️

Cory Locklear clocklear

🕹️
View GitHub Profile
@clocklear
clocklear / README.md
Created March 24, 2024 00:59
Changing TLS cert used in os-unifi-maxit (Unifi Controller, opnsense plugin)
  1. Obtain cert (however you like). Rest of this assumes you have a .p12 with the cert, key, and appropriate CA certs.
  2. Extract the constituent parts of the p12: a. openssl pkcs12 -in path_to_your_p12_file -nocerts -out privatekey.pem b. openssl pkcs12 -in path_to_your_p12_file -clcerts -nokeys -out cert.pem c. openssl pkcs12 -in path_to_your_p12_file -cacerts -nokeys -out cacerts.pem
  3. Unifi keystore is located in /usr/local/share/java/unifi/data. Change to the directory.
  4. Convert the private key from 2a to PKCS#1 format: a. openssl pkey -in privatekey.pem -traditional -out private.key
  5. Use ace.jar to import the key, cert, and CA cert chain to the keystore: a. java -jar ../lib/ace.jar import_key_cert private.key cert.pem cacerts.pem
@clocklear
clocklear / keybase.md
Created April 2, 2019 13:11
keybase.md

Keybase proof

I hereby claim:

  • I am clocklear on github.
  • I am corylocklear (https://keybase.io/corylocklear) on keybase.
  • I have a public key ASBBk0t0a9aa4kmb09s7gMvkRpRNh16Tfq9DLd3o0xQnFwo

To claim this, I am signing this object:

@clocklear
clocklear / kube.sh
Last active December 13, 2018 19:19
k8s/minikube automation script for Mac OS
#!/usr/bin/env bash
PROGNAME=$(basename $0)
# change these to fit your needs
IPRANGE="10.96.0.0/24"
FLAGS="--memory 4096 --cpus 4"
sub_help(){
echo "Usage: $PROGNAME <subcommand> [options]"
echo ""
@clocklear
clocklear / af-magic-shlvl-awsprofile.zsh-theme
Last active December 6, 2023 14:04
af-magic-shlvl.zsh-theme
# af-magic-shlvl.zsh-theme
# Repo: https://github.com/andyfleming/oh-my-zsh
# Direct Link: https://gist.github.com/clocklear/ba7ea8849d0a36141cd72e356d7e4a8a
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
# primary prompt
PROMPT='$FG[237]------------------------------------------------------------%{$reset_color%}
$FG[032]%~\
@clocklear
clocklear / pingstatus.sh
Created February 9, 2017 16:17
Quick Bash script for curl'ing an endpoint indefinitely. The script sends a single GET every second, and prints the iteration, the response code, and the response latency.
#!/bin/bash
# Colors!
BOLD='\033[1m'
GREEN='\033[32m'
WHITE='\033[37m'
RED='\033[91m'
YELLOW='\033[93m'
NC='\033[0m' # Reset everything
module.exports = function () {
return (+new Date() + Math.floor(Math.random() * 9999999).toString(36);
}