Skip to content

Instantly share code, notes, and snippets.

View Atalanta's full-sized avatar

Stephen Nelson-Smith Atalanta

  • Ticketmaster
  • Hampshire, UK
View GitHub Profile
@Atalanta
Atalanta / gist:3843980
Created October 6, 2012 05:14
metrics
require 'json'
def metrics(values, keys)
Hash[keys.zip(values)]
end
values = %x[free -m].match(/cache:\s+(\d+)\s+(\d+)\n/).captures
keys = ["memory-buffers", "memory-cached"]
data = metrics(values, keys)
$ cucumber-chef test --tags @minitest
cucumber-chef v2.0.0.rc1
Using features directory: /home/sns/chef-repo/features
Cucumber-Chef Test Runner Initalized!
Cleaning up any previous test runs...done.
Uploading files required for this test run...done.
Executing Cucumber-Chef Test Runner
@minitest
Feature: Run minitests
sh -c '
portsnap fetch
portsnap extract
BATCH=yes
export BATCH
echo "RUBY_DEFAULT_VER=1.9" >> /etc/make.conf
pkg_add -r autoconf
cd /usr/ports/converters/ruby-iconv
make install
gem install chef --no-ri --no-rdoc
Hhh

This is interesting

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.

@Atalanta
Atalanta / gist:1645223
Created January 20, 2012 04:41
Example README template
Description
===========
A brief description of the purpose of this cookbook, the problem it solves, etc.
Requirements
============
Requirements for using this cookbook. Chef version can be noted if significant.
@Atalanta
Atalanta / find_java_home.rb
Created November 14, 2011 02:34
Finding JAVA_HOME on OSX
#!/usr/bin/env ruby
java_dir = %x[ls -l $(which java)].split.last
java_home_command = java_dir.gsub('java', 'java_home')
print "JAVA_HOME is: "
java_home = system(java_home_command)
@Atalanta
Atalanta / We can haz your READMEs
Created November 10, 2011 07:49
Retrieve all README files from Chef Server
$ knife exec get_readmes.rb
===> Fetching metadata from Chef Server...
................
===> Preparing to download READMEs.
===> Fetching ips ...
===> Fetching solaris ...
===> Fetching sudo ...
===> Fetching application ...
===> Fetching git ...
===> Fetching users ...
if hosts.empty?
hosts |= @h.hosts_for(task) rescue nil
end