Skip to content

Instantly share code, notes, and snippets.

server {
listen 8443 default ssl;
server_name www.yourdomain.com;
ssl on;
ssl_certificate /etc/nginx/conf.d/cert.pem;
ssl_certificate_key /etc/nginx/conf.d/cert.key;
client_max_body_size 50M;
error_log /var/log/nginx/elasticsearch-errors.log;
---
# file ruby.yml
- hosts: all
gather_facts: false
sudo: true
vars:
# Where to install rbenv
- rbenv_root: /usr/local/rbenv
# The version of Ruby to install
{
"variables":{
"home": "{{env `HOME`}}",
"iso": "{{ user `home` }}/Downloads/CentOS-6.3-x86_64-bin-DVD1.iso"
}
...
@stevepereira
stevepereira / gist:9466606
Created March 10, 2014 15:00
Redis install via rpm - you can pull the version out as a variable if it's stated in the role yaml
cache = Chef::Config[:file_cache_path]
rpm = redis-2.8.7-1.el6.remi.x86_64.rpm
remote_file "#{cache}/#{rpm}" do
source "http://rpms.famillecollet.com/enterprise/6/remi/x86_64/#{rpm}"
end
rname = File.basename("#{rpm}", '.*')
if `rpm -qa | grep #{rname}`.empty?
@stevepereira
stevepereira / pre-commit
Created March 25, 2014 17:29
Ansible vault pre-commit
#!/bin/sh
#
# Pre-commit hook that verifies if all files containing 'vault' in the name
# are encrypted.
# If not, commit will fail with an error message
#
# File should be .git/hooks/pre-commit and executable
FILES_PATTERN='.*vault.*\.yml$'
REQUIRED='ANSIBLE_VAULT'
---
# This has been tested with ansible 1.3 with these commands:
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts"
# NB: The type of the variable is crucial!
- name: Ansible Conditionals Examples
hosts: $hosts
vars_files:
<a href="https://www.linkedin.com/shareArticle?mini=true&url=http://hitch.waveapps.com&title=Hitch%20by%20Wave&summary=Find%20your%20match%20with%20Wave's%20new%20online%20dating%20service!&source=">Share on LinkedIn</a>
echo "+------------------------------+"
echo "| Running VMTools Install |"
echo "+------------------------------+"
#!/usr/bin/env bash
mkdir /mnt/cdrom
# Check which Packer builder type is being used
if [ $PACKER_BUILDER_TYPE = "virtualbox-iso" ]; then
# Required for the VirtualBox Guest Additions for Linux
#TODO: replace with: tar xvz < <(curl -L https://github.com/stevepereira/macbook-ansible/archive/master.tar.gz) && ansible-playbook macbook-ansible-master/install.yml -K
#https://github.com/revans/bash-it
#https://github.com/mathiasbynens/dotfiles
# nopasswd sudo: add 'stevepereira ALL=(ALL) NOPASSWD: ALL' to /etc/sudoers
# disable smart quotes and smart dashes
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# textEdit

CASE #1 - Changing which revision of a dependency a feature branch depends on

Current process:

cd parent-repo
git checkout master
git pull --rebase
git checkout -b feature_branch
cd gem