Skip to content

Instantly share code, notes, and snippets.

// Use this code snippet in your app.
// Load the AWS SDK
var AWS = require('aws-sdk'),
endpoint = "https://secretsmanager.us-east-1.amazonaws.com",
region = "us-east-1",
secretName = "chaos_api",
secret,
binarySecretData;
// Create a Secrets Manager client
@jwitrick
jwitrick / core_ext.rb
Created February 12, 2016 14:38
mixlib shellout windows core_ext
diff --git a/core_ext.rb b/core_ext.rb
index d889778..0094559 100644
--- a/core_ext.rb
+++ b/core_ext.rb
@@ -288,6 +288,13 @@ module Process
end
token = token.read_ulong
+ if inherit.is_a?(Integer)
+ inherit = if inherit == 1
ruby_block 'check if file exists' do
block {}
only_if ::File.exists? "file"
notifies :install, 'package[x]'
end
package x do
action :nothing
end
######### del_test.py ##########
from cassandra.cluster import Cluster
import time
cluster = Cluster(['10.210.101.30', '10.210.101.145', '10.210.101.143'])
session = cluster.connect()
session.set_keyspace('measurements')
now = time.strftime("%I%M%S")
Berksfile:
source "http://api.berkshelf.com"
Berks conf file:
~/.berkshelf/config.json
{
"ssl": {"verify": false}
}
Mac osx 10.7.5
Vagrant 1.4.3
vagrant-berkshelf 1.3.7
ruby 1.9.3-p484
test-kitchen 1.1.2.dev
kitchen-vagrant 0.14.1.dev
define :create_db do
db_name = params[:name]
mysql_connection = { :host => 'localhost',
:username => 'root',
:password => node['mysql']['server_root_password'] }
service "mysqld" do
action :start
end
directory "#{node['mysql']['dbs']['base_dir']}" do
NoMethodError
-------------
undefined method `loaded_recipes' for #<Chef::RunContext:0x0000000112a0d8>
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/mysql/recipes/ruby.rb:27:in `from_file'
/var/chef/cache/cookbooks/rsapps-databases/recipes/default.rb:27:in `from_file'
/var/chef/cache/cookbooks/rsapps-databases/recipes/ldif.rb:10:in `from_file'
/var/chef/cache/cookbooks/mailstorage-provisioning-ldif/recipes/default.rb:53:in `from_file'
kitchen converge all --log-level debug
-----> Starting Kitchen
[kitchen::driver::vagrant command] BEGIN (vagrant --version)
[kitchen::driver::vagrant command] END (0m0.77s)
-----> Converging <default-centos-63>
D Creating Vagrantfile for <default-centos-63> (/Users/justin.witrick/chef/chef_conf/cookbooks/mailstorage-base/.kitchen/kitchen-vagrant/default-centos-63/Vagrantfile)
D [SSH] vagrant@127.0.0.1 (rm -rf /tmp/kitchen-chef-solo && mkdir -p /tmp/kitchen-chef-solo/cache)
[local command] BEGIN (if ! command -v berks >/dev/null; then exit 1; fi)
[local command] END (0m0.01s)
[local command] BEGIN (berks install --path /var/folders/6g/6chd71bn0w163pwgf2w96dfwswsk1m/T/default-centos-63-cookbooks20130510-13037-ccqi03)
Contents of Berkshelf file:
site :opscode
metadata
group :integration do
cookbook "minitest-handler"
cookbook "mailstorage-base_test", :path => "./test/cookbooks/mailstorage-base_test"
end