Last active
August 24, 2017 14:33
-
-
Save thanhson1085/ec96821119be4c17f860 to your computer and use it in GitHub Desktop.
Vagrantfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provision "file", source: "~/.ssh/id_rsa", destination: "~/.ssh/id_rsa" | |
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/id_rsa.pub" | |
config.vm.provision "shell", inline: <<-SHELL | |
echo Install DEV Enviroment ... | |
apt-get update && \ | |
apt-get install -y git unzip wget curl | |
git clone https://github.com/VundleVim/Vundle.vim.git /home/vagrant/.vim/bundle/Vundle.vim && \ | |
cd /tmp && git clone https://github.com/thanhson1085/sonnix.git && cd sonnix && \ | |
cat bashrc >> /home/vagrant/.bashrc && cat vimrc > /home/vagrant/.vimrc && \ | |
cat tmux.conf > /home/vagrant/.tmux.conf && \ | |
chown -R vagrant:vagrant /home/vagrant/.vim && \ | |
chown -R vagrant:vagrant /home/vagrant/.ssh && \ | |
chown -R vagrant:vagrant /home/vagrant/.tmux.conf && \ | |
chown -R vagrant:vagrant /home/vagrant/.vimrc && \ | |
chown -R vagrant:vagrant /home/vagrant/.bashrc && \ | |
chmod 400 /home/vagrant/.ssh/id_rsa && \ | |
cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys | |
echo Git User Information | |
git config --global user.email "thanhson1085@gmail.com" | |
git config --global user.name "Nguyen Sy Thanh Son" | |
SHELL | |
config.vm.synced_folder ".", "/vagrant", disabled: true | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = false | |
vb.memory = 8192 | |
vb.cpus = 4 | |
end | |
config.vm.define "dev" do |n1| | |
n1.vm.hostname = "dev" | |
# port user service | |
n1.vm.network "forwarded_port", guest: 3000, host: 3000 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provision "file", source: "~/.ssh/id_rsa", destination: "~/.ssh/id_rsa" | |
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/id_rsa.pub" | |
config.vm.provision "shell", inline: <<-SHELL | |
echo Install DEV Enviroment ... | |
apt-get update && \ | |
apt-get install -y git unzip wget curl | |
git clone https://github.com/VundleVim/Vundle.vim.git /home/vagrant/.vim/bundle/Vundle.vim && \ | |
cd /tmp && git clone https://github.com/thanhson1085/sonnix.git && cd sonnix && \ | |
cat bashrc >> /home/vagrant/.bashrc && cat vimrc > /home/vagrant/.vimrc && \ | |
cat tmux.conf > /home/vagrant/.tmux.conf && \ | |
chown -R vagrant:vagrant /home/vagrant/.vim && \ | |
chown -R vagrant:vagrant /home/vagrant/.ssh && \ | |
chown -R vagrant:vagrant /home/vagrant/.tmux.conf && \ | |
chown -R vagrant:vagrant /home/vagrant/.vimrc && \ | |
chown -R vagrant:vagrant /home/vagrant/.bashrc && \ | |
chmod 400 /home/vagrant/.ssh/id_rsa && \ | |
cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys | |
echo Git User Information ... | |
git config --global user.email "thanhson1085@gmail.com" | |
git config --global user.name "Nguyen Sy Thanh Son" | |
apt-get update -y; apt-get dist-upgrade -y | |
apt-get install -y software-properties-common | |
add-apt-repository -y ppa:ethereum/ethereum; apt-get update -y | |
apt-get install -y geth solc | |
SHELL | |
config.vm.synced_folder ".", "/vagrant", disabled: true | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = false | |
vb.memory = 8192 | |
vb.cpus = 4 | |
end | |
config.vm.define "dev" do |n1| | |
n1.vm.hostname = "dev" | |
# port user service | |
n1.vm.network "forwarded_port", guest: 3000, host: 3000 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "public_network", ip: "192.168.1.193", :bridge => "Realtek PCIe GBE Family Controller" | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = false | |
vb.memory = 2048 | |
vb.cpus = 2 | |
end | |
config.vm.provision "shell", inline: <<-SHELL | |
sudo apt-get update | |
sudo apt-get install -y whois git | |
sudo useradd -m -p `mkpasswd password` -s /bin/bash thanhson1085 | |
sudo usermod -a -G sudo thanhson1085 | |
SHELL | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "private_network", ip: "172.20.20.20" | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = false | |
vb.memory = 2048 | |
vb.cpus = 2 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "private_network", ip: "172.20.20.20" | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = false | |
vb.memory = 2048 | |
vb.cpus = 2 | |
end | |
config.vm.provision "shell", inline: <<-SHELL | |
sudo apt-get update | |
sudo apt-get install -y whois git | |
sudo useradd -m -p `mkpasswd 123456` -s /bin/bash dev | |
sudo usermod -a -G sudo dev | |
SHELL | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.box = "centos/7" | |
config.vm.network "private_network", ip: "172.20.20.21" | |
config.vm.synced_folder ".", "/vagrant", disabled: true | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = false | |
vb.memory = 2048 | |
vb.cpus = 2 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.hostname = "dev-server" | |
config.vm.network "private_network", ip: "172.20.20.21" | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = false | |
vb.memory = 2048 | |
vb.cpus = 1 | |
end | |
config.vm.provision "shell", inline: <<-SHELL | |
sudo apt-get update | |
sudo apt-get install -y whois git | |
sudo useradd -m -p `mkpasswd password` -s /bin/bash dev | |
sudo usermod -a -G sudo dev | |
echo Installing Docker ... | |
sudo su - | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58 118E89F3A912897C070ADBF76221572C52609D | |
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt /sources.list.d/docker.list | |
apt-get update && apt-get install -y linux-image-extra-$(uname -r) | |
apt-get update && apt-get install -y docker-engine | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment