Skip to content

Instantly share code, notes, and snippets.

View casibbald's full-sized avatar

Charles Sibbald casibbald

  • Bulgaria
  • 05:31 (UTC +03:00)
View GitHub Profile
@Cellebyte
Cellebyte / lvm_expand_on_boot.sh
Last active April 30, 2020 14:41
This script can expand an lvm on bootup.
#!/usr/bin/env bash
declare -A ratios
declare -A freespace
declare -A units
declare -r DRY_RUN="${1}"
declare HIDDEN_PARTITION="${2}"
declare LVM_PARTITION="${3}"
grow_partitions=("${HIDDEN_PARTITION:=/dev/sda2}" "${LVM_PARTITION:=/dev/sda5}")
@casibbald
casibbald / pod.yaml
Created March 29, 2019 15:26 — forked from matthewpalmer/pod.yaml
Example Kubernetes pod for the multi-container sidecar design pattern
# Example YAML configuration for the sidecar pattern.
# It defines a main application container which writes
# the current date to a log file every five seconds.
# The sidecar container is nginx serving that log file.
# (In practice, your sidecar is likely to be a log collection
# container that uploads to external storage.)
# To run:
@trondhindenes
trondhindenes / .gitlab-ci.yml
Last active April 17, 2024 10:07
Run KinD (Kubernetes in Docker) as part of Gitlab CI job
#Spin up Kubernetes control plane as part of before_script, and destroys it using after_script
#Some custom logic to get to the right ip address
#Requres the gitlab docker runner, with "pass-thru" to the host docker socket.
stages:
- test
image: python:3.6.6 #the docker image you run in needs Docker installed, and access to the host docker socket.
test_integration_k8s:
tags:
@sickbock
sickbock / create_vm.sh
Last active March 10, 2021 05:12
VirtualBox PXE boot
#!/bin/bash
cd ${myVMs}
MyVM=testvm
vboxmanage unregistervm ${MyVM} --delete
rm -rf ${MyVM}
mkdir ${MyVM}
cd ${MyVM}
vboxmanage createhd --filename ${MyVM}.vdi --size 30720
vboxmanage createvm --name ${MyVM} --ostype RedHat_64 --register
vboxmanage modifyvm ${MyVM} --memory 6172 --vram=12 --acpi on --nic1 NAT # optional second NIC # --nic2 bridged --bridgeadapter2 enp0s25
@skyl
skyl / install.rb
Last active March 21, 2024 17:58
Homebrew without sudo
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
# SET YOUR_HOME TO THE ABSOLUTE PATH OF YOUR HOME DIRECTORY
# chmod +x install.rb
# ./install.rb
YOUR_HOME = ''
HOMEBREW_PREFIX = "#{YOUR_HOME}/usr/local"
HOMEBREW_CACHE = '/Library/Caches/Homebrew'
HOMEBREW_REPO = 'https://github.com/Homebrew/homebrew'
@rhwood
rhwood / install.sh
Last active December 10, 2015 15:20
OS X LaunchDaemon for a Jenkins Java Web Start slave. This is now maintained at https://github.com/rhwood/jenkins-slave-osx Please refer to that version instead.
#!/bin/sh
# create jenkins group
NEXT_GID=$((`dscl /Local/Default list /Groups gid | awk '{ print $2 }' | sort -n | grep -v ^[5-9] | tail -n1` + 1))
sudo dscl /Local/Default create /Groups/jenkins
sudo dscl /Local/Default create /Groups/jenkins PrimaryGroupID $NEXT_GID
sudo dscl /Local/Default create /Groups/jenkins Password \*
sudo dscl /Local/Default create /Groups/jenkins RealName 'Jenkins Node Service'
# create jenkins user
NEXT_UID=$((`dscl /Local/Default list /Users uid | awk '{ print $2 }' | sort -n | grep -v ^[5-9] | tail -n1` + 1))
sudo dscl /Local/Default create /Users/jenkins
@nateware
nateware / haproxy.conf
Created October 31, 2012 15:36
HAProxy sample config for EC2
#
# This config file is a combination of ideas from:
# http://www.37signals.com/svn/posts/1073-nuts-bolts-haproxy
# http://www.igvita.com/2008/05/13/load-balancing-qos-with-haproxy/
# http://wiki.railsmachine.com/HAProxy
# http://elwoodicious.com/2008/07/15/nginx-haproxy-thin-fastcgi-php5-load-balanced-rails-with-php-support/
# http://upstream-berlin.com/2008/01/09/using-haproxy-with-multiple-backends-aka-content-switching/
# http://wiki.railsmachine.com/HAProxy
# http://gist.github.com/raw/25482/d39fb332edf977602c183194a1cf5e9a0b5264f9
#