Skip to content

Instantly share code, notes, and snippets.

View sbotman's full-sized avatar

Sander Botman sbotman

View GitHub Profile
@sbotman
sbotman / set_environment.rb
Created October 18, 2012 09:55 — forked from nstielau/set_environment.rb
A Knife plugin to set node environment
## Knife plugin to set node environment
# See http://wiki.opscode.com/display/chef/Environments
#
## Install
# Place in .chef/plugins/knife/set_environment.rb
#
## Usage
# Nick-Stielaus-MacBook-Pro:chef-repo nstielau$ knife node set_environment mynode.net my_env
# Looking for mynode.net
# Setting environment to my_env
@sbotman
sbotman / environment_constraints.rb
Last active December 16, 2015 06:28
A Knife plugin to list environment cookbooks and version constrains.
#
# Author:: Sander Botman (<[email protected]>)
# Copyright:: Copyright (c) 2013 Sander Botman.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@sbotman
sbotman / cs_cmd_run.rb
Created August 30, 2013 14:34
A Knife Cloudstack plugin command to run commands just from the command line.
#
# Author:: Sander Botman (<[email protected]>)
# Copyright:: Copyright (c) 2013 Sander Botman.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@sbotman
sbotman / environment_compare.rb
Last active March 24, 2020 05:30
Compare your chef environments cookbook constraints with this option
#
# Author:: Sander Botman (<[email protected]>)
# Copyright:: Copyright (c) 2013 Sander Botman.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@sbotman
sbotman / environment_compare_spec.rb
Created October 25, 2013 23:59
unit test for the knife environment compare command.
#
# Author:: Sander Botman (<[email protected]>)
# Copyright:: Copyright (c) 2013 Sander Botman.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@sbotman
sbotman / Gemfile
Last active August 29, 2015 14:07 — forked from kesor/Gemfile
source :rubygems
gem 'json', '= 1.5.4' # knife/chef 11.0 and 11.20 is broken with json 1.5.5/1.7.7
gem 'vagrant'
gem 'vagrant-hostmaster'
@sbotman
sbotman / recursive_file_search
Last active August 29, 2015 14:08
Windows Ruby Functions
@sbotman
sbotman / cloudstack.py
Last active August 29, 2015 14:09
Cloudinit patch
# Copyright 2014 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
@sbotman
sbotman / rpm_build_example
Created January 5, 2015 17:42
RPM Building
commands for creating nagios rpm file
yum install rpm-build
yum install yum-utils
yum-builddep nagios.spec
rpmbuild -ba nagios.spec
# file: /opt/opscode/embedded/service/opscode-erchef/lib/chef_objects-12.2.0/priv/depselector_rb/depselector.rb
# ensure that the Gemfile is in the cwd
Dir.chdir(File.dirname(__FILE__))
require 'rubygems'
require 'bundler/setup'
require 'dep_selector'
require 'erlectricity'
require 'json'
require 'pp'