Skip to content

Instantly share code, notes, and snippets.

@tknerr
tknerr / Mccloudfile.rb
Created August 21, 2012 12:13
minimal mccloudfile that works with amazon aws AND hosts provider (but keypair needs to be imported first and security zones other than 'mccloud' must exist)
Mccloud::Config.run do |config|
NAME = "tkn"
# identity
config.mccloud.prefix="mccloud"
config.mccloud.environment="development"
config.mccloud.identity=NAME
# define AWS cloud provider
@tknerr
tknerr / somefile.rb
Created August 27, 2012 08:52
tracing require load times
module Kernel
def require_with_trace(*args)
start = Time.now.to_f
@indent ||= 0
@indent += 2
require_without_trace(*args)
@indent -= 2
Kernel::puts "#{' '*@indent}#{((Time.now.to_f - start)*1000).to_i} #{args[0]}"
end
@tknerr
tknerr / mkmf.log
Created October 22, 2012 15:04
omnibus / ubuntu 12.04 openssl conflict
--------------------
have_library: checking for PQconnectdb() in -lpq... -------------------- no
"gcc -o conftest -I/opt/chef/embedded/include/ruby-1.9.1/x86_64-linux -I/opt/chef/embedded/include/ruby-1.9.1/ruby/backward -I/opt/chef/embedded/include/ruby-1.9.1 -I. -I/opt/chef/embedded/include -I/usr/include/postgresql -I/opt/chef/embedded/include -fPIC conftest.c -L. -L/opt/chef/embedded/lib -Wl,-R/opt/chef/embedded/lib -L/opt/chef/embedded/lib -Wl,-R/opt/chef/embedded/lib -L. -Wl,-rpath,/opt/chef/embedded/lib -L/opt/chef/embedded/lib -rdynamic -Wl,-export-dynamic -L/usr/lib -Wl,-R -Wl,/opt/chef/embedded/lib -L/opt/chef/embedded/lib -lruby -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
/usr/lib/libpq.so: undefined reference to `SSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0'
/usr/lib/libpq.so: undefined reference to `SSL_write@OPENSSL_1.0.0'
/usr/lib/libpq.so: undefined reference to `SSL_set_fd@OPENSSL_1.0.0'
/usr/lib/libpq.so: undefined reference to `SSL_use_PrivateKey_file@OPENSSL_1.0.0'
/usr/lib/
@tknerr
tknerr / Berksfile
Created October 24, 2012 08:48
`berks install` does not work on my windoze 7
site :opscode
cookbook 'mysql'
cookbook 'nginx', '~> 0.101.5'
@tknerr
tknerr / client.rb
Created November 25, 2012 10:35
updated postgresql::client with workaround for COOK-1406 (compile from source)
#
# Cookbook Name:: postgresql
# Recipe:: client
#
# Author:: Joshua Timberman (<joshua@opscode.com>)
# Author:: Lamont Granquist (<lamont@opscode.com>)
# Copyright 2009-2011 Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@tknerr
tknerr / chef-run-stdout
Created December 2, 2012 20:53
minitest handler errors
[2012-12-02T20:47:49+00:00] INFO: *** Chef 10.16.2 ***
[2012-12-02T20:47:50+00:00] INFO: Setting the run_list to ["recipe[minitest-handler]", "recipe[tdd-example::default]"] from JSON
[2012-12-02T20:47:50+00:00] INFO: Run List is [recipe[minitest-handler], recipe[tdd-example::default]]
[2012-12-02T20:47:50+00:00] INFO: Run List expands to [minitest-handler, tdd-example::default]
[2012-12-02T20:47:50+00:00] INFO: Starting Chef Run for tdd-example-vm
[2012-12-02T20:47:50+00:00] INFO: Running start handlers
[2012-12-02T20:47:50+00:00] INFO: Start handlers complete.
[2012-12-02T20:47:51+00:00] INFO: Processing chef_gem[minitest] action nothing (minitest-handler::default line 2)
[2012-12-02T20:47:51+00:00] INFO: Processing chef_gem[minitest] action install (minitest-handler::default line 2)
[2012-12-02T20:47:51+00:00] INFO: Processing chef_gem[minitest-chef-handler] action nothing (minitest-handler::default line 7)
@tknerr
tknerr / Vagrantfile
Last active January 28, 2024 09:12
Sample Vagrantfile that works with all providers (virtualbox, aws, managed) and in combination with the vagrant-omnibus plugin
#
# Vagrantfile for testing
#
Vagrant::configure("2") do |config|
# the Chef version to use
config.omnibus.chef_version = "11.4.4"
def configure_vbox_provider(config, name, ip, memory = 384)
config.vm.provider :virtualbox do |vbox, override|
@tknerr
tknerr / Gemfile
Created June 11, 2013 08:54
Gemfile.lock showing where the win32-process gem is coming from
source 'https://rubygems.org'
gem 'berkshelf', '2.0.3'
@tknerr
tknerr / log
Created June 11, 2013 15:29
set VAGRANT_LOG=debug vagrant up see Vagrantfile in fgrehm/vagrant-cachier#13
D:\Repos\_github\bills-kitchen\target\tmp5>vagrant up
INFO global: Vagrant version: 1.2.2
DEBUG global: Loading core plugin: D:/Repos/_github/bills-kitchen/target/build/tools/vagrant/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: D:/Repos/_github/bills-kitchen/target/build/tools/vagrant/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: D:/Repos/_github/bills-kitchen/target/build/tools/vagrant/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: D:/Repos/_github/bills-kitchen/target/build/tools/vagrant/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/init/plugin.rb
@tknerr
tknerr / vagrant.bat
Last active December 20, 2015 01:19
Modified vagrant.bat to avoid hashicorp/vagrant#1833
@ECHO OFF
REM Don't set variables globally
SETLOCAL
REM Some variables
SET "EMBEDDED_DIR=%~dp0\..\embedded"
REM Set environmental variables
SET "GEM_HOME=%EMBEDDED_DIR%\gems"