Skip to content

Instantly share code, notes, and snippets.

View patcon's full-sized avatar

Patrick Connolly patcon

View GitHub Profile
@patcon
patcon / chef-client fail
Created April 20, 2011 20:09
"chef-client -c client.rb -j dna.json" is wonking out
Patrick-Connollys-MacBook-Pro:chef-server-test » vagrant destroy
[default] Forcing shutdown of VM...
[default] Destroying VM and associated drives...
Patrick-Connollys-MacBook-Pro:chef-server-test » vagrant up
[default] Provisioning enabled with chef_server...
[default] Importing base box 'lucid32'...
[default] Matching MAC address for NAT networking...
[default] The guest additions on this VM do not match the install version of
VirtualBox! This may cause things such as forwarded ports, shared
folders, and more to not work properly. If any of those things fail on
@patcon
patcon / jenkins_master.rb
Created September 8, 2011 23:34
Example of a chef role file for settings up large parts of a jenkins server (xml config files not included)
{
"name": "jenkins_master",
"default_attributes": {
"authorization": {
"sudo": {
"users": [
"jenkins"
]
}
},
@patcon
patcon / gist:1436645
Created December 6, 2011 03:53
Vagrantfile stub for Chef cookbook development
Vagrant::Config.run do |config|
config.vm.box = "lucid64"
config.vm.define "toomanyclowns-cooking"
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = [ "cookbooks", "cookbooks-overrides" ]
chef.add_recipe "toomanyclowns"
# chef.json = {
# :mysql_password => "foo"
@patcon
patcon / gist:1436974
Created December 6, 2011 06:08
skeleton knife.rb for Chef cookbook development in Vagrant
require 'librarian/chef/integration/knife'
current_dir = File.dirname(__FILE__)
cookbook_path = [ Librarian::Chef.install_path, "#{current_dir}/../cookbooks-overrides" ]
cookbook_copyright 'Myplanet Digital'
cookbook_email 'devops@myplanetdigital.com'
cookbook_license 'apachev2'
@patcon
patcon / gist:1444186
Created December 7, 2011 19:13
Sample file for testing Drupal's Feeds Xpath Parser module
<jobs xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<things>
<Item>
<Title>XML Developer</title>
<src url="http://www.here.com">Here.com</src>
<salary ccy="usd">50,000</salary>
<salary ccy="gbp">30,000</salary>
<publish_date>Tue, 06 Oct 2010 15:21:48 +0000</publish_date>
<test />
<Description>A job creating applications with XML.</description>
@patcon
patcon / gist:1604298
Created January 13, 2012 02:35
gpgme gem install failure
$ sudo gem install gpgme
Fetching: gpgme-2.0.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed gpgme-2.0.0
1 gem installed
Installing ri documentation for gpgme-2.0.0...
No definition for rb_s_gpgme_check_version
No definition for rb_s_gpgme_engine_check_version
rest = require('restler')
url = 'https://www.googleapis.com/moderator/v1/series/1935041/topics/64/submissions'
rest.get(url)
.on('success', (responseData) ->
console.log(responseData.data.items[3])
)
52 bash "Running Drupal install script..." do
53 code ". #{node['filesystem']['v-root']['mount']}/config/scripts/01-build.sh"
54 environment({
55 'PROJECT' => 'condel',
56 'SERVER_ROOT_PASSWORD' => node['mysql']['server_root_password'],
57 'ACCOUNT_PASS' => 'admin',
58 'ACCOUNT_MAIL' => 'vagrant@localhost'
59 })
60 not_if "test -e /mnt/www/html/#{project}"
61 end
[Thu, 12 Apr 2012 10:13:03 -0700] INFO: Processing ruby_block[check_pear_version] action create (drush::upgrade_pear line 25)
[Thu, 12 Apr 2012 10:13:03 -0700] INFO: ruby_block[check_pear_version] called
[Thu, 12 Apr 2012 10:13:04 -0700] INFO: Processing log[original_pear_version: ] action write (drush::upgrade_pear line 35)
[Thu, 12 Apr 2012 10:13:04 -0700] INFO: original_pear_version:
[Thu, 12 Apr 2012 10:13:04 -0700] INFO: Processing log[declared_pear_version: 1.9.4] action write (drush::upgrade_pear line 34)
[Thu, 12 Apr 2012 10:13:04 -0700] INFO: declared_pear_version: 1.9.4
[Thu, 12 Apr 2012 10:13:04 -0700] INFO: Processing php_pear[PEAR] action install (drush::upgrade_pear line 37)
@patcon
patcon / inline_ohai_plugin.rb
Created April 12, 2012 21:03
loading ohai plugin inline from other cookbook
plugin_path = File.expand_path "#{File.dirname(__FILE__)}/../files/default/plugins"
Ohai::Config[:plugin_path] << plugin_path
ohai "reload_pear" do
plugin "pear"
end.run_action(:reload)
log node['languages']['pear']['version']