Skip to content

Instantly share code, notes, and snippets.

@stephenlauck
stephenlauck / ini_to_hash.rb
Created February 28, 2014 17:35
Convert INI file to Hash in Ruby
#!/usr/bin/env ruby
require 'pp'
ini = Hash.new
cur_section = nil
File.open("Test.ini").each do |line|
@stephenlauck
stephenlauck / friends_invite.js
Created March 7, 2014 19:37
Facebook Event Invite All Friends List
javascript:elms=document.getElementsByName("checkableitems[]");for (i=0;i<elms.length;i++){if (elms[i].type="checkbox" )elms[i].click()}
@stephenlauck
stephenlauck / python_27_centos_65.md
Last active August 29, 2015 14:00
Steps to locally test Python cookbook and install 2.7 on CentOS 6.5
@stephenlauck
stephenlauck / setup.md
Last active August 29, 2015 14:02
Wndows local development setup for Chef

download virtual box

download vagrant

downlaod chef

download git

download sublime text

@stephenlauck
stephenlauck / README.md
Last active August 29, 2015 14:04
chef_local_dev_setup_hp

Local Development Setup for Chef

Download and install

chef-dk

Neckbeard Way

Download and install

virtual box

@stephenlauck
stephenlauck / .kitchen.yml
Created August 26, 2014 20:52
example of port forwarding in kitchen yml
---
driver:
name: vagrant
driver_config:
requre_chef_omnibus: true
network:
- ["forwarded_port", {guest: 8080, host: 8080}]
- ["private_network", {ip: "33.33.33.10"}]
customize:
~/dev/chef-solutions/orchestrate(master) > kitchen converge standalone-centos-6
-----> Starting Kitchen (v1.2.1)
-----> Creating <standalone-centos-65>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'opscode-centos-6.5'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: standalone-centos-65_default_1415219658591_76192
Skipping Berkshelf with --no-provision
==> default: Fixed port collision for 22 => 2222. Now on port 2202.
==> default: Clearing any previously set network interfaces...
@stephenlauck
stephenlauck / gist:95a43f98eac1432da615
Created December 11, 2014 18:23
.kitchen.local.yml
---
driver:
name: digitalocean
driver_config:
digitalocean_access_token: TOKEN
ssh_key_ids: 'KEYID'
ssh_key: '~/.ssh/id_rsa'
platforms:

A Quick Tour of A Chef Client Run Internals

Dan DeLeo appeared on the FoodFightShow some time ago to walk through "what a Chef run really does". I expanded on these remarks in my personal investigation.

/usr/bin/chef-client

  • bin/chef-client creates a new Chef::Application::Client (subclass of Chef::Application which sets up common things like loggers across chef-client, chef-solo, knife, etc.) then jump to:

  • lib/chef/client.rb

  • application classes create a new Chef::Client object, which calls initialize().

@stephenlauck
stephenlauck / rtorrent.rc
Last active August 29, 2015 14:12
rtorrent.rc
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 30
max_peers = 150
# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = -1