Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
export http_proxy=#{ENV['http_proxy']}
export https_proxy=#{ENV['https_proxy']}
export HTTP_PROXY=#{ENV['http_proxy']}
export HTTPS_PROXY=#{ENV['https_proxy']}
echo "export http_proxy=#{ENV['http_proxy']}" > /etc/profile.d/
echo "export https_proxy=#{ENV['https_proxy']}" >> /etc/profile.d/
echo "export HTTP_PROXY=#{ENV['http_proxy']}" >> /etc/profile.d/
echo "export HTTPS_PROXY=#{ENV['https_proxy']}" >> /etc/profile.d/
echo "export NO_PROXY='localhost,,'" >> /etc/profile.d/
echo "http_proxy=#{ENV['http_proxy']}" > /etc/environment
echo "https_proxy=#{ENV['https_proxy']}" >> /etc/environment
echo "HTTP_PROXY=#{ENV['http_proxy']}" > /etc/environment
echo "HTTPS_PROXY=#{ENV['https_proxy']}" > /etc/environment
echo "NO_PROXY='localhost,,'" >> /etc/environment
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 python-setuptools curl
easy_install pip
curl -sSL --proxy '#{ENV['http_proxy']}' | sh
systemctl enable docker
mkdir -p /etc/systemd/system/docker.service.d
touch /etc/systemd/system/docker.service.d/proxy.conf
echo '[Service]' > /etc/systemd/system/docker.service.d/proxy.conf
echo 'Environment=HTTP_PROXY=#{ENV['http_proxy']}' >> /etc/systemd/system/docker.service.d/proxy.conf
echo 'Environment=HTTPS_PROXY=#{ENV['https_proxy']}' >> /etc/systemd/system/docker.service.d/proxy.conf
systemctl daemon-reload
systemctl restart docker
pip install docker-compose
curl -O
tar -zxvf go1.6.linux-amd64.tar.gz
mv go /usr/local
ln -s /usr/local/go/bin/go /usr/bin/go
rm -rf go1.6.linux-amd64.tar.gz go
Vagrant.configure(2) do |config| = "ubuntu/wily64"
config.vm.hostname = "vagrant01" :private_network, ip: "" "forwarded_port", guest: 80, host: 8888, auto_correct: true "forwarded_port", guest: 5432, host: 5432, auto_correct: true "forwarded_port", guest: 5000, host: 5000, auto_correct: true "forwarded_port", guest: 5601, host: 5601, 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| = "vagrant01"
v.memory = 4096
v.cpus = 4
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
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