Skip to content

Instantly share code, notes, and snippets.

View iammoen's full-sized avatar
🏠
Working from home

Chris Moen iammoen

🏠
Working from home
  • Falcon Heights, MN
View GitHub Profile
@iammoen
iammoen / statefulset.yaml
Created August 19, 2020 01:16
tls-toolkit code
{{ if .Values.properties.clusterSecure }}
${NIFI_TOOLKIT_HOME}/bin/tls-toolkit.sh standalone -n "${FQDN}" \
--clientCertDn "CN=${FQDN}, OU=NIFI" \
--certificateAuthorityHostname ${FQDN} \
--subjectAlternativeNames 'localhost{{- if .Values.properties.webProxyHost -}},{{ .Values.properties.webProxyHost }}{{- end -}}' \
--outputDirectory "${NIFI_HOME}/conf/" \
--isOverwrite
KEYSTORE_PASSWORD=`grep keystorePasswd ${NIFI_HOME}/conf/${FQDN}/nifi.properties | awk 'BEGIN { FS = "=" } ; { print $2 }'`
KEY_PASSWORD=`grep keyPasswd ${NIFI_HOME}/conf/${FQDN}/nifi.properties | awk 'BEGIN { FS = "=" } ; { print $2 }'`
@iammoen
iammoen / Vagrantfile
Created June 29, 2020 11:46
Vagrantfile to build k3s cluster
default_box = 'ubuntu/bionic64'
Vagrant.configure(2) do |config|
config.vm.define 'master' do |master|
master.vm.box = default_box
master.vm.hostname = "master"
master.vm.synced_folder ".", "/vagrant", type:"virtualbox"
master.vm.network 'private_network', ip: "192.168.0.200", virtualbox__intnet: true
master.vm.network "forwarded_port", guest: 22, host: 2222, id: "ssh", disabled: true
master.vm.network "forwarded_port", guest: 22, host: 2000 # SSH TO MASTER/NODE
@iammoen
iammoen / backuprepo.sh
Created January 27, 2020 16:47
Function for zshrc file that will backup the current git repo by finding the git root, zipping it all up, and putting it in ~/backups/
backuprepo() {
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
declare -i LOOP=0
declare -i LOOPMAX=10
while [ ! -d "${DIR}/.git/" ] && [ "${LOOP}" -ne "${LOOPMAX}" ]; do
DIR="$( echo $DIR | sed 's/\(.*\)\/.*/\1/' )"
LOOP=$((LOOP+1))
done
if [ "${LOOP}" -ne "${LOOPMAX}" ]
then
@iammoen
iammoen / testkitchen.sh
Created January 27, 2020 16:45
A function that I put in my .zsrhc file to allow quick test kitchen commands
tk() {
additionalParams="${@:2}"
if [ "$1" = "dc" ]
then
echo "exec: kitchen destroy ${additionalParams} && kitchen converge ${additionalParams}"
kitchen destroy ${additionalParams} && kitchen converge ${additionalParams}
elif [ "$1" = "l" ]
then
@iammoen
iammoen / sshinto.sh
Created January 21, 2020 18:23
bash script function that I put in .zshrc that parses my ssh config file and allows me to select which server I want to ssh into easily.
sshinto() {
declare -a vmArray=( $(sed -nE 's/^Host ([^github])/\1/p' ~/.ssh/config) )
vmArray_ArrayLen=${#vmArray[@]}
re='^[0-9]+$'
if [[ $1 = "" ]]
then
if [[ vmArray_ArrayLen -ne 0 ]]
then
tput setaf 4
@iammoen
iammoen / vagrant box outdated --global output
Last active October 28, 2019 15:49
Vagrant log output
INFO global: Vagrant version: 2.2.6
INFO global: Ruby version: 2.4.9
INFO global: RubyGems version: 2.6.14.4
INFO global: VAGRANT_LOG="info"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/bin/vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_INSTALLER_ENV="1"
WARN global: resolv replacement has not been enabled!
INFO manager: Registered plugin: NFS synced folders
@iammoen
iammoen / response.js
Last active December 11, 2022 09:07
{
"success": true,
"messages": [
{
"clientid": "XXX",
"feedid": 1,
"platform": "tw",
"platformid": "757623239312936960",
"posttime": "2016-07-25T17:07:10.000Z",
"original": {
// EXAMPLE 1
{
"_id": ObjectId("XXX"),
"clientid": "XXX",
"feedid": "1",
"platform": "tw",
"platformid": "752521840640159744",
"posttime": new Date("2016-07-11T10:16:02-0500"),
"meta": {
"tags": [
platform: {type: String, required: true},
platformid: {type: String, required: true},
posttime: {type: Date, required: true},
feedid: {type: String, required: true},
clientid: {type: String, required: true},
meta: {
tags: [{type: String}],
rating: {type: Number, min: 1, max: 10, default: 0, required: true},
approval: {
isapproved: {type: Boolean, required: true, default: false},
<h3 class="title js-activate-block">
<a href="/farm-loans/operating-loans">Terms + Flexibility</a></h3>
<p class="info">
Find the right financing based on factors that matter to you and your operation.</p>