Skip to content

Instantly share code, notes, and snippets.

View dustinmm80's full-sized avatar

Dustin Collins dustinmm80

  • Kansas City, MO
View GitHub Profile
@dustinmm80
dustinmm80 / conjurenv_chef.sh
Created April 20, 2015 20:20
An example of pulling secrets at Chef runtime with Conjur
# First, let's define some secrets we want to pass to Chef
cat << SECRETS > /etc/chef.secrets
DB_PASSWORD: !var db/postgres/customers/password # exports value as env var
SSL_CERT: !tmp certs/ssl/mydomain # creates temporary file and exports path as env var
SECRETS
# In our recipe we can use ENV['DB_PASSWORD'] and ENV['SSL_CERT'] where secrets are needed
# We have the Conjur CLI on the machine, so we can use conjur env
@dustinmm80
dustinmm80 / hostfactory_bootstrap.sh
Last active August 29, 2015 14:19
Bootstrapping a Conjur identity with host-factory
#!/bin/bash
# Creates a host identity using host-factory and places it in /etc/conjur.identity
# Requires the Conjur CLI and host-factory plugin to be installed
# Usage:
# ./hostfactory_bootstrap.sh 92198eb129peh812ue9puihd891 mynewhost1
hostfactory_token=$1
host_name=$2
@dustinmm80
dustinmm80 / saltstack_intro.md
Created December 16, 2014 22:21
SaltStack Tutorial - Boston DevOps Dec 17 2014
For the saltstack tutorial, just install the [latest vagrant](https://docs.vagrantup.com/v2/getting-started/index.html) and use the below Vagrantfile to build a new vagrant box:
`Vagrantfile`
```
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision "shell", inline: &lt;&lt;-SHELL
@dustinmm80
dustinmm80 / panel_outline_2_18.md
Last active August 29, 2015 13:56
Boston DevOps application configuration panel outline for 2/18

Outline

Application configuration

  • Do you use config files for your app, or do you have a distributed solution? (etcd, serf, etc)

    If config files:

    • How do you set them up to work in multiple environments?
  • How are they different for developer machines?

@dustinmm80
dustinmm80 / gitcheck.sh
Last active December 26, 2015 10:49
Run this in your git directory to make sure you're working off the latest code.
#! /bin/bash
# Checks that your Github repos are up to date
DIRS=()
sync=$1
for file in */ cookbooks/*; do
DIRS+=("`pwd`/${file}");
@dustinmm80
dustinmm80 / multivm_vagrant_dry.md
Created September 15, 2013 04:48
An example of how to write Vagrantfiles following the DRY principle.
=begin
Example box JSON schema
{
    :name => :name_of_vagrant_box, #REQUIRED
    :ip => '10.0.0.11', #REQUIRED
    :synced_folders => [
        { '.' => '/home/vagrant/myapp' }
    ],
    :commands => [
@dustinmm80
dustinmm80 / updaterepos.sh
Created August 22, 2013 02:38
Update all git repos in a directory, running git pull --rebase origin master on them all.
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "--- Pulling in latest changes for all repositories... ---"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@dustinmm80
dustinmm80 / python_tools_cheatsheet.md
Created August 16, 2013 01:49
Cheat sheet for Python workflow tools on OSX

Terminal Cheat Sheet


python package installer - look for packages on pypi

  • pip install package_name - installs package from pypi
  • pip install -r requirements file - installs packages from a requirements file
  • pip uninstall package_name - uninstalls package
  • pip freeze - output packages to stdout in requirements format, can be piped to a file
@dustinmm80
dustinmm80 / python_protips.md
Last active December 18, 2015 00:09
Things to watch out for when coding in Python

Python Protips

A collection of tips from things I've seen in a lot of code bases.

Use print() as a function and not a statement

print('some string') # good
print 'some string'  # bad

print() has been moved to a function in Python 3 docs.

@dustinmm80
dustinmm80 / gist:3928081
Created October 21, 2012 18:52
homebrew and pythonbrew setup
PATH="/usr/local/bin:$PATH"
[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc
export WORKON_HOME=~/envs
export PROJECT_HOME=~/git
source ~/.pythonbrew/pythons/Python-2.7.2/bin/virtualenvwrapper.sh
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'