Skip to content

Instantly share code, notes, and snippets.

View lukewpatterson's full-sized avatar

Luke Patterson lukewpatterson

View GitHub Profile
@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 / 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 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
asdfasdfasdf
@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|
@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'