Skip to content

Instantly share code, notes, and snippets.

@chrisdc
Created March 1, 2016 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisdc/30660cdaeff9b6711181 to your computer and use it in GitHub Desktop.
Save chrisdc/30660cdaeff9b6711181 to your computer and use it in GitHub Desktop.
Vagrant Setup
#!/usr/bin/env bash
apt-get update
apt-get install -y git build-essential libssl-dev libgtk2.0-0 libgconf-2-4 \
libasound2 libxtst6 libxss1 libnss3 xvfb
#if ! [ -L /var/www ]; then
# rm -rf /var/www
# ln -fs /vagrant /var/www
#fi
#!/usr/bin/env bash
echo "alias work='cd /vagrant'" >> /home/vagrant/.bashrc
echo "export DISPLAY=:9.0" >> /home/vagrant/.bashrc
wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | bash
# This enables NVM without a logout/login
export NVM_DIR="/home/vagrant/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
#Xvfb -ac -screen scrn 1280x2000x24 :9.0 &
#export DISPLAY=:9.0
# Install a node and alias
nvm install 5.4.1
nvm alias default 5.4.1
npm install -g express-generator
npm install -g nodemon
npm install -g gulp
npm install -g mocha
npm install -g bower
npm install -g pm2
#!/usr/bin/env bash
# Start Xvfb
Xvfb -ac -screen scrn 1280x2000x24 :9.0 &
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# config.vm.network :forwarded_port, guest: 80, host: 3000
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
config.vm.provider "virtualbox" do |vb|
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant","1"]
end
config.vm.provision :shell, path: "provision-root.sh", privileged: true
config.vm.provision :shell, path: "provision.sh", privileged: false
config.vm.provision :shell, path: "startup.sh", run: "always", privileged: false
config.vm.synced_folder "www/", "/var/www/", :owner => "www-data", :mount_options => [ "dmode=775", "fmode=774" ]
config.vm.synced_folder "log/", "/var/log", :owner => "www-data"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment