Skip to content

Instantly share code, notes, and snippets.

@johnwheeler
Last active October 1, 2015 16:09
Show Gist options
  • Save johnwheeler/ae2a71b7ba67a82b7229 to your computer and use it in GitHub Desktop.
Save johnwheeler/ae2a71b7ba67a82b7229 to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "debian/jessie64"
config.vm.network "private_network", ip: "192.168.0.100"
config.vm.provider "virtualbox" do |vb|
vb.memory = "8192"
end
config.vm.provision "shell", inline: <<-SHELL
sudo su root
export DEBIAN_FRONTEND=noninteractive
# upgrade system
apt-get update
apt-get upgrade -y
# UFW
apt-get install ufw -y
ufw allow 80/tcp
ufw allow 22/tcp
ufw allow 443/tcp
ufw --force enable
# unattended-upgrades
apt-get install unattended-upgrades -y
cp /usr/share/unattended-upgrades/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades
# Python
apt-get install python-dev -y
apt-get install python-virtualenv -y
apt-get install libxml2-dev -y
apt-get install libxslt1-dev -y
apt-get install node-less -y
# Nginx
apt-get install nginx -y
# UWSGI
apt-get install uwsgi-emperor -y
apt-get install uwsgi-plugin-python -y
# Postgresql
sh -c 'echo deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update
apt-get install postgresql-9.4 -y
apt-get install postgresql-client-9.4 -y
apt-get install postgresql-contrib-9.4 -y
apt-get install postgresql-server-dev-9.4 -y
# Clean up
apt-get clean
# Zero out disk, returns error status once disk fills up
# dd if=/dev/zero of=/EMPTY bs=1M
# rm -f /EMPTY
# Clear history
cat /dev/null > ~/.bash_history && history -c
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment