start new:
tmux
start new with session name:
tmux new -s myname
| # | |
| # Need to move your initial ~/.chef to ~/.chef-ENV | |
| # | |
| alias prod="rm ~/.chef; ln -sf ~/.chef-prod ~/.chef; export CHEF_ENV=prod" | |
| alias dev="rm ~/.chef; ln -sf ~/.chef-dev ~/.chef; export CHEF_ENV=dev" | |
| function knife_env { | |
| if [ -e ~/.chef ] ; then | |
| echo $( cd -P ~/.chef ; echo ${PWD##*-} ) | |
| fi |
| % vagrant up --no-provision $VAGRANTBOX | |
| % vagrant ssh $VAGRANTBOX | |
| vagrant$ wget -O - http://opscode.com/chef/install.sh | sudo bash | |
| vagrant$ rm /tmp/chef*{rpm,deb} | |
| vagrant$ exit | |
| % vagrant package $VAGRANTBOX | |
| % rm -rf ~/.vagrant.d/boxes/$VAGRANTBOX | |
| % vagrant box add $VAGRANTBOX package.box |
| #!/bin/bash | |
| if [ "$#" -eq 0 ]; then | |
| echo "Usage: `basename $0` <cookbook directory>" | |
| elif [ "$#" -eq 1 ]; then | |
| find $1 -name "*[.md|.rb]" ! -name "*.git" ! -name "*.erb" | xargs perl -p -e 's!\[:([a-z0-9_]+)\]![\x27$1\x27]!gi' -i | |
| echo "Commit message:" | |
| echo "FC001: Use strings in preference to symbols to access node attributes" | |
| fi |
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.
# Ensure system is in ship-shape.
aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev
| ### Ensure variables are declared | |
| [[ -z "$RUBY_VERSION" ]] && printf ">>> RUBY_VERSION must be set.\n" && exit 10 | |
| [[ -z "$RUBY_HOME" ]] && printf ">>> RUBY_HOME must be set.\n" && exit 11 | |
| ### Install Packages | |
| set -x | |
| apt-get update |
| bash -c ' | |
| <% if knife_config[:bootstrap_proxy] -%> | |
| ( | |
| cat <<'EOP' | |
| <%= "proxy = #{knife_config[:bootstrap_proxy]}" %> | |
| EOP | |
| ) > ~/.curlrc | |
| <% end -%> | |
| if [ ! -f /usr/bin/chef-client ]; then |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant::Config.run do |config| | |
| # Every Vagrant virtual environment requires a box to build off of. | |
| config.vm.box = "precise64" | |
| # The url from where the 'config.vm.box' box will be fetched if it | |
| # doesn't already exist on the user's system. | |
| config.vm.box_url = "http://files.vagrantup.com/precise64.box" |