Skip to content

Instantly share code, notes, and snippets.

View voor's full-sized avatar
🐢
it's pronounced turtle cuddle

Robert Van Voorhees voor

🐢
it's pronounced turtle cuddle
View GitHub Profile
@voor
voor / helm-kubectl-minikube.sh
Last active October 12, 2018 19:40
Gets you setup on Fedora to start running minikube
#!/usr/bin/env sh
set -e
: ${INSTALL_DIR:="${HOME}/bin"}
export HELM_INSTALL_DIR=$INSTALL_DIR
# Get Minikube
curl -Lo ${INSTALL_DIR}/minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x ${INSTALL_DIR}/minikube
@voor
voor / install-chromedriver.sh
Last active August 6, 2018 18:09
One-liner for installing Google Chromedriver
#!/usr/bin/env sh
curl -L -s https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip -o /tmp/chromedriver_linux64.zip \
&& sudo sh -c 'unzip -p /tmp/chromedriver_linux64.zip > /usr/local/bin/chromedriver' \
&& sudo chmod +x /usr/local/bin/chromedriver \
&& rm /tmp/chromedriver_linux64.zip
#!/usr/bin/env sh
set -e
# Usage:
# latest-github-release.sh cloudfoundry/bosh-bootloader linux
# $1 - org/repo
# $2 - passed to grep (i.e., linux, x86-64, rpm, deb, darwin, etc.)
# $3 - final binary name (terraform, cat, dog, etc.)
#
# If you want to be super fancy (and risky):
@voor
voor / replaceCertificateEmbeddedPSC.sh
Created March 18, 2019 20:07 — forked from dlinsley/replaceCertificateEmbeddedPSC.sh
Replace machine certificate with CA signed certificate on vCenter Appliance 6.5 with embedded PSC without using the vSphere Certificate Manager Utility in a shell script
#!/bin/bash
#
# In the local directory 3 files are required
# new_cert.crt - new machine certificate
# new_cert.key - private key for certificate
# intermediary.crt - certificate chain of the signing authority for new_cert.crt
#
# Run commands on the vCSA shell:
# import intermediary authority cert:
@voor
voor / vcenter-fingerprint.sh
Created May 30, 2019 19:14
Get the fingerprint of your vcenter server quickly and painlessly. Change `$VCENTER` to proper address.
echo "Q" | openssl s_client -showcerts -connect $VCENTER:443 2>/dev/null | openssl x509 -sha1 -fingerprint -noout | sed 's/SHA1 Fingerprint=//'
@voor
voor / security-context-root-pod.yml
Last active June 22, 2019 19:28
Code snippets for explaining Pod Security Policies and Security Context
apiVersion: v1
kind: Pod
metadata:
name: security-context-root-pod
spec:
securityContext:
runAsUser: 0
containers:
- name: whatever
image: busybox
@voor
voor / build_serviceaccount_kubeconfig.sh
Last active January 20, 2023 17:49 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account or build kubeconfig for existing service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]] || [[ -z "$3" ]]; then
echo "usage: $0 <service_account_name> <namespace> <target_folder>"
exit 1
fi
@voor
voor / main.go
Created August 22, 2019 01:37 — forked from micahhausler/main.go
CloudConfig loop vs global map benchmark
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws/endpoints"
"gopkg.in/gcfg.v1"
)
type CloudConfig struct {
@voor
voor / aws.ini
Last active June 28, 2023 05:56
100% Offline installation on Ubuntu with kubeadm for Kubernetes 1.15.3
[Global]
[ServiceOverride "ec2"]
URL = "https://ec2.${AWS_ENDPOINT_URL}"
SigningRegion = "${AWS_REGION}"
Region = "${AWS_REGION}"
SigningMethod = v4
Service = ec2
[ServiceOverride "elasticloadbalancing"]
oscap xccdf generate fix --profile xccdf_org.ssgproject.content_profile_ospp --template urn:xccdf:fix:script:ansible xccdf-file.xml