Skip to content

Instantly share code, notes, and snippets.

View spuder's full-sized avatar

Spencer Owen spuder

View GitHub Profile
#!/bin/sh
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
#
# http://www.devthought.com/2009/09/19/get-ssh-copy-id-in-mac-os-x/
#
@kevinkarwaski
kevinkarwaski / multi_env_knife_config
Created February 18, 2012 19:06
Knife config for Multiple Chef Environments
#
# This is an example of a knife.rb configuration that uses yml and a
# simple env var (CHEF_ENV) to manage multiple hosted Chef environments.
#
# Example usage:
# export CHEF_ENV=evnironment_01
# knife status
#
# Based on: http://blog.blankpad.net/2010/09/28/multiple-knife-environments---the-return/
#
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@spuder
spuder / .bash_profile
Last active April 12, 2018 13:19
.bash_profile
# MANAGED VIA GIT https://gist.github.com/spuder/11360474
# CHANGES MAY BE OVERWRITTEN
# Import the bash_ps1, adds dotted lines after every command
if [ -f "$HOME/.bash_ps1" ]; then
. "$HOME/.bash_ps1"
fi
export CLICOLOR=1
@spuder
spuder / setup-spencers-bash.sh
Last active April 23, 2017 17:40
A script that pulls my bash profile from gists stored on github
#!/bin/bash
#Usage: Execute the following command:
<<COMMENT1
curl -L https://gist.github.com/spuder/11360474/raw/ | bash -x
COMMENT1
@spuder
spuder / Vagrantfile.txt
Last active August 29, 2015 14:03
Spencers standard go to vagrant file, includes 3 major releases
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.synced_folder "../", "/vagrant_data" # Mount directory up a level so puppet module list can find modules
config.vm.synced_folder ".", "/vagrant"
@spuder
spuder / build.sh
Last active August 29, 2015 14:03
Docker build script
#!/usr/bin/env bash
# A simple script to build a docker container
# Pre and Post functions are where you place any optional commands (eg. git clone)
# Sets name for docker container docker build -t 'foo/bar:latest
readonly DOCKER_USER='foo'
readonly DOCKER_NAME='bar'
readonly DOCKER_TAG='latest'
# Mac and boot2docker don't use root for docker command
@ryanycoleman
ryanycoleman / links
Last active March 28, 2018 17:44
links from 2014 puppetconf contributor summit lightning talks
@kwilczynski
kwilczynski / check.md
Last active July 6, 2023 08:35
Recipe / Role check in Chef

If you want to check whether a node run_list includes a specific role (upon expansion), then you could use role? method on the Node object:

node.role?('name')

Alternatively, you can see whether either would work for you:

node.roles.include?('name')

node.run_list?('role[name]')

@spuder
spuder / ubuntu-clean.sh
Created February 12, 2015 22:28
Clean Ubuntu machines for provisioning
# Remove items used for building, since they aren't needed anymore
#https://github.com/riywo/packer-example/blob/master/scripts/cleanup.sh
set -x
#Stop Logging
service rsyslog stop
# Clean Logging
logrotate –f /etc/logrotate.conf
rm –f /var/log/*-???????? /var/log/*.gz