Skip to content

Instantly share code, notes, and snippets.

View geerlingguy's full-sized avatar
:shipit:
Tea, Earl Grey, hot.

Jeff Geerling geerlingguy

:shipit:
Tea, Earl Grey, hot.
View GitHub Profile
@geerlingguy
geerlingguy / desktop.yml
Created March 21, 2020 19:14
Playbook for local stuff
---
- hosts: localhost
connection: local
gather_facts: no
roles:
- name: gtk
tags: ['gtk']
- name: gnome_shell
@geerlingguy
geerlingguy / docker-compose-test.sh
Created March 15, 2020 01:54
Docker Compose exposed port test
# Create test VM with Vagrant.
mkdir testvm && cd testvm
vagrant init geerlingguy/ubuntu1804
# (Edit created Vagrantfile and uncomment `config.vm.network "private_network"` line)
# Start the VM and log in.
vagrant up
vagrant ssh
# Flush iptables rules (allow access to any port).
@geerlingguy
geerlingguy / deploy.yml
Created February 28, 2020 17:03
Playbook that builds and publishes a collection to Ansible Galaxy
---
- hosts: localhost
connection: local
gather_facts: false
vars:
# This should be set via the command line at runtime.
tag: ''
pre_tasks:
@geerlingguy
geerlingguy / molecule-3-up.sh
Last active January 15, 2021 13:52
Molecule 3.0 update script with all the little changes I had to make.
#!/bin/bash
#
# Update things to be compatible with Molecule 3.0.
#
# This script is NOT idempotent, and should never be run again.
exit 1
export LINT_STRING="lint: |
set -e
yamllint .
@geerlingguy
geerlingguy / pi-cpu-stress.sh
Last active March 28, 2024 15:20
Raspberry Pi CPU temperature and throttling test script
#!/bin/bash
# Raspberry Pi stress CPU temperature measurement script.
#
# Download this script (e.g. with wget) and give it execute permissions (chmod +x).
# Then run it with ./pi-cpu-stress.sh
#
# NOTE: In recent years, I've switched to using s-tui. See:
# https://github.com/amanusk/s-tui?tab=readme-ov-file#options
# Variables.
@geerlingguy
geerlingguy / membash.sh
Created August 2, 2019 15:13 — forked from goodevilgenius/membash.sh
[membash] BASH script which may be used to interact with memcache. All main memcache functions are supported. #memcache
#!/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 February 27, 2019 23:54
Monitor overall Kubernetes cluster utilization and capacity.
#!/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 December 14, 2018 22:46
BLT Docker Image 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 August 16, 2023 12:34
BLT Artifactory - Build BLT deployment artifacts with Docker
#!/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 September 19, 2018 16:05
AWS STS Token update playbook for MFA
#!/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