Install Erlang R16B02 using kerl
curl -O https://raw.github.com/spawngrid/kerl/master/kerl; chmod a+x kerl
Create ~/.kerlrc
basho-samurai:riak andrewkerrigan$ dd if=/dev/zero of=/tmp/output bs=25k count=1k | |
1024+0 records in | |
1024+0 records out | |
26214400 bytes transferred in 0.043722 secs (599567916 bytes/sec) | |
basho-samurai:riak andrewkerrigan$ for i in {1..10}; do time curl -X PUT localhost:8098/riak/foo/a --data-binary @/tmp/output > foo; done | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 25.0M 0 0 100 25.0M 0 54.7M --:--:-- --:--:-- --:--:-- 54.8M | |
real 0m0.479s |
You can install different Erlang versions in a simple manner with the kerl script. This is probably the easiest way to install Erlang from source on a system, and typically only requires a few commands to do so. Install kerl by running the following command:
curl -O https://raw.github.com/spawngrid/kerl/master/kerl; chmod a+x kerl
To compile Erlang as 64-bit on Mac OS X, you need to instruct kerl to pass the correct flags to the configure command. The easiest way to do this is by creating a ~/.kerlrc file with the following contents:
KERL_CONFIGURE_OPTIONS="--disable-hipe --enable-smp-support --enable-threads
;;;; .emacs Customizations, Functions, and Packages | |
;;; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
;;; Packages and Initialization | |
;;; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
(require 'package) | |
;; Add the original Emacs Lisp Package Archive | |
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/")) |
;;;; .emacs Customizations, Functions, and Packages | |
;;; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
;;; Packages and Initialization | |
;;; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
;;; Color Theme (http://download.savannah.gnu.org/releases/color-theme/) | |
(add-to-list 'load-path "~/.emacs.d/packages/color-theme/") | |
(require 'color-theme) | |
(color-theme-initialize) |
####Converts JSON of the format
[
{
"target": "target1",
"datapoints": [
[val1,timestamp1],
...
[valN,timestampN]]
Download and build
wget https://github.com/basho/riak/archive/riak-2.0.0pre2.tar.gz
tar -zxvf riak-2.0.0pre2.tar.gz
cd riak-riak-2.0.0pre2
make rel
cd rel/riak
gimme_a_client_from(Context) when Context#ctx.client == undefined -> | |
{ok, Client} = riakc_pb_socket:start_link(?RIAK_NAME, ?RIAK_PB_PORT)}, | |
Context#ctx{client = Client}; | |
gimme_a_client_from(Context) -> Context. |
def fetch_with_pagination(keys, start = 1, count = 50) | |
zombies = [] | |
keys = [] unless keys | |
result_count = 1 | |
keys.each_with_index do |zombie_key, i| | |
break if result_count > count | |
next if (i + 1) < start | |
data = @client['zombies'].get(zombie_key).data |
get '/query/zip3/:zip' do | |
zip = params[:zip] | |
zip3 = zip[0, 3] | |
zips = zip3_idx.get_index(zip3) | |
results = zips.members.to_a | |
if zip.length > 3 | |
results = results.select { |item| item.start_with? zip } |