Skip to content

Instantly share code, notes, and snippets.

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

Christian Hercules cxhercules

🏠
Working from home
  • cxh
  • CA
View GitHub Profile
@cxhercules
cxhercules / pem-split
Created August 23, 2018 15:34 — forked from jinnko/pem-split
Take a PEM format file as input and split out certs and keys into separate files.
#!/usr/bin/awk -f
#
# Take a PEM format file as input and split out certs and keys into separate files
#
BEGIN { n=0; cert=0; key=0; if ( ARGC < 2 ) { print "Usage: pem-split FILENAME"; exit 1 } }
/-----BEGIN PRIVATE KEY-----/ { key=1; cert=0 }
/-----BEGIN CERTIFICATE-----/ { cert=1; key=0 }
split_after == 1 { n++; split_after=0 }
/-----END CERTIFICATE-----/ { split_after=1 }
@cxhercules
cxhercules / helm-recover.md
Last active August 12, 2018 16:58
Recover item you have deleted from helm deployment

I looked around and did not find an answer to this so just sharing.

I deployed a jenkins chart using below command:

helm install -n cd stable/jenkins -f jenkins/values.yaml --version 0.16.6 --wait

Then I wanted to remove external load balancer for a bit, just testing some things so removed it by:

@cxhercules
cxhercules / readme.md
Created August 12, 2018 16:51 — forked from benstr/readme.md
Gist Markdown Cheatsheet

#Heading 1 ##Heading 2 ###Heading 3 ####Heading 4 #####Heading 5 ######Heading 6


Paragraph

@cxhercules
cxhercules / fork forced sync
Created July 25, 2018 15:15 — forked from glennblock/fork forced sync
Force your forked repo to be the same as upstream.
git fetch upstream
git reset --hard upstream/master
@cxhercules
cxhercules / genkeys.sh
Last active January 25, 2018 07:27 — forked from jhamrick/genkeys.sh
Generate SSL certificates with IP SAN
#!/usr/bin/env bash
#
# Generate a set of TLS credentials that can be used to run development mode.
#
# Based on script by Ash Wilson (@smashwilson)
# https://github.com/cloudpipe/cloudpipe/pull/45/files#diff-15
#
# usage: sh ./genkeys.sh NAME HOSTNAME IP
set -o errexit
## https://github.com/rbenv/ruby-build/issues/377#issuecomment-310569462
CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl`" rbenv install 2.3.4
@cxhercules
cxhercules / generate.sh
Created September 20, 2017 06:47
Create a Wildcard SubjectAltName Self-Signed Certificate
#!/usr/bin/env bash
# See: http://apetec.com/support/GenerateSAN-CSR.htm
# See: http://fbcs.co.uk/self-signed-multiple-domain-ssl-certificates/
# See: https://gist.github.com/scottvrosenthal/5691305
# Make a temp directory and go there
TMP_DIR=$(mktemp -d)
cd $TMP_DIR
echo $(pwd)
Thu Jul 6 22:17:53 UTC 2017
@cxhercules
cxhercules / install-python.sh
Created May 10, 2017 18:38 — forked from osterman/install-python.sh
Install Python on CoreOS
#!/bin/bash -uxe
VERSION=2.7.13.2713
PACKAGE=ActivePython-${VERSION}-linux-x86_64-glibc-2.3.6-401785
# make directory
mkdir -p /opt/bin
cd /opt
wget http://downloads.activestate.com/ActivePython/releases/${VERSION}/${PACKAGE}.tar.gz
#!/bin/bash
# Create .gitkeep files to add "empty" folders to git
function gitkeep () {
find . -type d -empty -not -path "./.git/*" -exec touch {}/.gitkeep \;
}
# Docker
function docker-set () {
DockerStatus=`docker-machine status`