Skip to content

Instantly share code, notes, and snippets.

View clcollins's full-sized avatar

Christopher Collins clcollins

View GitHub Profile
@clcollins
clcollins / keybase.md
Last active December 9, 2016 19:01
Keybase.io verification

Keybase proof

I hereby claim:

  • I am clcollins on github.
  • I am clcollins (https://keybase.io/clcollins) on keybase.
  • I have a public key whose fingerprint is 923E 0218 77DB 3F70 F614 6F62 F575 2BA1 4623 4FD4

To claim this, I am signing this object:

@clcollins
clcollins / self-signed_ssl_cert.md
Last active May 15, 2019 15:19
Generate an SSL Key, Certificate Request and Self-Signed Certificate

How to Generate an SSL Key, Certificate Request and Self-Signed Certificate

Replace <hostname> with your site's primary name.

Generate the key:

openssl genrsa -out <hostname>.key 2048

Generate the certificate request:

@clcollins
clcollins / http-master_npm-apache-crypt
Created November 6, 2014 15:56
NPM apache-crypt build fail
> apache-crypt@1.0.4 install /usr/local/lib/node_modules/http-master/node_modules/http-auth/node_modules/htpasswd/node_modules/apache-crypt
> node-gyp rebuild
child_process: customFds option is deprecated, use stdio instead.
make: Entering directory `/usr/local/lib/node_modules/http-master/node_modules/http-auth/node_modules/htpasswd/node_modules/apache-crypt/build'
CXX(target) Release/obj.target/crypt3/deps/crypt3.o
../deps/crypt3.cc: In function 'const char* GetApacheSalt()':
../deps/crypt3.cc:18:20: error: 'time' was not declared in this scope
srand(time(NULL));
^
@clcollins
clcollins / python_subprocess_hang
Last active August 29, 2015 14:10
Python Subprocess Hang
testCmd = "/sbin/iptables -n -L %s"
# <snip>
def checkChain():
cmd = testCmd % chain
check = subprocess.Popen(cmd,
shell=True,
@clcollins
clcollins / more-advanced-docker
Created December 8, 2014 17:59
Slightly More Advanced Docker
Other Stuff to Cover
====================
(Used in conjunction with [Linux@Duke Intro To Docker](https://github.com/LinuxAtDuke/Intro-To-Docker))
* Processes Inside/Outside
* Env Vars
* Naming
* Linking
* Logging
@clcollins
clcollins / docker-appstack-wordpress
Last active May 15, 2019 15:19
Docker Appstack WP Instance, via command line
#!/bin/bash
# Version 1.2 - 2015-01-07
# https://gist.github.com/clcollins/cfab1f63dc1aa927bf9f
# REQUIRES:
#
# Software -
# 1. Docker: https://docker.com
#
@clcollins
clcollins / wp-upgrade.sh
Last active May 15, 2019 15:18
WP-CLI Site Upgrade
#!/bin/bash
#
# TODO:
# How to handle NOT running the DB upgrade if it's not needed?
HOSTNAME="$(/bin/hostname)"
TMPDIR='/tmp'
MAILFROM="patch.adams@$HOSTNAME"
MAILTO="$@"
@clcollins
clcollins / run-docker-container.sh
Last active December 19, 2022 09:04
Bash script to easily setup and run Docker containers to test any given project
#!/bin/bash
# Set to true to just see what command
# would be run
DRY_RUN=false
TITLE='MY-TEST-CONTAINER'
IMAGE='MY-IMAGE'
# Local volume to be mapped into the container any time you run it
# usually with config files or whatnot
@clcollins
clcollins / throwaway_ssh_keypair.sh
Created March 14, 2016 15:54
Generate throwaway SSH key pairs for automated ... things.
#!/bin/bash
error () {
local msg="${1}"
echo "${msg}"
exit 1
}
make_tempdir () {
@clcollins
clcollins / automount-enable.sh
Created April 18, 2016 18:53
Systemd NFS Automount
#!/bin/sh
systemctl enable <path-to-mountpoint>.automount
systemctl start <path-to-mountpoint>.automount