Skip to content

Instantly share code, notes, and snippets.

View tmatilai's full-sized avatar

Teemu Matilainen tmatilai

View GitHub Profile
@tmatilai
tmatilai / README.md
Last active December 28, 2015 19:49
Example Vagrant box for AWS provider

Install

tar -czf debian-7.box metadata.json Vagrantfile
vagrant box add debian-7 debian-7.box

Update

When the AMIs change, the easiest it to edit the basebox configuration directly in ~/.vagrant.d/boxes/debian-7/aws/Vagrantfile. You can also use --force option to replace the old box.

@tmatilai
tmatilai / README.md
Last active January 3, 2016 14:39
Install vagrant-berkshelf (and berkshelf) from their git repositories

IMHO the correct way to install bleeding edge plugins to Vagrant is to use the standard Vagrant installer.

These instructions should work for Vagrant 1.1.0 - 1.4.x (but probably not for Vagrant 1.5+),

git clone https://github.com/berkshelf/berkshelf.git
cd berkshelf
gem build berkshelf.gemspec

# Install directly to Vagrant's gem storage, as this is not a plugin
@tmatilai
tmatilai / Vagrantfile
Created March 5, 2014 21:28
Running (Omnibus) Chef provisioner in a Vagrant VM which has RVM installed
Vagrant.configure("2") do |config|
# ...
config.vm.provision :chef_solo do |chef|
chef_gem_path = "/opt/chef/embedded/lib/ruby/gems/1.9.1"
chef.binary_env = "GEM_PATH=#{chef_gem_path} GEM_HOME=#{chef_gem_path}"
chef.binary_path = "/opt/chef/bin"
# ...
end

Keybase proof

I hereby claim:

  • I am tmatilai on github.
  • I am tmatilai (https://keybase.io/tmatilai) on keybase.
  • I have a public key whose fingerprint is A913 3448 06B1 28F7 9457 2913 5AA5 FAF1 386B 7709

To claim this, I am signing this object:

@tmatilai
tmatilai / red_stderr.sh
Created May 3, 2021 06:49
Make direnv error messages red
#!/usr/bin/env bash
#
# Color all stderr output from .envrc evaluation.
# Copy this file to ~/.config/direnv/lib/red_stderr.sh
# Override the direnv stdlib function to print with "normal" color
log_status() {
if [[ -n $DIRENV_LOG_FORMAT ]]; then
local msg=$*
local color_normal