Skip to content

Instantly share code, notes, and snippets.

View lukewpatterson's full-sized avatar

Luke Patterson lukewpatterson

View GitHub Profile
@lukewpatterson
lukewpatterson / gist:2362125
Created April 11, 2012 20:13
Vagrant error on 'up'
$ vagrant up
[default] Box redacted was not found. Fetching box from specified URL...
[vagrant] Downloading with Vagrant::Downloaders::HTTP...
[vagrant] Downloading box: http://www.redacted.com/ubuntu-11.10-server-i386.box
[vagrant] Extracting box...
[vagrant] Cleaning up downloaded box...
/Applications/Vagrant/embedded/gems/gems/archive-tar-minitar-0.5.2/lib/archive/tar/minitar.rb:493:in `read': undefined method `size' for nil:NilClass (NoMethodError)
from /Applications/Vagrant/embedded/gems/gems/archive-tar-minitar-0.5.2/lib/archive/tar/minitar.rb:740:in `block (2 levels) in extract_entry'
from /Applications/Vagrant/embedded/gems/gems/archive-tar-minitar-0.5.2/lib/archive/tar/minitar.rb:739:in `loop'
from /Applications/Vagrant/embedded/gems/gems/archive-tar-minitar-0.5.2/lib/archive/tar/minitar.rb:739:in `block in extract_entry'
@lukewpatterson
lukewpatterson / gist:2415533
Created April 18, 2012 18:14
Vagrant+Chef_Solo, download cookbooks from Vagrantfile, don't use this pattern though
# http://wiki.opscode.com/display/chef/Cookbook+Site+API
# think http://wiki.opscode.com/display/chef/Managing+Cookbooks+With+Knife#ManagingCookbooksWithKnife-install
def download_and_uncompress(name, version)
def download(file_url)
uri = URI(file_url)
tempfile = Tempfile.new(Random.rand(100).to_s())
Net::HTTP.start(uri.host, uri.port) do |http|
request = Net::HTTP::Get.new uri.request_uri
http.request request do |response|
open tempfile.path, 'w' do |io|
asdfasdfasdf
@lukewpatterson
lukewpatterson / shell dump
Created December 4, 2012 19:42
Verifying that VirtualBox actually ran
$ ls
README.md vagrant_1.0.5_i686.deb Vagrantfile
$ /opt/vagrant/bin/vagrant ssh --command "touch /vagrant/smash_it_with_a_hammer"
$ ls
README.md smash_it_with_a_hammer vagrant_1.0.5_i686.deb Vagrantfile
@lukewpatterson
lukewpatterson / Vagrantfile
Created December 4, 2012 20:53
Vagrantfile for Travis Ruby
Vagrant::Config.run do |config|
config.vm.box = "headed-travis-ruby-box"
config.vm.box_url = "http://files.travis-ci.org/boxes/provisioned/travis-ruby.box"
config.vm.network :hostonly, "192.168.33.10"
config.ssh.username = "travis"
end
@lukewpatterson
lukewpatterson / shell dump
Created December 4, 2012 21:15
Enable VNC-published virtual X session on that Travis box
$ sudo apt-get install x11vnc vnc-java xterm openbox
$ export DISPLAY=:99.0
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
$ openbox-session &
$ x11vnc -display :99 -httpdir /usr/share/vnc-java -httpport 5800 -loop &
@lukewpatterson
lukewpatterson / log output
Created December 4, 2012 21:22
Builds kept timing out
Starting a webserver :7122
Executing your script (veewee vbox build 'mybox' --auto --debug --nogui)
took longer than 25 minutes and was terminated.
For more information about the test timeouts please checkout the section
Build Timeouts at http://about.travis-ci.org/docs/user/build-configuration/.
Done. Build script exited with: 1
@lukewpatterson
lukewpatterson / .travis.yml
Created December 4, 2012 21:34
First attempt at local build
language: ruby
rvm:
- "1.9.3"
install:
- sudo echo "deb http://download.virtualbox.org/virtualbox/debian precise contrib" | sudo tee -a /etc/apt/sources.list
- wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
- sudo apt-get update
- sudo apt-get -y install linux-headers-$(uname -r)
- sudo apt-get -y install virtualbox-4.2
- VBoxManage -v
@lukewpatterson
lukewpatterson / VirtualBox C++ Code
Created December 4, 2012 21:48
VirtualBox Code
bool UIMessageCenter::warnAboutVirtNotEnabled64BitsGuest(bool fHWVirtExSupported)
{
...
else
return messageOkCancel(mainWindowShown(), Error,
tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
"Your 64-bit guest will fail to detect a 64-bit CPU and will "
"not be able to boot."),
0 /* pcszAutoConfirmId */,
tr("Close VM"), tr("Continue"));
@lukewpatterson
lukewpatterson / shell dump
Created December 4, 2012 22:37
Timeout fail
Starting a webserver :7122
Serving file /home/travis/builds/veewee-community/travis-veewee-up/definitions/mybox/preseed.cfg
Waiting for ssh login on 127.0.0.1 with user vagrant to sshd on port => 7222 to work, timeout=10000 sec
..............................................................................................................................................................................................................
Executing your script (veewee vbox build 'mybox' --auto --debug --nogui)
took longer than 25 minutes and was terminated.