Skip to content

Instantly share code, notes, and snippets.

View rtgibbons's full-sized avatar

Ryan Gibbons rtgibbons

View GitHub Profile
@rtgibbons
rtgibbons / definition.rb
Created January 25, 2012 02:30 — forked from nemonik/definition.rb
My CentOS-5.7-x86_64 Basebox Template
Veewee::Session.declare({
:cpu_count => '1', :memory_size=> '384',
:disk_size => '10140', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on',
:os_type_id => 'RedHat_64',
:iso_file => "CentOS-5.7-x86_64-bin-DVD-1of2.iso",
:iso_src => "http://mirror.steadfast.net/centos/5.7/isos/x86_64/CentOS-5.7-x86_64-bin-DVD-1of2.iso",
:iso_md5 => "55eadec0a6e87c5f2883f734d43fdb58",
:iso_download_timeout => 1000,
:boot_wait => "10", :boot_cmd_sequence => [ 'linux text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
:kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
@rtgibbons
rtgibbons / gist:1449072
Created December 8, 2011 22:50
Vagrant errors
/Users/ryangs/.rvm/gems/ruby-1.9.2-p290@global/gems/virtualbox-0.9.2/lib/virtualbox/com/implementer/ffi.rb:106:in `call_and_check': Error in API call to get_network_adapter: 2147942487 (VirtualBox::Exceptions::InvalidArgException)
from /Users/ryangs/.rvm/gems/ruby-1.9.2-p290@global/gems/virtualbox-0.9.2/lib/virtualbox/com/implementer/ffi.rb:80:in `call_vtbl_function'
from /Users/ryangs/.rvm/gems/ruby-1.9.2-p290@global/gems/virtualbox-0.9.2/lib/virtualbox/com/implementer/ffi.rb:61:in `call_function'
from /Users/ryangs/.rvm/gems/ruby-1.9.2-p290@global/gems/virtualbox-0.9.2/lib/virtualbox/com/abstract_interface.rb:145:in `call_function'
from /Users/ryangs/.rvm/gems/ruby-1.9.2-p290@global/gems/virtualbox-0.9.2/lib/virtualbox/com/abstract_interface.rb:62:in `block in function'
from /Users/ryangs/.rvm/gems/ruby-1.9.2-p290@global/gems/virtualbox-0.9.2/lib/virtualbox/network_adapter.rb:79:in `block in populate_relationship'
from /Users/ryangs/.rvm/gems/ruby-1.9.2-p290@global/gems/virtualbox-0.9.2/lib/virtualbox
@rtgibbons
rtgibbons / gist:1436846
Created December 6, 2011 05:09
Google's new toolbar
document.cookie="PREF=ID=03fd476a699d6487:U=88e8716486ff1e5d:FF=0:LD=en:CR=2:TM=1322688084:LM=1322688085:S=McEsyvcXKMiVfGds; path=/; domain=.google.com";window.location.reload();
@rtgibbons
rtgibbons / mvim
Created November 23, 2011 20:41
mvim for vim-coca
#!/bin/sh
#
# This shell script passes all its arguments to the binary inside the
# MacVim.app application bundle. If you make links to this script as view,
# gvim, etc., then it will peek at the name used to call it and set options
# appropriately.
#
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico
# Weber and Bjorn Winckler, Aug 13 2007).
@rtgibbons
rtgibbons / mms-agent.sh
Created November 23, 2011 19:24
Centos init.d for mms-agent from 10Gen
#!/bin/bash
#
# /etc/rc.d/init.d/mms-agent
#
# 10Gen Mongod montiroing service
# must edit the settings.py first and edit this file with the location of agent.py
#
# description: 10Gen monitoring service - need ot fix pid so we can shut it down
# chkconfig: - 90 10
@rtgibbons
rtgibbons / macvim.rb
Created September 17, 2011 01:44
Alloy's MacVim (File Browser)
require 'formula'
class Macvim < Formula
homepage 'http://code.google.com/p/macvim/'
version '7.3-61'
head 'https://github.com/alloy/macvim.git', :branch => 'split-browser'
def options
[
# Building custom icons fails for many users, so off by default.
@rtgibbons
rtgibbons / paulify.href
Created June 3, 2011 03:12
pualify bookmarklet
javascript:(function(){var d=document,j=d.getElementById('__paulify_nodes'),k=null;var files=['https://github.com/rtgibbons/Paulify/raw/master/js/paulify.js','https://github.com/rtgibbons/Paulify/raw/master/js/paulify_run.js'];if(j){paulify_add();}else{k=d.createElement('div');k.id='__paulify_nodes';d.getElementsByTagName('body')[0].appendChild(k);for(var l=0;l<files.length;l++){j=d.createElement('script');j.src=files[l];k.appendChild(j);}}})();
@rtgibbons
rtgibbons / paulify.php
Created June 3, 2011 02:25
download random image
<?php
$files = array();
$path = 'i/s/';
if ( $dir = opendir( $path ) ) {
while ( false !== ( $file = readdir( $dir ) ) ){
switch( mime_content_type( $path.$file ) ) {
case 'image/jpeg':
case 'image/jpg':
@rtgibbons
rtgibbons / phparray.php
Created June 1, 2011 05:36
Simple assocaitive array
<?php
var $contactTimeOptions = array(
'morning' => 'morning',
'afternoon' => 'afternoon',
'evening' => 'evening'
);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Twitter</title>
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="jquery.tweet.js"></script>
<script type="text/javascript" src="jquery.li-scroller.js"></script>
<script>