Skip to content

Instantly share code, notes, and snippets.

View deardooley's full-sized avatar

Rion Dooley deardooley

View GitHub Profile
@deardooley
deardooley / gist:f5512a966ddad73b19eb
Created March 21, 2015 16:30
figexec - Bash script to add docker exec support for fig orchestrations
#!/bin/bash
######################################################################
#
# figexec
#
# Author: Rion Dooley <deardooley@gmail.com>
# Description:
# This script emulates the functionality one would expect if `docker exec`
# functionality were supported in fig. Simply run this from your project
@deardooley
deardooley / jsonpki.sh
Last active August 29, 2015 14:19
This is a utility script to serialize keys and passwords into strings that can be safely used as string values in JSON objects.
#!/bin/bash
#
# Name: jsonpki.sh
#
# Author: Rion Dooley - deardooley
#
# Description: This is a utility script to serialize keys and passwords into
# strings that can be included safely in json objects and sent to a remote
# server. There are surely other ways to do this, but this seems to work well
# in situations such as creating system descriptions for use in the Agave
@deardooley
deardooley / 000-default.conf
Last active February 21, 2023 03:19
Sample Apache virtual host to proxy subdomain to docker container
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www
ServerName docker.example.com
ErrorLog logs/docker.example.com_error.log
CustomLog logs/docker.example.com_access.log combined
ProxyPreserveHost On
ProxyRequests off
<Location />
@deardooley
deardooley / lamp-mysql-slurm-ftpd
Last active September 15, 2015 11:16
Docker Compose file for lamp, mysql, slurm, ftpd. Save as `docker-compose.yml` and change the hostname to your server or VM hostname. **Do not use this in production!!!**
web:
image: php:5.6-apache
hostname: docker.example.com
ports:
- "80:80"
- "443:443"
links:
- mysql
- ftpd
- slurm
@deardooley
deardooley / Dockerfile
Last active November 9, 2015 03:42
Quick test image for abaco that will document the date locally and make a webhook callout to a URL passed as the message to get a timestamp externally.
FROM alpine:latest
ADD start.sh /docker_entrypoint.sh
RUN chmod +x /docker_entrypoint.sh
CMD ["sh", "/docker_entrypoint.sh"]
@deardooley
deardooley / keybase.md
Created March 5, 2017 01:39
keybase.md

Keybase proof

I hereby claim:

  • I am deardooley on github.
  • I am deardooley (https://keybase.io/deardooley) on keybase.
  • I have a public key whose fingerprint is 5969 9C3F 1F93 B12C 3DCB 59F4 4486 8378 4860 6209

To claim this, I am signing this object:

@deardooley
deardooley / docker.aliases.sh
Created July 20, 2018 17:11
Some extra CLI sugar to make working with the Docker command line a bit less painful. Curated from around the web and extended with prompts, regex matching and extra aliases and shortcuts.
#!/bin/bash
# Use these in your .dotfiles to help make Docker more manageable
#alias dip='dmachine ip 2> /dev/null'
alias drund="docker run -d -P"
alias drun="docker run -t -i -P"
alias dimg="di"
alias dexec='dx'
alias dc='docker-compose'
@deardooley
deardooley / ldap2json.sh
Created January 27, 2019 00:24
Parse output of ldapsearch to json
#!/usr/bin/env bash
# ldap2json.sh
#
# Example shell script showing how to parse LDIF output from the
# ldapsearch command into a json array. Please note that this
# script almost certainly does not handle every edge case, and
# is best used to pull a handful of fields a user or group
# record in a FreeIPA ldap server and format them as JSON for use
# in other tools.
@deardooley
deardooley / RUNBOOK.md
Created February 27, 2019 04:30 — forked from voxxit/RUNBOOK.md
Example of a solid run book/operations manual

Run Book / Operations Manual

  1. Table of Contents
  2. System Overview
    • Service Overview
    • Contributing Applications, Daemons, and Windows Services
    • Hours of Operation
    • Execution Design
    • Infrastructure and Network Design
    • Resilience, Fault Tolerance and High-Availability
@deardooley
deardooley / random_tree_gen.sh
Last active April 25, 2019 08:39
Shell script to generate a directory tree of randomized test data.
#!/usr/bin/env bash
# http://stackoverflow.com/questions/13400312/linux-create-random-directory-file-hierarchy
set -o errexit #abort if any command fails
usage() {
echo -n "$(basename $0) [OPTIONS]
This script creates a directory tree of random depth, width and file size. All parameters are