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 / minecraft.yml
Created Sep 24, 2020
Minecraft installation on Kubernetes via Ansible and Helm
View minecraft.yml
# Minecraft Server deployment for Kubernetes clusters via Ansible's Helm module.
#
# The Helm module is part of the Kubernetes collection. Install it with:
#
# ansible-galaxy collection install community.kubernetes
#
# Then run the playbook:
#
# ansible-playbook main.yml
#
@geerlingguy
geerlingguy / travis-ci-docker-upgrade.sh
Last active Aug 12, 2020
Upgrade Docker CE version in Travis CI environments
View travis-ci-docker-upgrade.sh
#!/bin/bash
#
# See: https://docs.travis-ci.com/user/docker/#installing-a-newer-docker-version
#
# Add the following in your .travis.yml file to upgrade Docker prior to your build:
#
# before_install:
# - curl https://gist.githubusercontent.com/geerlingguy/ce883ad4aec6a5f1187ef93bd338511e/raw/36612d28981d92863f839c5aefe5b7dd7193d6c6/travis-ci-docker-upgrade.sh | sudo bash
#
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@geerlingguy
geerlingguy / mariadb.yml
Last active Oct 12, 2020
Wordpress in Kubernetes K3s on Raspberry Pi
View mariadb.yml
# This manifest assumes 'wordpress' namespace is already present:
#
# kubectl create namespace wordpress
#
# Apply the manifest with:
#
# kubectl apply -f mariadb.yml
---
apiVersion: v1
kind: Secret
@geerlingguy
geerlingguy / drupal.yml
Last active Aug 25, 2020
Drupal in Kubernetes K3s on Raspberry Pi
View drupal.yml
# This manifest assumes 'drupal' namespace is already present:
#
# kubectl create namespace drupal
#
# Apply the manifest with:
#
# kubectl apply -f drupal.yml
---
kind: ConfigMap
apiVersion: v1
@geerlingguy
geerlingguy / pi-general-benchmark.sh
Last active Sep 12, 2020
Raspberry Pi Benchmark Suite - Phoronix
View pi-general-benchmark.sh
#!/bin/bash
#
# Benchmark script for Raspberry Pi OS.
#
# WARNING: This script is meant to be run as the root user.
# This script should never be run on a system/partition you
# care about. You should only run this on a system that you
# intend to use only for benchmarking and can reinstall or
# re-flash easily.
#
@geerlingguy
geerlingguy / desktop.yml
Created Mar 21, 2020
Playbook for local stuff
View desktop.yml
---
- hosts: localhost
connection: local
gather_facts: no
roles:
- name: gtk
tags: ['gtk']
- name: gnome_shell
@geerlingguy
geerlingguy / docker-compose-test.sh
Created Mar 15, 2020
Docker Compose exposed port test
View docker-compose-test.sh
# 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 Feb 28, 2020
Playbook that builds and publishes a collection to Ansible Galaxy
View deploy.yml
---
- 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 Sep 25, 2020
Molecule 3.0 update script with all the little changes I had to make.
View molecule-3-up.sh
#!/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 Sep 12, 2020
Raspberry Pi CPU temperature and throttling test script
View pi-cpu-stress.sh
#!/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
# Variables.
test_run=1
test_results_file="/home/pi/cpu_temp_$test_run.log"
stress_length="10m"
You can’t perform that action at this time.