Skip to content

Instantly share code, notes, and snippets.

@sbates
sbates / gist:5685872
Last active December 17, 2015 22:59
A discussion on Berkshelf worlfklow
<someara> moin
[08:54:05] <maruq> gkarekinian: haha, probably.
[08:54:20] <maruq> gkarekinian: joining for the "how to cook good" chat?
[08:54:37] <maruq> someara: guten abend!
[08:54:42] <gkarekinian> Sure
[08:55:00] <gkarekinian> "How to avoid burning all your pans and pots"
[08:55:23] <someara> danke
[08:55:24] <maruq> haha!
[08:55:49] <maruq> someara: do you speak ze German, or just know the basics?
[08:55:58] <someara> just the basics
@sbates
sbates / Berksfile
Created May 30, 2013 18:57
a berksfile for a monitoring cookbook
metadata
cookbook 'runit', '1.1.5', path: '/Users/saschabX/github/runit'
#cookbook 'sensu', git: 'git://github.com/sensu/sensu-chef.git'
cookbook 'sensu', path: '/Users/saschabX/github/sensu-chef'
#cookbook 'redis', git: 'git://github.com/miah/chef-redis'
cookbook 'redis', path: '/Users/saschabX/github/chef-redis'
cookbook 'erlang', path: '/Users/saschabX/github/erlang'
cookbook 'yum', '2.2.3', git: 'git://github.com/opscode-cookbooks/yum.git'
@sbates
sbates / tomcat_install_provider.rb
Created May 17, 2013 18:34
A first pass at trying to install Tomcat from wherever the hell you please to keep your pkg.
#
# Cookbook Name:: tomcat
# Provider:: install
#
# Author:: Sascha Bates
def load_current_resource
@inst = new_resource.pkg_src
@uid = new_resource.uid || "5001"
@gid = new_resource.gid || "5001"
#
# Cookbook Name:: tomcat
# Definitions:: deploy_tomcat_app
#
# Author:: Sascha Bates
define :deploy_tomcat_app,
:artifact_type => "latest", #latest or static
:artifact => "",
:group_id => "",
@sbates
sbates / tomcat_install.rb
Created May 12, 2013 13:15
Install Tomcat via artifactory as the package manager
#
# Cookbook Name:: tomcat
# Recipe:: install
#
# Copyright 2012
# Author:: Sascha Bates
# Contact:: sascha@brattyredhead.com
# This recipe is meant to be a common use pattern for Tomcat
# As it matures, I'll probably factor it back into a definition
# Actions: set variarbles | setup user | download tomcat | extract tomcat | set a symlink | deploy templates | define service
@sbates
sbates / vagabond nohup
Created May 5, 2013 04:05
this is the output from nohup sudo vagabond up --debug &
DEBUG: chef-solo -j /vagrant/.vagabond/dna.json -c /vagrant/.vagabond/solo.rb
[2013-05-05T04:03:28+00:00] INFO: *** Chef 11.4.4 ***
[2013-05-05T04:03:29+00:00] INFO: Setting the run_list to ["recipe[vagabond]"] from JSON
[2013-05-05T04:03:29+00:00] INFO: Run List is [recipe[vagabond]]
[2013-05-05T04:03:29+00:00] INFO: Run List expands to [vagabond]
[2013-05-05T04:03:29+00:00] INFO: Starting Chef Run for sensu-lxc-host
[2013-05-05T04:03:29+00:00] INFO: Running start handlers
[2013-05-05T04:03:29+00:00] INFO: Start handlers complete.
[2013-05-05T04:03:29+00:00] INFO: Processing package[lxc] action install (lxc::default line 3)
[2013-05-05T04:03:29+00:00] INFO: Processing package[yum] action install (lxc::install_dependencies line 4)
vagrant@sensu-lxc-host:~$ cd /vagrant
vagrant@sensu-lxc-host:/vagrant$ sudo vagabond up
Ensuring expected system state (creating required base containers)
  - This can take a while...
[5/4/13 10:26:08 PM] Sascha Bates: and it's hanging here
@sbates
sbates / gist:5519455
Created May 5, 2013 02:33
kitten cam negotiations
[5/4/13 9:24:24 PM] Sascha Bates: my kitten picture is missing
[5/4/13 9:24:46 PM] :bf: night time
[5/4/13 9:25:09 PM] Sascha Bates: but cats are nocturnal
[5/4/13 9:25:43 PM] :bf: sure
[5/4/13 9:26:11 PM] :bf: you can watch them running around in the dark
[5/4/13 9:26:55 PM] Sascha Bates: you could turn on the light
[5/4/13 9:27:06 PM] :bf: no
[5/4/13 9:27:12 PM] Sascha Bates: why not?
[5/4/13 9:27:24 PM] :bf: it's night time
[5/4/13 9:27:25 PM] Sascha Bates: but what will Isa and I do at night?
@sbates
sbates / gist:5518972
Created May 4, 2013 22:24
librarian/vagrant wtf
saschabx-mac08:sensu-lxc-demo saschabX$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'hw-ubuntu-12.10'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Installing Chef cookbooks with Librarian-Chef...
[default] Destroying VM and associated drives...
(StandardError).vagrant.d/gems/gems/librarian-0.1.0/lib/librarian/source/git/repository.rb:209:in `run_command_internal': Permission denied (publickey).
fatal: The remote end hung up unexpectedly
@sbates
sbates / artifact_provider.rb
Last active October 5, 2017 14:02
a pass at an artifactory resource/provider
require 'chef/provider'
require 'restclient'
class Chef
class Provider
class Artifact < Chef::Provider
def load_current_resource
@current_resource = Chef::Resource::Artifact.new(new_resource.name)
art_user = new_resource.user