Skip to content

Instantly share code, notes, and snippets.

View russelldb's full-sized avatar

Russell Brown russelldb

View GitHub Profile
@russelldb
russelldb / gist:3197222
Created July 29, 2012 10:07 — forked from danparsons/gist:3195652
How to stream the London 2012 Olympics

How to stream the London 2012 Olympics

There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.

on the guest SmartOS VM

pkg_add http://pkgsrc.joyent.com/sdc6/2012Q1/i386/All/smtools
# note this is going to shut down the VM
sm-prepare-image

on the global zone

@russelldb
russelldb / gist:3072756
Created July 8, 2012 21:01 — forked from mpereira/gist:3072187
A little help to stop unconsciously checking distracting web sites.
alias focus="sudo sh -c \"echo '127.0.0.1 www.facebook.com twitter.com mail.google.com # aab6de513ab5de9359809f3cdb62d352' >> /etc/hosts\""
alias unfocus='sudo sed -i "/aab6de513ab5de9359809f3cdb62d352/d" /etc/hosts'
@russelldb
russelldb / clojure.md
Created April 15, 2012 19:58
Setting Up Clojure on OS X

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

Step 1: Getting Clojure (1.3)

@russelldb
russelldb / dieinafirelyzer
Created March 22, 2012 14:48
Dialyer no like
riak_core_stat.erl:35: Type specification riak_core_stat:stat_specs() -> riak_core_metric:stat_specs() is not equal to the success typing: riak_core_stat:stat_specs() -> [{'converge_delay' | 'gossip_received' | 'ignored_gossip_total' | 'rebalance_delay' | 'rejected_handoffs' | 'rings_reconciled' | 'rings_reconciled_total',[{_,_},...]},...]
@russelldb
russelldb / addindex.java
Created March 20, 2012 14:58
add index
final Bucket b = client.fetchBucket(bucketName).execute();
// create objects with indexes
IRiakObject o1 = RiakObjectBuilder.newBuilder(bucketName, "k1").withValue("some data")
.addIndex("twitter", "russelldb").addIndex("age", 38).build();
// store them
b.store(o1).execute();
// fetch by index
@russelldb
russelldb / SearchMapReduce
Created March 14, 2012 07:34
MapReduce with the RawClient
RawClient c = PBRiakClientFactory.getInstance().newClient(PBClientConfig.defaults());
MapReduceResult r = new SearchMapReduce(c, SEARCH_BUCKET_NAME, "foo:zero")
.addMapPhase(new NamedJSFunction("Riak.mapValuesJson"))
.addReducePhase(new NamedErlangFunction("riak_kv_mapreduce", "reduce_sort"))
.execute();
%% The IRiakClient impl is just a factory that returns a MapReduce subclass initialised with a RawClient
%% You can therefore create an IndexMapReduce (or whatever) using you configured RawClient.
@russelldb
russelldb / rvm :(
Created February 3, 2012 14:27
oh noes
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
---- End output of bash -c "bash <( curl -Ls https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )"
----
Ran bash -c "bash <( curl -Ls https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )"
returned 60
/opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell_out.rb:207:in `invalid!'
/opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/shell_out.rb:193:in `error!'
/opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/mixin/shell_out.rb:36:in `shell_out!'
@russelldb
russelldb / gs.puke
Created February 2, 2012 20:39
vagrant puke
/home/russell/.rvm/gems/ruby-1.8.7-p357/gems/vagrant-0.9.4/lib/vagrant/config/top.rb:29:in `method_missing': undefined method `guttersnipe' for #<Vagrant::Config::Top:0x7f9ceb727218> (NoMethodError)
from /home/russell/GutterSnipe/vagrant/Vagrantfile:9
from /home/russell/.rvm/gems/ruby-1.8.7-p357/gems/vagrant-0.9.4/lib/vagrant/config/loader.rb:83:in `call'
from /home/russell/.rvm/gems/ruby-1.8.7-p357/gems/vagrant-0.9.4/lib/vagrant/config/loader.rb:83:in `load'
from /home/russell/.rvm/gems/ruby-1.8.7-p357/gems/vagrant-0.9.4/lib/vagrant/config/loader.rb:79:in `each'
from /home/russell/.rvm/gems/ruby-1.8.7-p357/gems/vagrant-0.9.4/lib/vagrant/config/loader.rb:79:in `load'
from /home/russell/.rvm/gems/ruby-1.8.7-p357/gems/vagrant-0.9.4/lib/vagrant/config/loader.rb:76:in `each'
from /home/russell/.rvm/gems/ruby-1.8.7-p357/gems/vagrant-0.9.4/lib/vagrant/config/loader.rb:76:in `load'
from /home/russell/.rvm/gems/ruby-1.8.7-p357/gems/vagrant-0.9.4/lib/vagrant/environment.rb:376:in `load_config!'
from /home/rus
@russelldb
russelldb / element_fieldset.erl
Created February 1, 2012 08:08
Fieldset element
-module (element_fieldset).
-include_lib("nitrogen/include/wf.inc").
-include("elements.hrl").
-compile(export_all).
reflect() -> record_info(fields, fieldset).
render(ControlID, Record) ->
Content = wf:render(Record#fieldset.body),