Skip to content

Instantly share code, notes, and snippets.

View mpepping's full-sized avatar

Martijn Pepping mpepping

View GitHub Profile
@mpepping
mpepping / generate_new_kubeconfig.sh
Created May 25, 2023 08:37 — forked from Oats87/generate_new_kubeconfig.sh
This bash script will sign an x509 certificate using the kube-ca located on any rancher node. This allows you to gain access back to your RKE-created kubernetes cluster should you lose the kube_config and cluster.yml for it, but still have SSH access to the hosts.
#!/bin/bash
echo "This will generate a new kube config for accessing your RKE-created kubernetes cluster. This script MUST be run on a Kubernetes node."
echo "Please enter the IP of one of your control plane hosts, followed by [ENTER]:"
read cphost
openssl genrsa -out kube-admin.key 2048
openssl req -new -sha256 -key kube-admin.key -subj "/O=system:masters/CN=kube-admin" -out kube-admin.csr
sudo openssl x509 -req -in kube-admin.csr -CA /etc/kubernetes/ssl/kube-ca.pem -CAcreateserial -CAkey /etc/kubernetes/ssl/kube-ca-key.pem -out kube-admin.crt -days 365 -sha256
sudo rm -f /etc/kubernetes/ssl/kube-ca.srl
@mpepping
mpepping / amethyst.md
Last active April 8, 2023 09:53
Amethyst for MacOS keyboard shortcuts cheat sheet

Amethyst

Amethyst is a tiling window manager for MacOS. This cheat sheet is to support my attempt to remember all of the keyboard shortcuts that are useful for me. See Amethyst preferences for the full list, or to record/remap your own.


Shortcuts Description
Option + Shift + Space Cycle layout forward
@mpepping
mpepping / clone-vm.sh
Created October 23, 2022 11:57
ESXi clone VM shell-script
#!/bin/sh
#File: clonevm.sh
#Version: 2020.09.23.A
#Author: www.grangerx.com
#Set debug = true to enable debug echoes.
debug=false
#For format: accepts same, zeroedthick, eagerzeroedthick, thin, rdm:dev, rdmp:dev, or 2gbsparse.
format="thin"
@mpepping
mpepping / packages.sh
Last active March 7, 2022 20:26
packages.sh - script to install and update Vim >= 8 packages
#!/usr/bin/env bash
# Create new folder in ~/.vim/pack that contains a start folder and cd into it.
#
# Arguments:
# package_group, a string folder name to create and change into.
#
# Examples:
# set_group syntax-highlighting
#
function set_group () {
@mpepping
mpepping / token.applescript
Created April 6, 2019 12:20
AppleScript to copy a Safenet MobilePASS OTP
-- AppleScript to copy a Safenet MobilePASS OTP.
--
-- 'osascript ~/path/to/token.applescript'
-- Set 'passwd' to your MobilePASS passcode.
set passwd to "0000"
-- Start MobilePASS
tell application "MobilePASS"
activate
delay 1
@mpepping
mpepping / aws-cli.md
Last active August 13, 2022 04:59
aws-cli
#!/bin/bash
#
# https://support.1password.com/command-line-getting-started/
#
# Full docs: https://support.1password.com/command-line/
#
# gpg --receive-keys 3FEF9748469ADBE15DA7CA80AC2D62742012EA22
# gpg --verify op.sig op
#
" My .vimrc for Vim, MacVim and Gvim/win32
" 0. VUNDLE SETUP
" 1. FILE HANDLING
" 2. LOOK & FEEL
" 3. MAPPINGS
" 4. NETRW CFG
" 5. MACVIM
" 6. GVIM/WIN32
" 7. SPELL & DICT
#!/bin/sh
#
# mcollective Application Server for STOMP based agents
#
# chkconfig: - 24 76
#
# description: mcollective lets you build powerful Stomp compatible middleware clients in ruby without having to worry too
# much about all the setup and management of a Stomp connection, it also provides stats, logging and so forth
# as a bonus.
#
@mpepping
mpepping / gemrc
Last active September 27, 2022 11:28
Ruby gemrc with install options, such as proxy settings
---
# See 'gem help env' for additional options.
gem: --no-ri --no-rdoc
verbose: true
backtrace: true
bulk_threshold: 1000
http_proxy: http://proxy.example.com:8080