Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Tea, Earl Grey, hot.

Jeff Geerling geerlingguy

:shipit:
Tea, Earl Grey, hot.
View GitHub Profile
@geerlingguy
geerlingguy / membash.sh
Created Aug 2, 2019 — forked from goodevilgenius/membash.sh
[membash] BASH script which may be used to interact with memcache. All main memcache functions are supported. #memcache
View membash.sh
#!/bin/bash
# Gist: 11375877
# Url: https://gist.github.com/goodevilgenius/11375877
#
# All memcache functions are supported.
#
# Can also be sourced from other scripts, e.g.
# source membash.sh
# MCSERVER="localhost"
@geerlingguy
geerlingguy / k8s-cluster-resources.sh
Created Feb 27, 2019
Monitor overall Kubernetes cluster utilization and capacity.
View k8s-cluster-resources.sh
#!/bin/bash
#
# Monitor overall Kubernetes cluster utilization and capacity.
#
# Original source:
# https://github.com/kubernetes/kubernetes/issues/17512#issuecomment-367212930
#
# Tested with:
# - AWS EKS v1.11.5
#
@geerlingguy
geerlingguy / Dockerfile
Created Dec 14, 2018
BLT Docker Image Dockerfile
View Dockerfile
# Note: Your base image should contain all the PHP extensions required by your project.
FROM my/base-drupal-container:latest
# Set the project machine name here.
ENV PROJECT my-blt-project
# Copy the deployment artifact into place.
COPY deploy/ /var/www/$PROJECT
# Copy the Drupal container settings file into place.
@geerlingguy
geerlingguy / blt-artifactory.sh
Last active Dec 14, 2018
BLT Artifactory - Build BLT deployment artifacts with Docker
View blt-artifactory.sh
#!/bin/bash
#
# BLT Deployment Artifact generator using a local Docker image.
#
# Source: https://gist.github.com/geerlingguy/85b816ed7aff378ea2700b82ebde81c8
#
# This script should be run from within the BLT project directory root. If it is
# run elsewhere, the project_dir should be updated accordingly.
name="blt-artifactory"
@geerlingguy
geerlingguy / aws-sts-token
Created Sep 19, 2018
AWS STS Token update playbook for MFA
View aws-sts-token
#!/usr/bin/env ansible-playbook -c local
#
# AWS STS token update playbook.
#
# Updating AWS session tokens with STS can be a pain. But MFA is good. So let's
# automate the management of the .aws/credentials file to make it not painful!
#
# Usage:
#
# 1. Save this to a file like /usr/local/bin/aws-sts-token
View gist:9ea88a777268437a12cb2ef81dd8cb22
### Keybase proof
I hereby claim:
* I am geerlingguy on github.
* I am geerlingguy (https://keybase.io/geerlingguy) on keybase.
* I have a public key whose fingerprint is F1B7 53F3 6A25 2E0A 675D 1F58 AEAA 5300 29A4 5908
To claim this, I am signing this object:
@geerlingguy
geerlingguy / jenkins-backup.yml
Created Mar 5, 2018
Back up a JENKINS_HOME directory to Amazon S3. Meant to be run in a Jenkins job on the server.
View jenkins-backup.yml
---
- hosts: localhost
gather_facts: no
connection: local
vars:
aws_region: us-east-1
aws_profile: default
s3_bucket_name: jenkins-backup
jenkins_home: /var/lib/jenkins
@geerlingguy
geerlingguy / enforce-jenkins-running.sh
Created Mar 5, 2018
Make sure Jenkins is always running. This script is meant to be run on a cron job under the root user.
View enforce-jenkins-running.sh
#!/bin/bash
#
# Makes sure Jenkins is running.
# Function to restart Jenkins, record the occurrence, and exit.
restart_jenkins() {
/usr/sbin/service jenkins restart > /dev/null
echo `date` "Restarted Jenkins" >> ~/jenkins-restarts
echo "Restarted Jenkins."
exit
View gist:6363e5ac37672166053693b605506d98
Ansible Container, version 0.9.2rc0
Darwin, JJG-MBP, 16.7.0, Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64, x86_64
2.7.13 (default, Dec 18 2016, 07:03:39)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] /usr/local/opt/python/bin/python2.7
{
"ContainersPaused": 0,
"Labels": null,
"CgroupDriver": "cgroupfs",
"ContainersRunning": 0,
"ContainerdCommit": {
View gist:98cb8a4b61baa285bafe813823eb2b23
Ansible Container, version 0.9.2rc0
Darwin, JJG-MBP, 16.6.0, Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64, x86_64
2.7.13 (default, Dec 18 2016, 07:03:39)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] /usr/local/opt/python/bin/python2.7
{
"ContainersPaused": 0,
"Labels": null,
"CgroupDriver": "cgroupfs",
"ContainersRunning": 0,
"ContainerdCommit": {
You can’t perform that action at this time.