Skip to content

Instantly share code, notes, and snippets.

View clocklear's full-sized avatar
🕹️

Cory Locklear clocklear

🕹️
View GitHub Profile
module.exports = function () {
return (+new Date() + Math.floor(Math.random() * 9999999).toString(36);
}
@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
@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 / 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 / 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 / README.md
Last active August 2, 2024 21:05
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:
    1. openssl pkcs12 -in path_to_your_p12_file -nocerts -out privatekey.pem
    2. openssl pkcs12 -in path_to_your_p12_file -clcerts -nokeys -out cert.pem
    3. 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:
    1. 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:
  6. java -jar ../lib/ace.jar import_key_cert private.key cert.pem cacerts.pem
evergreen.segment.com
*.rvohealth.com
soonpubplatform.online
*.soonpubplatform.online
@clocklear
clocklear / aws_unified_search_filter.js
Last active December 18, 2024 13:19
Remove specific results from AWS unified search results. Pass an array of partial string matches and all items with hrefs containing those words will be removed from search.
(function(filterWords) {
function hideLiWithFilterWords(words) {
words.forEach(function(word) {
document.querySelectorAll(`#aws-unified-search-container ol li h3 a[href*="${word}"]`).forEach(function(element) {
const liElement = element.closest('li');
if (liElement) {
liElement.style.setProperty('display', 'none', 'important');
}
});
});
@clocklear
clocklear / script.js
Last active February 11, 2025 16:09
Github Golang PR Remove Vendor Files
// ==UserScript==
// @name Github Golang PR Remove Vendor Files
// @namespace https://gist.github.com/clocklear/566edbfe5f302401bf9c47f6520ae09c
// @version 2025-02-07
// @description Add a button to remove Golang vendor files from Github PRs
// @author Cory Locklear
// @match https://github.com/*/pull/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// ==/UserScript==