Skip to content

Instantly share code, notes, and snippets.

@stevendanna
stevendanna / Kitchenfile.rb
Created August 20, 2012 03:00
Openstack Test-kitchen experiment
default_runner "openstack"
openstack do
auth_url "http://REDACTED:5000/v2.0/tokens"
username "steven"
password "REDACTED"
tenant "openstack"
end
cookbook "emacs" do
@stevendanna
stevendanna / gist:3327498
Created August 11, 2012 21:50
Cool Story.
sdanna@gaius ~/src > rails new foobar
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
sdanna@gaius ~/src > gem list rails
*** LOCAL GEMS ***
$ (cat <<'EOP'
{
"normal" : {
"chef_client": {
"server_url": "https://api.opscode.com/organizations/ORGNAME",
"validation_client_name": "ORGNAME-validator"
}
},
"run_list": [
"recipe[chef-client::config]",
@stevendanna
stevendanna / psearch.rb
Created July 9, 2012 17:16
Simple Partial Search Knife Plugin
# psearch.rb: A knife plugin for the Partial Search API
#
# Note that this is a Beta feature of Opscode Hosted Chef
# and that it's interface may changed based on user feedback.
#
# This plugin is net yet officially supported by Opscode
class Psearch < Chef::Knife
banner "knife psearch INDEX SEARCH NAME=DESIRED_KEY_PATH,[NAME=DESIRED_KEY_PATH]"
$ sudo ./run test-tool/libguestfs-test-tool
===== Test starts here =====
LIBGUESTFS_PATH=/home/steven/libguestfs-1.17.32/appliance
LIBGUESTFS_DEBUG=1
TMPDIR=/home/steven/libguestfs-1.17.32
libguestfs: new guestfs handle 0x221cf60
library version: 1.17.32
guestfs_get_append: (null)
guestfs_get_attach_method: appliance
guestfs_get_autosync: 1
error() {
echo "$1" >&2
return 1
}
is_integer() {
case "$1" in
''|*[!0-9]*)
return 1
@stevendanna
stevendanna / summarize
Created March 11, 2012 01:35
summarize: A script to generate summarize statistics from input
#!/usr/bin/Rscript
#
# Quickly generate some basic descriptive
# statistics from stdin
#
library('optparse', quietly=TRUE)
option_list <- list(make_option(c("-H", "--header"), action="store_true", default=FALSE,
chef > recipe
chef:recipe > node.default['foo'] = "bar"
=> "bar"
chef:recipe > node.set_unless['foo'] = "baz"
=> "baz"
chef:recipe > node['foo']
=> "baz"
chef:recipe > node.normal['boo'] = "bar"
=> "bar"
chef:recipe > node.set_unless['boo'] = "baz"
require 'chef/knife'
class Chef
class Knife
class CheckBootstrap < Knife
deps do
require 'chef/knife/bootstrap'
require 'chef/knife/core/bootstrap_context'
require 'erubis'
chef:recipe > puts (:this => "that")
SyntaxError: (irb#1):38: syntax error, unexpected tASSOC, expecting ')'
puts (:this => "that")
^
(irb#1):38: syntax error, unexpected ')', expecting $end
chef:recipe > puts(:this => "that")
{:this=>"that"}
=> nil
chef:recipe > puts ({:this => "that"})