Skip to content

Instantly share code, notes, and snippets.

Last active Apr 14, 2016
What would you like to do?
My Stack
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
echo "vm.swappiness=0" >> /etc/sysctl.conf
echo "kernel.randomize_va_space=1" >> /etc/sysctl.conf
echo "vm.dirty_ratio=3" >> /etc/sysctl.conf
echo "vm.dirty_background_ratio=2" >> /etc/sysctl.conf
echo "vm.overcommit_memory=1" >> /etc/sysctl.conf
echo "vm.mmap_min_addr=4096" >> /etc/sysctl.conf
echo "never" > /sys/kernel/mm/transparent_hugepage/defrag
echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
sysctl -p
echo '* hard nofile 999999' >> /etc/security/limits.conf
echo '* soft nofile 999999' >> /etc/security/limits.conf
echo 'nameserver' > /etc/resolvconf/resolv.conf.d/base
resolvconf -u
apt-get update -y
apt-get upgrade -y
apt-get install -y python-dev nginx git golang ruby-dev python-setuptools python-pip npm
ln -s /usr/bin/nodejs /usr/bin/node
npm install -g bower grunt_cli
curl -sSL | sh
systemctl enable docker
docker run -d --name elasticsearch elasticsearch
docker run -d --name redis -p redis
# docker run -d --name dockerui -p 9000:9000 --privileged -v /var/run/docker.sock:/var/run/docker.sock dockerui/dockerui
# docker run -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys:ro -v /var/lib/docker/:/var/lib/docker:ro -p 8000:8080 -d true --name cadvisor google/cadvisor:latest
gem install fpm --no-rdoc --no-ri
systemctl enable nginx
mkdir -p /opt/plural/conf
wget -O /opt/plural/conf/plural.yaml
chmod -f 0755 plural
Vagrant.configure(2) do |config| = "ubuntu/wily64"
config.vm.hostname = "#{ENV['USER']}" :private_network, ip: "" "forwarded_port", guest: 5000, host: 5000, auto_correct: true "forwarded_port", guest: 8000, host: 8000, auto_correct: true "forwarded_port", guest: 8080, host: 8080, auto_correct: true "forwarded_port", guest: 9000, host: 9000, auto_correct: true "forwarded_port", guest: 9200, host: 9200, auto_correct: true "forwarded_port", guest: 6379, host: 6379, auto_correct: true
vagrantdir = File.dirname(__FILE__)
stackdir = "#{ENV['HOME']}"
link = File.expand_path('.files', vagrantdir)
Dir.mkdir(stackdir, 0755) unless File.exists?(stackdir)
File.symlink(stackdir, link) unless File.symlink?(link)
config.vm.synced_folder ".files", "/vagrant"
config.vm.provider "virtualbox" do |v| = "#{ENV['USER']}"
v.memory = 4096
v.cpus = 4
config.vm.provision "shell", inline: $script, privileged: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment