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
# Drain and delete the nodes (for each node you have)
kubectl drain kubenode1 --delete-local-data --force --ignore-daemonsets
kubectl delete node kubenode1
# Reset the deployment
sudo kubeadm reset
# On each node
## Reset the nodes and weave
@cxhercules
cxhercules / k8s-user-data.sh
Created December 27, 2018 06:04 — forked from MeenachiSundaram/k8s-user-data.sh
kubernetes user data script
#!/bin/bash
apt-get update
apt-get install -y git wget
# Install Docker
apt-get install \
apt-transport-https \
ca-certificates \
curl \
@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 / 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
@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)
@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
@cxhercules
cxhercules / 3sync.go
Created November 16, 2016 18:45 — forked from rossdylan/3sync.go
attempting to sync files to s3 using golang and goamz
package main
import (
"crypto/md5"
"flag"
"fmt"
"io"
"launchpad.net/goamz/aws"
"launchpad.net/goamz/s3"
"os"