Skip to content

Instantly share code, notes, and snippets.

@thiago
Created March 6, 2014 17:00
Show Gist options
  • Save thiago/9394328 to your computer and use it in GitHub Desktop.
Save thiago/9394328 to your computer and use it in GitHub Desktop.
Configuração Ubuntu via Vagrant. Python, MySQL, Git, sqlite3, Pip, NodeJS
#!/usr/bin/env bash
# Instalando mysql python e acessorios
# Set up unattended install of mysql-server
export DEBIAN_FRONTEND=noninteractive
sudo debconf-set-selections <<< 'mysql-server-5.1 mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server-5.1 mysql-server/root_password_again password root'
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get -y update
sudo apt-get -y -q install python-software-properties python g++ make build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev python-dev libmysqlclient-dev mysql-server mysql-client python-pip nodejs
# Setando privilegios
mysql --user=root --password=root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;"
sudo sed -i 's/127.0.0.1/0.0.0.0/' /etc/mysql/my.cnf
sudo /etc/init.d/mysql restart
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.define :djangovm do |django_config|
# Every Vagrant virtual environment requires a box to build off of.
django_config.vm.box = "lucid64"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
django_config.vm.box_url = "http://files.vagrantup.com/lucid64.box"
# Forward a port from the guest to the host, which allows for outside
# computers to access the VM, whereas host only networking does not.
django_config.vm.forward_port 80, 8080
django_config.vm.forward_port 8000, 8001
django_config.vm.forward_port 3306, 3307
django_config.vm.provision :shell, :path => "bootstrap.sh"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment