• Stars
    star
    228
  • Rank 170,166 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created about 11 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Virtual Machine for every language

Vagrantfiles

Just a cheeky repository with some base Vagrantfiles I use in a number of projects. Each setup is based on a vanilla installation of Ubuntu 14.04 LTS (Trusty Tahr) from Vagrant Cloud.

How do I use it?

To download a vagrant box for your project, just run the following. Remember to replace $LANG with an available language from the list below.

curl -O https://raw.githubusercontent.com/adlawson/vagrantfiles/master/$LANG/Vagrantfile
vagrant up
vagrant ssh
cd /srv

Available languages

Language Tooling Version Extras
bash bash-4.4
brainfuck bf 20041219ubuntu5
clojure Leiningen stable Java 8
csharp Mono stable
elixir Mix latest from erlang-solutions.com
erlang Rebar latest from erlang-solutions.com
golang Godep 1.4.2 from golang.org
haskell 2010
hhvm Composer latest from ppa:mapnik/boost
iojs NPM 1.2.0 from iojs.org
julia latest from ppa:staticfloat/juliareleases
lua 5.2.*
nodejs NPM latest from ppa:chris-lea/node.js
ocaml latest from ppa:asvm/ppa OPAM
perl 5.*
php Composer 5.6.* from ppa:ondrej/php5-5.6 Xdebug
python Pip 3.4.* and 2.7.* (python3 and python)
racket 5.93
ruby Gem 2.2.0 RVM
rust Cargo stable
scala SBT 2.11.5 Java 8
scheme latest mit-scheme

Template

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

    hostname = "<your language name here>.box"
    locale = "en_GB.UTF.8"

    # Box
    config.vm.box = "ubuntu/trusty64"

    # Shared folders
    config.vm.synced_folder ".", "/srv"

    # Setup
    config.vm.provision :shell, :inline => "touch .hushlogin"
    config.vm.provision :shell, :inline => "hostnamectl set-hostname #{hostname} && locale-gen #{locale}"
    config.vm.provision :shell, :inline => "apt-get update --fix-missing"
    config.vm.provision :shell, :inline => "apt-get install -q -y g++ make git curl vim"

    # Lang
    # Provide additional packages/setup/etc
    ...
end

Configuration

Static IP

To add support for a static IP address to your box, add the following to the Vagrantfile after download:

# Network
config.vm.network :private_network, ip: "10.10.10.100"

NFS

If you prefer NFS to the default network filesystem provided by your VM, replace the # Shared folders lines in the Vagrantfile with the following. You will need a Static IP for this to work correctly.

# Shared folders
config.vm.synced_folder ".", "/srv", :nfs => true

Performance

It may be important to you to limit the performance hit to your local machine, or ensure enough memory is available to your provider. For example, the configuration below will limit the VM to using no more than 50% of your CPU and allocate up to 2GB of memory. Note: This example uses VirtualBox, but if you use a different provider such as VMWare, then this will be ignored safely.

  config.vm.provider :virtualbox do |v|
    v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
    v.customize ["modifyvm", :id, "--memory", 2048]
  end

License

The content of this library is released under the MIT License by Andrew Lawson.
You can find a copy of this license in LICENSE or at http://opensource.org/licenses/mit.

More Repositories

1

php-vfs

Virtual File System
PHP
298
star
2

nodejs-langs

ISO 639-1/2/3 Language codes with English and local names
JavaScript
111
star
3

search-algorithms

Search algorithms implemented in different languages
Elixir
71
star
4

mixcloud-tracklist

[Unofficial] Display tracklists on Mixcloud
JavaScript
47
star
5

sweetjs-pipeline

Naturally expressive functional composition
JavaScript
26
star
6

nodejs-wesley

🚨 [UNMAINTAINED] Protocol compliant web socket server with some awesome extras.
JavaScript
23
star
7

nodejs-urine

Sample a stream
JavaScript
9
star
8

docker-dat

Dat server in Docker
Shell
9
star
9

nodejs-throb

🚨 [UNMAINTAINED] Lightweight heartbeat and ping server
JavaScript
7
star
10

php-veval

Virtual metaprogramming
PHP
6
star
11

scala-cats

Cats extended
Scala
5
star
12

js-defur

🚨 [UNMAINTAINED] Defer construction or execution of a service until it's needed
JavaScript
4
star
13

coffee-key

🚨 [UNMAINTAINED] A tiny little keycode library
CoffeeScript
4
star
14

php-mustache

🚨 [UNMAINTAINED] PHP5.3+ Mustache implementation. Still currently in development.
PHP
4
star
15

php-timezone

UTC default timezone
PHP
3
star
16

elixir-pnum

Concurrent list enumeration
Elixir
2
star
17

php-restack

🚨 [UNMAINTAINED] PHP 5.3+ datastructure library
PHP
2
star
18

dotfiles

~
Emacs Lisp
2
star
19

adlawson.github.io

Website
HTML
2
star
20

dockerfiles

🐳
Dockerfile
2
star
21

scala-json4s

Serializers, formatters and other useful extensions for JSON4S in Scala
Scala
2
star
22

behat-parallel

Parallel Behat processes
Shell
2
star
23

nodejs-conway

Rendering agnostic implementation of Conway's Game of Life in JavaScript
JavaScript
2
star
24

php-reform

🚨 [UNMAINTAINED] PHP 5.3+ form library
PHP
1
star
25

js-zcombinator

Z Combinator for self-referencing anonymous functions
JavaScript
1
star
26

howlonguntilourholiday.com

🚨 [UNMAINTAINED] How long until our holiday?
CoffeeScript
1
star