This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
ip_address = "192.168.56.1" | |
config.vm.box = "ubuntu-12.04.2-server-amd64" | |
config.vm.hostname = "chef-server.local" | |
config.ssh.timeout = 30 | |
config.vm.provider :virtualbox do |vbox| | |
vbox.customize [ "modifyvm", :id, "--memory", 1024 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
╭─maxmanders@hedgehog ~ ‹ruby-1.9.3› | |
╰─$ 1=act | |
╭─maxmanders@hedgehog ~ ‹ruby-1.9.3› | |
╰─$ 2=ual | |
╭─maxmanders@hedgehog ~ ‹ruby-1.9.3› | |
╰─$ actualvariable=100 | |
╭─maxmanders@hedgehog ~ ‹ruby-1.9.3› | |
╰─$ echo ${actualvariable} | |
100 | |
╭─maxmanders@hedgehog ~ ‹ruby-1.9.3› |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Zookeeper to add/remove from the cluster as required. | |
require 'zk' | |
zookeeper_node = search(:node, "role:zookeeper AND chef_environment:#{node.chef_environment}")[0] | |
listen_ip = zookeeper_node[:ipaddress] | |
zk = ZK.new("#{listen_ip}:2181") | |
# Cluster members reported by Zookeeper. | |
active_cluster_members = zk.children(node[:zk_watcher][:zk_node_path]).collect { |x| x.split(':')[0] } | |
# Cluster members reported by the node. | |
node_cluster_members = eval %x[rabbitmqctl cluster_status -q | grep running_nodes | grep -o "\[.*\]"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter = '' | |
unless @filters.empty? | |
filter = "AND (" + filters.map { |filter| %Q(pb.ProductCode LIKE '%#{filter}%') }.join(" OR ") + ")" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter = unless @filters.empty? | |
"AND (" + @filters.map { |x| %Q(pb.ProductCode LIKE '%#{x}%') }.join(" OR ") + ")" | |
end || '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sheet_number = if spreadsheet.worksheets.length == 1 | |
0 | |
else | |
sheet_number = spreadsheet.worksheets.length - 1 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host * | |
# Forward remote X11 connections to run a remote GUI app locally | |
forwardx11 yes | |
# Only offer up keys defined with IdentityFile below, rather than all keys | |
identitiesonly yes | |
cipher arcfour | |
compression yes | |
# If using ssh-agent, forward that to remote jump host to avoid copying private keys | |
forwardagent yes | |
# Don't kill connetions too quickly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
common_packages = %w(python-setuptools python-dev) | |
case node['platform'] | |
when "centos", "redhat", "amazon" | |
(common_packages + ['gcc']).each do |pkg| | |
package pkg do | |
action :install | |
end | |
end | |
when "debian", "ubuntu" | |
(common_packages + ['build-essential']).each do |pkg| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rake routes | grep group | |
group_index GET /group(.:format) group#index | |
POST /group(.:format) group#create | |
new_group GET /group/new(.:format) group#new | |
edit_group GET /group/:id/edit(.:format) group#edit | |
group GET /group/:id(.:format) group#show | |
PATCH /group/:id(.:format) group#update | |
PUT /group/:id(.:format) group#update | |
DELETE /group/:id(.:format) group#destroy | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use JSON; | |
my %results = (); | |
my $keyspace = 'None'; | |
my $table = 'None'; | |
while (<>) { |