Skip to content

Instantly share code, notes, and snippets.

@jtallant
Last active August 29, 2015 14:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtallant/d0342b83cd09b095e49a to your computer and use it in GitHub Desktop.
Save jtallant/d0342b83cd09b095e49a to your computer and use it in GitHub Desktop.
vagrant-demo

Generate an SSH Key

You probably already have a public and private key. Check and make sure.

ls -a ~/.ssh | grep id

=> id_rsa
=> id_rsa.pub

If you don't see these keys listed, generate them.

ssh-keygen -t rsa -C "your@email.com"

Bash Detour

The next slide will make use of $EDITOR. It is a sort of "global" bash variable you can set to your favorite editor. Programs like Git make use of it when told to do so.

In .bash_profile

export EDITOR="subl -w"

Restart terminal

# Quick access to Bash Profile
alias bp="$EDITOR ~/.bash_profile"
# Quick access to homestead directory from terminal
alias homestead="cd /path/to/your/homestead/repo"
# Quick access to hosts file from terminal
alias hosts="$EDITOR /private/etc/hosts"
# Quick access to VM
alias vm="ssh vagrant@127.0.0.1 -p 2222"

Adding a Site

  1. Clone my vagrant-test repo git@github.com:surprisehighway/vagrant-test.git
  2. Edit Homestead.yaml
  3. Edit hosts file
  4. vagrant provision
  5. Hit the URL on port 8000 in your browser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment