Skip to content

Instantly share code, notes, and snippets.

import scala.runtime.RichLong
def seconds = new RichLong(System.currentTimeMillis()/1000)
var now = seconds
var later = seconds
// error: value to is not a member of scala.runtime.RichLong
now to later
// UPDATE: this was caused by writing code against the 2.8 docs but running
// against 2.7.7 ! It would be nice if the docs mentioned which version a new
// method was introduced in ;)
<?xml version="1.0"?>
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.10-macosx">
<Machine uuid="{70347077-b7ca-4d2f-9e4a-3f8e48a020cf}" name="Ubuntu 10.04 Lucid Lynx Server amd64_1" OSType="Ubuntu_64" lastStateChange="2010-06-21T03:33:22Z">
<Hardware version="2">
<CPU count="1" hotplug="false">
<HardwareVirtEx enabled="true" exclusive="false"/>
<HardwareVirtExNestedPaging enabled="true"/>
<HardwareVirtExVPID enabled="true"/>
<PAE enabled="false"/>
</CPU>
/Library/Ruby/Gems/1.8/gems/virtualbox-0.7.3.dev/lib/virtualbox/abstract_model/version_matcher.rb:9:in `assert_version_match': Required version: 3.2; Current: (VirtualBox::Exceptions::UnsupportedVersionException)
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.7.3.dev/lib/virtualbox/abstract_model/relatable.rb:189:in `read_relationship'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.7.3.dev/lib/virtualbox/abstract_model/relatable.rb:146:in `nat_driver'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/ssh.rb:137:in `port'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/ssh.rb:136:in `each'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/ssh.rb:136:in `port'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/ssh.rb:38:in `connect'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/commands/ssh.rb:62:in `ssh_connect'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/comma
$ vagrant ssh
/Library/Ruby/Gems/1.8/gems/virtualbox-0.7.3.dev/lib/virtualbox/abstract_model/version_matcher.rb:28:in `split_version': private method `split' called for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.7.3.dev/lib/virtualbox/abstract_model/version_matcher.rb:18:in `version_match?'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.7.3.dev/lib/virtualbox/abstract_model/version_matcher.rb:7:in `assert_version_match'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.7.3.dev/lib/virtualbox/abstract_model/relatable.rb:189:in `read_relationship'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.7.3.dev/lib/virtualbox/abstract_model/relatable.rb:146:in `nat_driver'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/ssh.rb:137:in `port'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/ssh.rb:136:in `each'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/ssh.rb:136:in `port'
from /Librar
[default] Creating VM 'default'
[default] Importing base VM (/Users/ikallen/.vagrant/boxes/ubuntu10.04/box.ovf)...
[default] Persisting the VM UUID (01d258dc-7865-41b7-8566-6d5de86f12d9)...
[default] Matching MAC addresses...
[default] Deleting any previously set forwarded ports...
[default] Forwarding ports...
[default] Forwarding "ssh": 22 on adapter #1 => 2222
[default] Creating shared folders metadata...
[default] Booting VM...
[default] Waiting for VM to boot...
[default] Deleting any previously set forwarded ports...
/Library/Ruby/Gems/1.8/gems/virtualbox-0.7.1/lib/virtualbox/abstract_model/dirty.rb:172:in `method_missing': undefined method `nat_driver' for #<VirtualBox::NetworkAdapter:0x1dc10d0> (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/actions/vm/forward_ports.rb:117:in `clear_ports'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/actions/vm/forward_ports.rb:116:in `each'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/actions/vm/forward_ports.rb:116:in `clear_ports'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/actions/vm/forward_ports.rb:60:in `clear'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/actions/vm/forward_ports.rb:53:in `execute!'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/actions/runner.rb:85:in `send'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.4.2.dev/lib/vagrant/actions/runne
require 'rubygems'
require 'chef/node'
require 'chef/rest'
# set chef_server_url and node_name & get the path to key file
# look in ~/.chef/knife.rb
Chef::Config[:client_key] = "/path/to/key"
rest = Chef::REST.new(chef_server_url, node_name)
results = rest.get_rest("search/node?q=role:WEBSERVER_ROLE")
[Sat, 12 Jun 2010 04:00:05 +0000] INFO: Creating directory[/etc/sv/data_collection_server] at /etc/sv/data_collection_server
[Sat, 12 Jun 2010 04:00:05 +0000] INFO: Setting mode to 755 for directory[/etc/sv/data_collection_server]
[Sat, 12 Jun 2010 04:00:05 +0000] INFO: Creating directory[/etc/sv/data_collection_server/log] at /etc/sv/data_collection_server/log
[Sat, 12 Jun 2010 04:00:05 +0000] INFO: Setting mode to 755 for directory[/etc/sv/data_collection_server/log]
[Sat, 12 Jun 2010 04:00:05 +0000] INFO: Creating directory[/etc/sv/data_collection_server/log/main] at /etc/sv/data_collection_server/log/main
[Sat, 12 Jun 2010 04:00:05 +0000] INFO: Setting mode to 755 for directory[/etc/sv/data_collection_server/log/main]
[Sat, 12 Jun 2010 04:00:05 +0000] ERROR: template[/etc/sv/data_collection_server/run] (/usr/lib/ruby/gems/1.8/gems/chef-0.8.10/lib/chef/mixin/recipe_definition_dsl_core.rb line 56) had an error:
closed stream
/usr/lib/ruby/1.8/tempfile.rb:167:in `close'
/usr/lib/ruby/1.8/tempfile.rb:167:in `
Vagrant::Config.run do |config|
config.vm.box = "krux_dev_0_1"
config.chef.chef_server_url = "http://192.168.56.103:4000"
config.chef.validation_key_path = "validation.pem"
config.chef.run_list = [ "role[kitchen_sink]" ]
config.vm.provisioner = :chef_server
config.ssh.private_key_path=File.expand_path('~/.ssh/id_rsa-krux-dev-vbox')
config.vm.project_directory = "/krux"
end
using
config.vm.customize do |vm|
vm.network_adapters[1].mac_address = "08:00:27:35:33:58"
end
cloudmaster:djest ikallen$ vagrant up
[INFO 06-03-2010 12:19:59] Vagrant: Provisioning enabled with Vagrant::Provisioners::ChefSolo
[INFO 06-03-2010 12:19:59] Vagrant: Importing base VM (/Users/ikallen/.vagrant/boxes/krux_dev_vbox_0_1/box.ovf)...
[INFO 06-03-2010 12:21:15] Vagrant: Persisting the VM UUID (874407ab-e456-466b-a897-bd13d20433ed)...