Skip to content

Instantly share code, notes, and snippets.

View kevinkirkup's full-sized avatar

Kevin S Kirkup kevinkirkup

  • Digital Realty Trust
  • Raleigh, NC
View GitHub Profile
@kevinkirkup
kevinkirkup / gist:d87dd09712f3f3589911cfd791386a5f
Created June 6, 2022 18:06 — forked from mprymek/gist:8379066
Elixir metaprogramming example
# This is an example of metaprogramming in the Elixir language.
#
# We will define a domain specific language (DSL) for the definition
# of a service which is watched by several sensors.
# Each sensor watches some property/functionality of the service and
# returns the result of the check.
#
# To determine if the service is functioning properly, we need functions
# to run all the sensors' code and gather the returned data.
#
@kevinkirkup
kevinkirkup / git-commit-template.md
Created January 12, 2022 21:37 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

One of my colleagues shared an article on writing (good) Git commit messages today: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@kevinkirkup
kevinkirkup / resources.md
Last active August 10, 2020 13:21 — forked from kevsmith/resources.md
Elixir & Erlang Resources
@kevinkirkup
kevinkirkup / mount.nfs2ramfs
Last active October 24, 2017 16:37 — forked from jiminald/mount.nfs2ramfs
Mount NFS to RAMFS for sharing multiple locations on one SAMBA Share
#!/bin/bash
SERVER=$1
NFS_SHARE=$2
LOCAL_SHARE=$3
RAMFS_SHARE=$4
echo "Setting up RamFS"
mkdir /tmp/ramfs
mkdir /tmp/ramfs/$RAMFS_SHARE
@kevinkirkup
kevinkirkup / kubernetes_on_macOS.md
Created May 22, 2017 18:45 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@kevinkirkup
kevinkirkup / reduce-size.dockerimage
Created April 24, 2017 20:29 — forked from NikoWoot/reduce-size.dockerimage
Reduce size of Docker image
=================================================
After software installation
=================================================
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
=================================================
Docker on build process, include all files on directory build (include .git with old build)
Solution for reduce size of docker image (but for reuse is not good solution)
=================================================
@kevinkirkup
kevinkirkup / Remove files or directory from history.md
Last active November 4, 2016 01:04 — forked from lausdahl/git-extract-subdir.md
How to Extract a Subdirectory as a New git Repository
$ git filter-branch --tree-filter 'rm -rf <some-dir>' --prune-empty HEAD
$ git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
@kevinkirkup
kevinkirkup / nth-commit.sh
Created February 5, 2016 04:05 — forked from airdrummingfool/nth-commit.sh
Checkout the nth commit on a specified branch.
#!/bin/bash
# nth-commit.sh
# Usage: `nth-commit.sh n [branch]`
branch=${2:-'master'}
SHA1=$(git rev-list $branch | tail -n $1 | head -n 1)
git checkout $SHA1
@kevinkirkup
kevinkirkup / update_build_number.sh
Created February 5, 2016 04:04 — forked from airdrummingfool/update_build_number.sh
Update current Xcode target's build number with the number of commits on a specified branch. http://tgoode.com/2014/06/05/sensible-way-increment-bundle-version-cfbundleversion-xcode/
#!/bin/bash
# update_build_number.sh
# Usage: `update_build_number.sh [branch]`
# Run this script after the 'Copy Bundle Resources' build phase
# Ref: http://tgoode.com/2014/06/05/sensible-way-increment-bundle-version-cfbundleversion-xcode/
branch=${1:-'master'}
buildNumber=$(expr $(git rev-list $branch --count) - $(git rev-list HEAD..$branch --count))
echo "Updating build number to $buildNumber using branch '$branch'."