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
### 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 March 5, 2018 03:17
Back up a JENKINS_HOME directory to Amazon S3. Meant to be run in a Jenkins job on the server.
---
- 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 March 5, 2018 03:10
Make sure Jenkins is always running. This script is meant to be run on a cron job under the root user.
#!/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
@geerlingguy
geerlingguy / gist:6363e5ac37672166053693b605506d98
Created July 31, 2017 03:37
Ansible Container local build info
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": {
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": {
@geerlingguy
geerlingguy / ansible-container-debug.json
Created June 30, 2017 05:19
ansible-container debug info
Ansible Container, version 0.9.1
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": 2,
"ContainerdCommit": {
@geerlingguy
geerlingguy / ansible-role-test.sh
Last active January 18, 2024 17:37
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
@geerlingguy
geerlingguy / project.yml
Created February 15, 2017 04:55
BLT project.yml - disable all BLT's module handling
...
modules:
local:
enable: { }
uninstall: { }
ci:
enable: { }
uninstall: { }
dev:
enable: { }
@geerlingguy
geerlingguy / build.xml
Last active April 11, 2017 18:27
build.xml file to support Config Split in BLT.
<project name="custom" default="build">
<!-- Override setup:update task for config import. -->
<target name="setup:update" description="Update current database to reflect the state of the Drupal file system.">
<!-- enable_property and uninstall_property must be set at this time. -->
<phingcall target="setup:toggle-modules"/>
<!-- Execute db updates. -->
<drush command="updb" assume="yes" alias="${drush.alias}">
 10:51 PM:~/Dropbox/VMs/packer/ubuntu1604 $ vagrant up vmware --debug --provider=vmware_fusion | tee | pbcopy
INFO global: Vagrant version: 1.8.6
INFO global: Ruby version: 2.2.5
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_OLD_ENV_NVM_CD_FLAGS=""
INFO global: VAGRANT_OLD_ENV___CF_USER_TEXT_ENCODING="0x1F6:0x0:0x0"
INFO global: VAGRANT_OLD_ENV_LSCOLORS="ExFxCxDxBxegedabagacad"
INFO global: VAGRANT_OLD_ENV_XPC_SERVICE_NAME="0"
INFO global: VAGRANT_OLD_ENV_SHLVL="1"
INFO global: VAGRANT_OLD_ENV_LOGNAME="jeff.geerling"