Skip to content

Instantly share code, notes, and snippets.

@bubba-h57
Last active October 11, 2017 15:45
Show Gist options
  • Save bubba-h57/772dcf865ebfe1f5cdf4 to your computer and use it in GitHub Desktop.
Save bubba-h57/772dcf865ebfe1f5cdf4 to your computer and use it in GitHub Desktop.

Revisions

  1. bubba-h57 revised this gist Feb 9, 2016. 4 changed files with 20 additions and 5 deletions.
    8 changes: 4 additions & 4 deletions after.sh
    Original file line number Diff line number Diff line change
    @@ -8,16 +8,16 @@
    ##
    # Handle some generic stuff
    ##
    source $HOMESTEAD_SCRIPTS/importEnvVars.sh
    source $HOMESTEAD_SCRIPTS/importEnvVars.sh
    source $HOMESTEAD_SCRIPTS/installAptPackages.sh
    source $HOMESTEAD_SCRIPTS/configureAWS.sh
    source $HOMESTEAD_SCRIPTS/configureSSH.sh
    source $HOMESTEAD_SCRIPTS/configureComposer.sh
    source $HOMESTEAD_SCRIPTS/configureGit.sh
    source $HOMESTEAD_SCRIPTS/configureComposer.sh
    source $HOMESTEAD_SCRIPTS/configureZSH.sh


    ##
    # Customize some stuff
    ##
    echo "source $STS_HOME/etc/zsh/.zshrc" >> /home/vagrant/.zshrc
    ##
    echo "source $STS_HOME/etc/zsh/.zshrc" >> /home/vagrant/.zshrc
    3 changes: 3 additions & 0 deletions configureGit.sh
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,7 @@ cat <<EOT > /home/vagrant/.gitconfig
    lol = log --graph --decorate --pretty=oneline --abbrev-commit --all
    [credential]
    helper = cache
    username = $GIT_HUB_USER_NAME
    [push]
    default = simple
    EOT
    @@ -23,3 +24,5 @@ FullAccess - $GIT_HUB_TOKEN
    EOT
    updateAuth /home/vagrant/.gitconfig 0600
    updateAuth /home/vagrant/.gittokens 0600
    git config user.name "Bubba"
    git config user.email "[email protected]"
    12 changes: 12 additions & 0 deletions configureSSH.sh
    Original file line number Diff line number Diff line change
    @@ -9,3 +9,15 @@ cp $MY_ID_RSA /home/vagrant/.ssh/id_rsa
    cp $MY_ID_RSA_PUB /home/vagrant/.ssh/id_rsa.pub
    updateAuth /home/vagrant/.ssh/id_rsa 0600
    updateAuth /home/vagrant/.ssh/id_rsa.pub

    cat <<EOT > /home/vagrant/.ssh/config
    Host github.com
    StrictHostKeyChecking no
    User git
    IdentityFile /home/vagrant/.ssh/id_rsa
    Host gist.github.com
    StrictHostKeyChecking no
    User git
    IdentityFile /home/vagrant/.ssh/id_rsa
    EOT
    updateAuth /home/vagrant/.ssh/config
    2 changes: 1 addition & 1 deletion installAptPackages.sh
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,4 @@

    # I like to update apt-get and I know I want imagemagick installed, so lets get that out of the way
    apt-get update
    apt-get install -y imagemagick --fix-missing
    apt-get install -y imagemagick expect --fix-missing
  2. bubba-h57 revised this gist Feb 9, 2016. 7 changed files with 12 additions and 12 deletions.
    4 changes: 2 additions & 2 deletions configureAWS.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/bin/bash
    source $HOMESTEAD_SCRIPTS/helperFunctions.sh
    ###############################################################################
    #
    #
    # Setup AWS
    #
    ###############################################################################
    @@ -20,4 +20,4 @@ region=$AWS_DEFAULT_REGION
    EOT
    updateAuth /home/vagrant/.aws 0755
    updateAuth /home/vagrant/.aws/config 0600
    updateAuth /home/vagrant/.aws/credentials 0600
    updateAuth /home/vagrant/.aws/credentials 0600
    4 changes: 2 additions & 2 deletions configureComposer.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/bin/bash
    source $HOMESTEAD_SCRIPTS/helperFunctions.sh
    ###############################################################################
    #
    #
    # Setup Composer
    #
    ###############################################################################
    @@ -13,4 +13,4 @@ cat <<EOT > /home/vagrant/.composer/auth.json
    }
    }
    EOT
    updateAuth /home/vagrant/.composer/auth.json 0600
    updateAuth /home/vagrant/.composer/auth.json 0600
    4 changes: 2 additions & 2 deletions configureGit.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/bin/bash
    source $HOMESTEAD_SCRIPTS/helperFunctions.sh
    ###############################################################################
    #
    #
    # Setup git
    #
    ###############################################################################
    @@ -22,4 +22,4 @@ cat <<EOT > /home/vagrant/.gittokens
    FullAccess - $GIT_HUB_TOKEN
    EOT
    updateAuth /home/vagrant/.gitconfig 0600
    updateAuth /home/vagrant/.gittokens 0600
    updateAuth /home/vagrant/.gittokens 0600
    4 changes: 2 additions & 2 deletions configureZSH.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/bin/bash
    source $HOMESTEAD_SCRIPTS/helperFunctions.sh
    ###############################################################################
    #
    #
    # Setup ZSH
    #
    ###############################################################################
    @@ -26,4 +26,4 @@ fi
    EOT
    grep export /home/vagrant/.profile | while read line; do echo "$line" >> /home/vagrant/.zshrc; done
    updateAuth /home/vagrant/.zshrc
    chsh -s /usr/bin/zsh vagrant
    chsh -s /usr/bin/zsh vagrant
    4 changes: 2 additions & 2 deletions helperFunctions.sh
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ if [ "$HELPERS_LOADED" = true ] ; then
    fi

    # Helper function for ensuring permissions are correct
    updateAuth () {
    updateAuth () {
    if [ -z "$1" ]
    then
    return 0
    @@ -25,4 +25,4 @@ updateAuth () {
    chmod -R $THISPERM $THISPATH
    }

    HELPERS_LOADED=true
    HELPERS_LOADED=true
    2 changes: 1 addition & 1 deletion importEnvVars.sh
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,4 @@ grep export /home/vagrant/.profile |while read -r line; do
    echo "$line" >> $ENVARS
    done

    source $ENVARS
    source $ENVARS
    2 changes: 1 addition & 1 deletion installAptPackages.sh
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,4 @@

    # I like to update apt-get and I know I want imagemagick installed, so lets get that out of the way
    apt-get update
    apt-get install -y imagemagick --fix-missing
    apt-get install -y imagemagick --fix-missing
  3. bubba-h57 revised this gist Feb 9, 2016. 2 changed files with 5 additions and 6 deletions.
    3 changes: 1 addition & 2 deletions after.sh
    Original file line number Diff line number Diff line change
    @@ -20,5 +20,4 @@ source $HOMESTEAD_SCRIPTS/configureZSH.sh
    ##
    # Customize some stuff
    ##
    echo "source $STS_HOME/etc/zsh/.zshrc" >> /home/vagrant/.zshrc

    echo "source $STS_HOME/etc/zsh/.zshrc" >> /home/vagrant/.zshrc
    8 changes: 4 additions & 4 deletions configureSSH.sh
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,11 @@
    #!/bin/bash
    source $HOMESTEAD_SCRIPTS/helperFunctions.sh
    ###############################################################################
    #
    #
    # Setup SSH
    #
    ###############################################################################
    cp MY_ID_RSA /home/vagrant/.ssh/id_rsa
    cp MY_ID_RSA_PUB /home/vagrant/.ssh/id_rsa.pub
    cp $MY_ID_RSA /home/vagrant/.ssh/id_rsa
    cp $MY_ID_RSA_PUB /home/vagrant/.ssh/id_rsa.pub
    updateAuth /home/vagrant/.ssh/id_rsa 0600
    updateAuth /home/vagrant/.ssh/id_rsa.pub
    updateAuth /home/vagrant/.ssh/id_rsa.pub
  4. bubba-h57 revised this gist Feb 5, 2016. 6 changed files with 13 additions and 12 deletions.
    15 changes: 8 additions & 7 deletions after.sh
    Original file line number Diff line number Diff line change
    @@ -4,16 +4,17 @@
    # add any commands you wish to this file and they will
    # be run after the Homestead machine is provisioned.


    ##
    # Handle some generic stuff
    ##
    source ./importEnvVars.sh
    source ./installAptPackages.sh
    source ./configureAWS.sh
    source ./configureSSH.sh
    source ./configureComposer.sh
    source ./configureGit.sh
    source ./configureZSH.sh
    source $HOMESTEAD_SCRIPTS/importEnvVars.sh
    source $HOMESTEAD_SCRIPTS/installAptPackages.sh
    source $HOMESTEAD_SCRIPTS/configureAWS.sh
    source $HOMESTEAD_SCRIPTS/configureSSH.sh
    source $HOMESTEAD_SCRIPTS/configureComposer.sh
    source $HOMESTEAD_SCRIPTS/configureGit.sh
    source $HOMESTEAD_SCRIPTS/configureZSH.sh


    ##
    2 changes: 1 addition & 1 deletion configureAWS.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    source ./helperFunctions.sh
    source $HOMESTEAD_SCRIPTS/helperFunctions.sh
    ###############################################################################
    #
    # Setup AWS
    2 changes: 1 addition & 1 deletion configureComposer.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    source ./helperFunctions.sh
    source $HOMESTEAD_SCRIPTS/helperFunctions.sh
    ###############################################################################
    #
    # Setup Composer
    2 changes: 1 addition & 1 deletion configureGit.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    source ./helperFunctions.sh
    source $HOMESTEAD_SCRIPTS/helperFunctions.sh
    ###############################################################################
    #
    # Setup git
    2 changes: 1 addition & 1 deletion configureSSH.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    source ./helperFunctions.sh
    source $HOMESTEAD_SCRIPTS/helperFunctions.sh
    ###############################################################################
    #
    # Setup SSH
    2 changes: 1 addition & 1 deletion configureZSH.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    source ./helperFunctions.sh
    source $HOMESTEAD_SCRIPTS/helperFunctions.sh
    ###############################################################################
    #
    # Setup ZSH
  5. bubba-h57 revised this gist Feb 5, 2016. 9 changed files with 165 additions and 136 deletions.
    151 changes: 15 additions & 136 deletions after.sh
    Original file line number Diff line number Diff line change
    @@ -4,141 +4,20 @@
    # add any commands you wish to this file and they will
    # be run after the Homestead machine is provisioned.

    # Lets be clever and pull the environment variables stored in our Homestead.yaml
    # Those are written to /home/vagrant/.profile, so we can can just parse them
    # From there and ensure we have them available as root for provosioning.

    ENVARS="$(mktemp)"

    grep export /home/vagrant/.profile |while read -r line; do
    echo "$line" >> $ENVARS
    done

    source $ENVARS

    # I like to update apt-get and I know I want imagemagick installed, so lets get that out of the way
    apt-get update
    apt-get install -y imagemagick --fix-missing

    # Helper function for ensuring permissions are correct
    updateAuth () {
    if [ -z "$1" ]
    then
    return 0
    else
    THISPATH="$1"
    fi

    if [ -z "$2" ]
    then
    THISPERM="0644"
    else
    THISPERM="$2"
    fi

    chown -R vagrant:vagrant $THISPATH
    chmod -R $THISPERM $THISPATH
    }

    ###############################################################################
    #
    # Setup AWS
    #
    ###############################################################################
    mkdir -p /home/vagrant/.aws
    cat <<EOT > /home/vagrant/.aws/config
    [default]
    aws_access_key_id=$AWS_ACCESS_KEY_ID
    aws_secret_access_key=$AWS_SECRET_ACCESS_KEY
    region=$AWS_DEFAULT_REGION
    EOT
    cat <<EOT > /home/vagrant/.aws/credentials
    [Credentials]
    aws_access_key_id=$AWS_ACCESS_KEY_ID
    aws_secret_access_key=$AWS_SECRET_ACCESS_KEY
    region=$AWS_DEFAULT_REGION
    EOT
    updateAuth /home/vagrant/.aws 0755
    updateAuth /home/vagrant/.aws/config 0600
    updateAuth /home/vagrant/.aws/credentials 0600

    ###############################################################################
    #
    # Setup SSH
    #
    ###############################################################################
    cp MY_ID_RSA /home/vagrant/.ssh/id_rsa
    cp MY_ID_RSA_PUB /home/vagrant/.ssh/id_rsa.pub
    updateAuth /home/vagrant/.ssh/id_rsa 0600
    updateAuth /home/vagrant/.ssh/id_rsa.pub

    ###############################################################################
    #
    # Setup Composer
    #
    ###############################################################################
    cat <<EOT > /home/vagrant/.composer/auth.json
    {
    "http-basic": {},
    "github-oauth": {
    "github.com": "$GIT_HUB_TOKEN"
    }
    }
    EOT
    updateAuth /home/vagrant/.composer/auth.json 0600


    ###############################################################################
    #
    # Setup git
    #
    ###############################################################################
    cat <<EOT > /home/vagrant/.gitconfig
    [user]
    name = $GIT_AUTHOR_NAME
    email = $GIT_AUTHOR_EMAIL
    [core]
    editor = vi
    [alias]
    lol = log --graph --decorate --pretty=oneline --abbrev-commit --all
    [credential]
    helper = cache
    [push]
    default = simple
    EOT
    cat <<EOT > /home/vagrant/.gittokens
    FullAccess - $GIT_HUB_TOKEN
    EOT
    updateAuth /home/vagrant/.gitconfig 0600
    updateAuth /home/vagrant/.gittokens 0600


    ###############################################################################
    #
    # Setup ZSH
    #
    ###############################################################################
    apt-get install zsh -y
    # If it doesn't exist, lets clone it
    export ZSH=/home/vagrant/.oh-my-zsh
    if [ ! -d "$ZSH" ]; then
    git clone git://github.com/robbyrussell/oh-my-zsh.git $ZSH
    fi
    chown -R vagrant:vagrant $ZSH

    cat <<EOT > /home/vagrant/.zshrc
    #!/usr/bin/zsh
    # Path to our oh-my-zsh installation.
    export ZSH=/home/vagrant/.oh-my-zsh
    # If it doesn't exist, lets clone it
    if [ ! -d "\$ZSH" ]; then
    git clone git://github.com/robbyrussell/oh-my-zsh.git \$ZSH
    fi
    EOT
    grep export /home/vagrant/.profile | while read line; do echo "$line" >> /home/vagrant/.zshrc; done
    ##
    # Handle some generic stuff
    ##
    source ./importEnvVars.sh
    source ./installAptPackages.sh
    source ./configureAWS.sh
    source ./configureSSH.sh
    source ./configureComposer.sh
    source ./configureGit.sh
    source ./configureZSH.sh


    ##
    # Customize some stuff
    ##
    echo "source $STS_HOME/etc/zsh/.zshrc" >> /home/vagrant/.zshrc

    updateAuth /home/vagrant/.zshrc
    chsh -s /usr/bin/zsh vagrant
    23 changes: 23 additions & 0 deletions configureAWS.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #!/bin/bash
    source ./helperFunctions.sh
    ###############################################################################
    #
    # Setup AWS
    #
    ###############################################################################
    mkdir -p /home/vagrant/.aws
    cat <<EOT > /home/vagrant/.aws/config
    [default]
    aws_access_key_id=$AWS_ACCESS_KEY_ID
    aws_secret_access_key=$AWS_SECRET_ACCESS_KEY
    region=$AWS_DEFAULT_REGION
    EOT
    cat <<EOT > /home/vagrant/.aws/credentials
    [Credentials]
    aws_access_key_id=$AWS_ACCESS_KEY_ID
    aws_secret_access_key=$AWS_SECRET_ACCESS_KEY
    region=$AWS_DEFAULT_REGION
    EOT
    updateAuth /home/vagrant/.aws 0755
    updateAuth /home/vagrant/.aws/config 0600
    updateAuth /home/vagrant/.aws/credentials 0600
    16 changes: 16 additions & 0 deletions configureComposer.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #!/bin/bash
    source ./helperFunctions.sh
    ###############################################################################
    #
    # Setup Composer
    #
    ###############################################################################
    cat <<EOT > /home/vagrant/.composer/auth.json
    {
    "http-basic": {},
    "github-oauth": {
    "github.com": "$GIT_HUB_TOKEN"
    }
    }
    EOT
    updateAuth /home/vagrant/.composer/auth.json 0600
    25 changes: 25 additions & 0 deletions configureGit.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    #!/bin/bash
    source ./helperFunctions.sh
    ###############################################################################
    #
    # Setup git
    #
    ###############################################################################
    cat <<EOT > /home/vagrant/.gitconfig
    [user]
    name = $GIT_AUTHOR_NAME
    email = $GIT_AUTHOR_EMAIL
    [core]
    editor = vi
    [alias]
    lol = log --graph --decorate --pretty=oneline --abbrev-commit --all
    [credential]
    helper = cache
    [push]
    default = simple
    EOT
    cat <<EOT > /home/vagrant/.gittokens
    FullAccess - $GIT_HUB_TOKEN
    EOT
    updateAuth /home/vagrant/.gitconfig 0600
    updateAuth /home/vagrant/.gittokens 0600
    11 changes: 11 additions & 0 deletions configureSSH.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #!/bin/bash
    source ./helperFunctions.sh
    ###############################################################################
    #
    # Setup SSH
    #
    ###############################################################################
    cp MY_ID_RSA /home/vagrant/.ssh/id_rsa
    cp MY_ID_RSA_PUB /home/vagrant/.ssh/id_rsa.pub
    updateAuth /home/vagrant/.ssh/id_rsa 0600
    updateAuth /home/vagrant/.ssh/id_rsa.pub
    29 changes: 29 additions & 0 deletions configureZSH.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    #!/bin/bash
    source ./helperFunctions.sh
    ###############################################################################
    #
    # Setup ZSH
    #
    ###############################################################################
    apt-get install zsh -y
    # If it doesn't exist, lets clone it
    export ZSH=/home/vagrant/.oh-my-zsh
    if [ ! -d "$ZSH" ]; then
    git clone git://github.com/robbyrussell/oh-my-zsh.git $ZSH
    fi
    chown -R vagrant:vagrant $ZSH

    cat <<EOT > /home/vagrant/.zshrc
    #!/usr/bin/zsh
    # Path to our oh-my-zsh installation.
    export ZSH=/home/vagrant/.oh-my-zsh
    # If it doesn't exist, lets clone it
    if [ ! -d "\$ZSH" ]; then
    git clone git://github.com/robbyrussell/oh-my-zsh.git \$ZSH
    fi
    EOT
    grep export /home/vagrant/.profile | while read line; do echo "$line" >> /home/vagrant/.zshrc; done
    updateAuth /home/vagrant/.zshrc
    chsh -s /usr/bin/zsh vagrant
    28 changes: 28 additions & 0 deletions helperFunctions.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    #!/bin/bash

    if [ "$HELPERS_LOADED" = true ] ; then
    #we have already been loaded.
    return;
    fi

    # Helper function for ensuring permissions are correct
    updateAuth () {
    if [ -z "$1" ]
    then
    return 0
    else
    THISPATH="$1"
    fi

    if [ -z "$2" ]
    then
    THISPERM="0644"
    else
    THISPERM="$2"
    fi

    chown -R vagrant:vagrant $THISPATH
    chmod -R $THISPERM $THISPATH
    }

    HELPERS_LOADED=true
    13 changes: 13 additions & 0 deletions importEnvVars.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #!/bin/bash

    # Lets be clever and pull the environment variables stored in our Homestead.yaml
    # Those are written to /home/vagrant/.profile, so we can can just parse them
    # From there and ensure we have them available as root for provosioning.

    ENVARS="$(mktemp)"

    grep export /home/vagrant/.profile |while read -r line; do
    echo "$line" >> $ENVARS
    done

    source $ENVARS
    5 changes: 5 additions & 0 deletions installAptPackages.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    #!/bin/bash

    # I like to update apt-get and I know I want imagemagick installed, so lets get that out of the way
    apt-get update
    apt-get install -y imagemagick --fix-missing
  6. bubba-h57 renamed this gist Feb 5, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. bubba-h57 revised this gist Feb 2, 2016. 1 changed file with 25 additions and 0 deletions.
    25 changes: 25 additions & 0 deletions Homestead.yaml insert
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    variables:
    - key: STS_USER
    value: "<your name>"
    - key: STS_HOME
    value: "<your customized home dir>"
    - key: AWS_ACCESS_KEY_ID
    value: "<your key>"
    - key: AWS_SECRET_ACCESS_KEY
    value: "<your secret>"
    - key: AWS_DEFAULT_REGION
    value: "<your region>"
    - key: GIT_AUTHOR_NAME
    value: "<your name>"
    - key: GIT_AUTHOR_EMAIL
    value: "<your email>"
    - key: GIT_COMMITTER_NAME
    value: "<your name>"
    - key: GIT_COMMITTER_EMAIL
    value: "<your email>"
    - key: GIT_HUB_TOKEN
    value: "<your github token>"
    - key: MY_ID_RSA
    value: "<your path to the desired RSA key>"
    - key: MY_ID_RSA_PUB
    value: "<your path to the desired RSA pub file>"
  8. bubba-h57 created this gist Feb 2, 2016.
    144 changes: 144 additions & 0 deletions after.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,144 @@
    #!/bin/bash

    # If you would like to do some extra provisioning you may
    # add any commands you wish to this file and they will
    # be run after the Homestead machine is provisioned.

    # Lets be clever and pull the environment variables stored in our Homestead.yaml
    # Those are written to /home/vagrant/.profile, so we can can just parse them
    # From there and ensure we have them available as root for provosioning.

    ENVARS="$(mktemp)"

    grep export /home/vagrant/.profile |while read -r line; do
    echo "$line" >> $ENVARS
    done

    source $ENVARS

    # I like to update apt-get and I know I want imagemagick installed, so lets get that out of the way
    apt-get update
    apt-get install -y imagemagick --fix-missing

    # Helper function for ensuring permissions are correct
    updateAuth () {
    if [ -z "$1" ]
    then
    return 0
    else
    THISPATH="$1"
    fi

    if [ -z "$2" ]
    then
    THISPERM="0644"
    else
    THISPERM="$2"
    fi

    chown -R vagrant:vagrant $THISPATH
    chmod -R $THISPERM $THISPATH
    }

    ###############################################################################
    #
    # Setup AWS
    #
    ###############################################################################
    mkdir -p /home/vagrant/.aws
    cat <<EOT > /home/vagrant/.aws/config
    [default]
    aws_access_key_id=$AWS_ACCESS_KEY_ID
    aws_secret_access_key=$AWS_SECRET_ACCESS_KEY
    region=$AWS_DEFAULT_REGION
    EOT
    cat <<EOT > /home/vagrant/.aws/credentials
    [Credentials]
    aws_access_key_id=$AWS_ACCESS_KEY_ID
    aws_secret_access_key=$AWS_SECRET_ACCESS_KEY
    region=$AWS_DEFAULT_REGION
    EOT
    updateAuth /home/vagrant/.aws 0755
    updateAuth /home/vagrant/.aws/config 0600
    updateAuth /home/vagrant/.aws/credentials 0600

    ###############################################################################
    #
    # Setup SSH
    #
    ###############################################################################
    cp MY_ID_RSA /home/vagrant/.ssh/id_rsa
    cp MY_ID_RSA_PUB /home/vagrant/.ssh/id_rsa.pub
    updateAuth /home/vagrant/.ssh/id_rsa 0600
    updateAuth /home/vagrant/.ssh/id_rsa.pub

    ###############################################################################
    #
    # Setup Composer
    #
    ###############################################################################
    cat <<EOT > /home/vagrant/.composer/auth.json
    {
    "http-basic": {},
    "github-oauth": {
    "github.com": "$GIT_HUB_TOKEN"
    }
    }
    EOT
    updateAuth /home/vagrant/.composer/auth.json 0600


    ###############################################################################
    #
    # Setup git
    #
    ###############################################################################
    cat <<EOT > /home/vagrant/.gitconfig
    [user]
    name = $GIT_AUTHOR_NAME
    email = $GIT_AUTHOR_EMAIL
    [core]
    editor = vi
    [alias]
    lol = log --graph --decorate --pretty=oneline --abbrev-commit --all
    [credential]
    helper = cache
    [push]
    default = simple
    EOT
    cat <<EOT > /home/vagrant/.gittokens
    FullAccess - $GIT_HUB_TOKEN
    EOT
    updateAuth /home/vagrant/.gitconfig 0600
    updateAuth /home/vagrant/.gittokens 0600


    ###############################################################################
    #
    # Setup ZSH
    #
    ###############################################################################
    apt-get install zsh -y
    # If it doesn't exist, lets clone it
    export ZSH=/home/vagrant/.oh-my-zsh
    if [ ! -d "$ZSH" ]; then
    git clone git://github.com/robbyrussell/oh-my-zsh.git $ZSH
    fi
    chown -R vagrant:vagrant $ZSH

    cat <<EOT > /home/vagrant/.zshrc
    #!/usr/bin/zsh
    # Path to our oh-my-zsh installation.
    export ZSH=/home/vagrant/.oh-my-zsh
    # If it doesn't exist, lets clone it
    if [ ! -d "\$ZSH" ]; then
    git clone git://github.com/robbyrussell/oh-my-zsh.git \$ZSH
    fi
    EOT
    grep export /home/vagrant/.profile | while read line; do echo "$line" >> /home/vagrant/.zshrc; done
    echo "source $STS_HOME/etc/zsh/.zshrc" >> /home/vagrant/.zshrc

    updateAuth /home/vagrant/.zshrc
    chsh -s /usr/bin/zsh vagrant