Skip to content

Instantly share code, notes, and snippets.

@b
b / README.md
Created November 28, 2013 01:12 — forked from eric/README.md
say -v Fred <<EOF
Fitter, happier, more productive,
comfortable,
not drinking too much,
regular exercise at the gym
(3 days a week),
getting on better with your associate employee contemporaries,
at ease,
eating well
(no more microwave dinners and saturated fats),
require 'rubygems'
require 'nokogiri'
require 'json'
minimal = {
'name' => 'minimal_vm',
'memory' => 512,
'hd' => '/var/lib/libvirt/images/fc10-x86-64-xen.img',
'cdrom' => '/home/bb/os_images/Fedora-10-x86_64-DVD.iso',
'boot' => ['hd', 'cdrom']
/Users/bb/Development/opscode/nanite/lib/nanite/serializer.rb:36:in `cascade_serializers': Could not load "\004\bo:\023Nanite::Result\t:\n@from\",nanite-8fae8f214df2ce0a05eb23a2d7a9d757:\v@token\"%ba1e085d623d2f3a120065769b265017:\r@resultsC:\tMash{\006\"%/counters/network/interfaces/en1\"\001\371{\"tx\":{\"packets\":\"12235414\",\"bytes\":\"17307128714\",\"collisions\":\"0\",\"compressed\":0,\"carrier\":0,\"errors\":\"0\",\"drop\":0,\"overrun\":0},\"rx\":{\"packets\":\"6406492\",\"bytes\":\"650939526\",\"compressed\":0,\"errors\":\"0\",\"drop\":0,\"overrun\":0,\"multicast\":0,\"frame\":0}}:\b@to\",mapper-a9b22a54009a2c0d5a8ec1d112b1fd1d" using yaml, marshal, json (Nanite::Serializer::SerializationError)
from /Users/bb/Development/opscode/nanite/lib/nanite/serializer.rb:24:in `load'
from /Users/bb/Development/opscode/nanite/lib/nanite/job.rb:18:in `process'
from /Users/bb/Development/opscode/nanite/lib/nanite/mapper.rb:209:in `setup_message_queue'
from /Library/Ruby/Gems/1.8/gems/amqp-0.6.0/lib/mq/que
@b
b / broken.rb
Created February 22, 2009 03:55
34 @_node_info = @connection.node_get_info
35 %w{ cores cpus memory mhz model nodes sockets threads }.each do |a|
36 instance_eval("@#{a}=#{@_node_info.send(a)}")
37 end
@b
b / intermediate hash.js
Created February 16, 2009 22:04
pure evil.rb transforms the pretty form into the intermediate form for xml generation
{
"domain": {
"_content": [
{
"devices": {
"_content": [
{
"emulator": {
"_content": "\/usr\/bin\/kvm"
}
@b
b / gist:62505
Created February 12, 2009 05:40
{
"domain": {
"_content": {
"devices": {
"_content": [
{
"emulator": {
"_content": "\/usr\/bin\/kvm"
}
},
{
"_content": {
"devices": {
"_content": [
{
"emulator": {
"_content": "\/usr\/bin\/kvm"
}
},
{
{"guests":{"i686":{"wordsize":"32","machines":["pc","isapc"],"os_type":"hvm","features":{"apic":{"toggle":"no","default":"on"},"nonpae":{},"acpi":{"toggle":"yes","default":"on"},"pae":{}},"emulator":"\/usr\/bin\/qemu"},"ppc":{"wordsize":"32","machines":["g3bw","mac99","prep"],"os_type":"hvm","emulator":"\/usr\/bin\/qemu-system-ppc"},"mips":{"wordsize":"32","machines":["mips"],"os_type":"hvm","emulator":"\/usr\/bin\/qemu-system-mips"},"x86_64":{"wordsize":"64","machines":["pc","isapc"],"os_type":"hvm","features":{"apic":{"toggle":"no","default":"on"},"acpi":{"toggle":"yes","default":"on"}},"emulator":"\/usr\/bin\/qemu-system-x86_64"},"sparc":{"wordsize":"32","machines":["sun4m"],"os_type":"hvm","emulator":"\/usr\/bin\/qemu-system-sparc"},"mipsel":{"wordsize":"32","machines":["mips"],"os_type":"hvm","emulator":"\/usr\/bin\/qemu-system-mipsel"}}}
"system_profile": [
{
"_versionInfo": {
"com.apple.SystemProfiler.SPPlatformReporter": "1291"
},
"_items": [
{
"MMM_entry": {
"MMM_state": "MMM_enabled"
},