Skip to content

Instantly share code, notes, and snippets.

View mriddle's full-sized avatar

Matthew Riddle mriddle

View GitHub Profile
@mriddle
mriddle / chef_troubleshooting.md
Created November 8, 2012 21:25
Troubleshooting chef, clients and recipes

Troubleshooting a chef client/recipe

Debugging Chef with Shef

When the chef client fails to run the recipe successfully during bootstrapping sudo chef-client to setup the connection with the chef-server. It will run with an empty run list. After its connected login to http://yourchefserver.com:4040/nodes/_NODE_NAME_, add the roles/recipes to the chef-client and run sudo chef-client from the client again.

When fixing a recipe and re-running make your modifications run knife cookbook upload -a #or cookbook name from your dev machine and run sudo chef-client from the chef client.

When there are issues registering the client with the chef-server check that the chef-client name isn't already registered on the server under clients or nodes or that the client has not already been registered (see below)

@mriddle
mriddle / chef_server.init
Created November 9, 2012 00:11
Creating and setting up a chef server
#cloud-config
output:
all: ">> /var/log/cloud-init.log"
# the chef server's alias will be "chef", add a /etc/hosts entry for it
bootcmd:
- echo 127.0.0.1 chef >> /etc/hosts
apt_sources:
@mriddle
mriddle / jenkins_copying_configuration.sh
Created November 9, 2012 03:13
Moving Jenkins server configuration from one server to another
ORIGINAL_JENKINS_SERVER=
ORIGINAL_SERVER_USER=
NEW_JENKINS_SERVER=
NEW_SERVER_USER=
# ON THE ORIGINAL JENKINS SERVER
ssh $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER
cd /var/lib/jenkins/
for i in `ls jobs`; do echo "jobs/$i/config.xml";done > config.totar
@mriddle
mriddle / set_name_of_ec2_instance_with_ami.sh
Created November 12, 2012 23:23
How to set name tag on multiple EC2 instances for given AMI
for instance in `ec2-describe-instances | grep ami-80dd59e9 | grep '^INSTANCE' | cut -f2 -s`; do
ec2-create-tags $instance --tag "Name=Foobar"
done
@mriddle
mriddle / README.md
Created December 13, 2012 11:58
Upgradinate - How to upgrade while staying close to master

Upgrading like a baws

upgradinate_script.rb

  helper = UpgradinateFileHelper.new 'OLD NESS', 'NEW-NESS'
  helper.upgradinate_files [
      "/path/to/project/Gemfile"
 ]
@mriddle
mriddle / example_gemfile_snippet.rb
Created December 13, 2012 12:15
Using upgradinate to upgrade from Ruby 1.8.7(REE) to 1.9.3.
gem 'fast_rake'
gem 'nokogiri-diff'
gem 'rcov', '~> 0.9.11' # RUBY 187
# RUBY 193 gem 'simplecov'
# RUBY 193 gem 'ehrenmurdick-git-pair'
# RUBY 193 gem 'debugger'
gem 'net-ping'
platform :ruby_18 do # These are problematic in ruby 1.9 # RUBY 187
gem 'system_timer' # Remove this from guardfile when we upgrade (in favor of native timer) # RUBY 187
@mriddle
mriddle / trace.txt
Created December 26, 2012 23:31 — forked from yuki24/trace.txt
/home/yuki/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:761: [BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0066 p:0015 s:0266 b:0264 l:000263 d:000263 METHOD /home/yuki/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:761
c:0065 p:0011 s:0256 b:0256 l:000255 d:000255 METHOD /home/yuki/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:755
c:0064 p:0048 s:0253 b:0253 l:000252 d:000252 METHOD /home/yuki/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:744
c:0063 p:0182 s:0250 b:0250 l:000249 d:000249 METHOD /home/yuki/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:557
c:0062 p:0031 s:0237 b:0237 l:000ac0 d:000ac0 METHOD /home/yuki/.rvm/gems/ruby-1.9.3-p194@potter/gems/capybara-1.1.2/lib/capybara/server.rb:47
c:0061 p:0011 s:0233 b:0233 l:001538 d:000232 BLOCK /home/yuki/.rvm/gems/ruby-1.9.3-p194@potter/gems/capybara-1.1.2/lib/capybara/server.rb:69
@mriddle
mriddle / trace.txt
Created December 26, 2012 23:35
Getting a seg fault on ubuntu precise from net http - not due to OpenSSL
[atlas] $ /bin/bash -e /tmp/hudson595422709483623053.sh
_ _______ _______ _______
( \ ( ____ )( ___ )( ____ \
| ( | ( )|| ( ) || ( \/
| | | (____)|| | | || (_____
| | | _____)| | | |(_____ )
| | | ( | | | | ) |
| (____/\| ) | (___) |/\____) |
(_______/|/ (_______)\_______)
@mriddle
mriddle / sublime_init.pp
Last active December 15, 2015 02:09
Ability to add custom packages from within the Sublime Text 2 Puppet Module
# Install Sublime Text 2 into /Applications
#
# Usage:
#
# include sublime_text_2
class sublime_text_2 {
package { 'SublimeText2':
provider => 'appdmg',
source => 'http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1.dmg';
}
@mriddle
mriddle / sublime_config.pp
Last active August 21, 2018 22:06
My Boxen puppet-sublime config
class config::sublime {
define addpkg {
$packagedir = "/Library/Application Support/Sublime Text 2/Packages/"
$pkgarray = split($name, '[/]')
$pkgname = $pkgarray[1]
exec { "git clone https://github.com/${name}.git":
cwd => "/Users/${::luser}${packagedir}",
provider => 'shell',