Skip to content

Instantly share code, notes, and snippets.

james$ vagrant reload
[INFO 04-21-2010 14:45:54] Vagrant: Provisioning enabled with Vagrant::Provisioners::ChefSolo
[INFO 04-21-2010 14:45:54] Vagrant: Forcing shutdown of VM...
[INFO 04-21-2010 14:45:54] Vagrant: Running any VM customizations...
/Library/Ruby/Gems/1.8/gems/virtualbox-0.6.0/lib/virtualbox/com/implementer/ffi.rb:97:in `call_and_check': Error in API call to #<FFI::Function:0x1018d33b0>: 2159738887 (VirtualBox::Exceptions::InvalidObjectStateException)
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.6.0/lib/virtualbox/com/implementer/ffi.rb:71:in `call_vtbl_function'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.6.0/lib/virtualbox/com/implementer/ffi.rb:52:in `call_function'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.6.0/lib/virtualbox/com/abstract_interface.rb:132:in `call_function'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.6.0/lib/virtualbox/com/abstract_interface.rb:50:in `open_session'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.6.0/lib/virtualbo
@JamesPrudente
JamesPrudente / dwextract.rb
Created February 4, 2012 20:14
dashwire image extractor
#!/usr/bin/env ruby
require 'rubygems'
require 'work_queue'
require 'json'
require 'faraday'
require 'open-uri'
def download_image( uri, name )
File.open( name, 'wb' ) do | file |
@JamesPrudente
JamesPrudente / gist:5660184
Last active December 17, 2015 19:28
command line
MKV to MP4
ffmpeg -i input.mkv -vcodec copy -acodec copy output.mp4
copy file from vagrant
scp -P 2222 -i ~/.vagrant.d/insecure_private_key vagrant@127.0.0.1:/home/vagrant/hipache/docker.png .
parse json
@JamesPrudente
JamesPrudente / gist:5725349
Last active December 18, 2015 04:29
docker commands
create docker file in local directory with tag
docker build -t zero:v1 .
start detached container (Dockerfile specified cmd to run)
docker run -d -b /zero:/zero zero:v1
bind mount and start shell
using System;
using Microsoft.Win32;
public class GetDotNetVersion
{
public static void Main()
{
GetDotNetVersion.Get45PlusFromRegistry();
}
@JamesPrudente
JamesPrudente / greedyvoxelmeshing
Created February 10, 2021 01:31 — forked from Vercidium/greedyvoxelmeshing
Greedy Voxel Meshing ported to C#
// Code ported from https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/
// Note this implementation does not support different block types or block normals
// The original author describes how to do this here: https://0fps.net/2012/07/07/meshing-minecraft-part-2/
const int CHUNK_SIZE = 32;
// These variables store the location of the chunk in the world, e.g. (0,0,0), (32,0,0), (64,0,0)