Skip to content

Instantly share code, notes, and snippets.

[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
[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...
$ 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
<?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
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 ;)
@spidaman
spidaman / gist:2765569
Created May 22, 2012 00:05
VBoxManage hostonlyif create fails
~ $ mv Vagrantfile vm-workspace/
~ $ cd !$
cd vm-workspace/
~/vm-workspace $ vagrant up
[default] Importing base box 'api-v1.0'...
[default] Matching MAC address for NAT networking...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Creating shared folders metadata...
@spidaman
spidaman / service.py
Created February 16, 2013 19:42
python polymorphism w/class methods
class WtfException(Exception):
pass
class AdaptiveResponse(object):
def __init__(self, params, message):
self.params = params
self.message = message
def __repr__(self):
@spidaman
spidaman / timeouts_with_urllib2.py
Last active December 13, 2015 20:18
in 2013, urllib2 is pretty low level and anachronistic
hard_timelimit = 30
def fetch(url, timelimit=10)
old_timeout = socket.getdefaulttimeout()
if old_timeout == 0:
# we *never* want a hang-forever socket connections
old_timeout = hard_timelimit
socket.setdefaulttimeout(timelimit)
# do shit with urllib2 (build a request with Accept headers, deal transient error retries, etc)
# note that urlopen also takes a timeout param
@spidaman
spidaman / stacktraces.py
Created February 16, 2013 20:18
Logging stacktraces from python exceptions
import logging, sys, traceback
from stuff import DoStuff
try:
DoStuff.shit_can_happen()
except ShitHappens, e:
exc_type, exc_value, exc_traceback = sys.exc_info()
stacktrace = "".join(traceback.format_exception(exc_type, exc_value, exc_traceback))
logger.debug(stacktrace)