Skip to content

Instantly share code, notes, and snippets.

@drewkerrigan
drewkerrigan / README.md
Last active June 6, 2021 05:41
Setting open files limit in OSX 10.11.3

Download this gist, and then run:

chmod 755 open_files_limit_mac.sh
./open_files_limit_mac.sh

Restart the system, and then run:

sudo yum install libprotobuf-dev protobuf-compiler
sudo yum install protobuf-devel
sudo yum install gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel git
sudo yum install pam-devel
curl -O https://raw.githubusercontent.com/spawngrid/kerl/master/kerl
chmod a+x kerl
CFLAGS="-DOPENSSL_NO_EC=1" kerl build git git://github.com/basho/otp.git OTP_R16B02_basho8 R16B02-basho8
CFLAGS="-DOPENSSL_NO_EC=1" kerl install R16B02-basho8 ~/erlang/R16B02-basho8
. ~/erlang/R16B02-basho8/activate
@drewkerrigan
drewkerrigan / Vagrantfile
Last active December 22, 2015 16:08
Vagrant + Mesos 0.26 + Erlang R16B02 + Marathon + ZK + Mesos-DNS
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Install these plugins
# vagrant plugin install vagrant-hostmanager
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#Setup hostmanager config to update the host files
config.hostmanager.enabled = true

Install Erlang R16B02-basho8 on Mac

Download kerl and create ~/.kerlrc

mkdir -p ~/bin && cd ~/bin
curl -O https://raw.githubusercontent.com/spawngrid/kerl/master/kerl
chmod a+x kerl
touch ~/.kerlrc
export PATH=$HOME/bin:$PATH
@drewkerrigan
drewkerrigan / README.md
Last active September 17, 2015 20:52
Compile relocatable release on Ubuntu

Instructions

sudo su ubuntu
sudo -s
apt-get install -y git
git clone https://gist.github.com/94d82c2ac08dfcad488e.git riak_relocatable
cd riak_relocatable
chmod 755 build.sh
./build.sh
@drewkerrigan
drewkerrigan / http_search.config
Last active August 29, 2015 14:21
Basho Bench Riak Search Examples
{mode, max}.
{duration, 1}.
{concurrent, 1}.
{driver, basho_bench_driver_http}.
{key_generator, {int_to_str, {uniform_int, 50000}}}.
{value_generator, {fixed_bin, 10000}}.
@drewkerrigan
drewkerrigan / inserts.config
Last active August 29, 2015 14:18
Index Benchmarking
% curl -i -XPUT http://localhost:8098/search/index/my_index
% riak-admin bucket-type create maps '{"props":{"search_index":"my_index","datatype":"map"}}'
% riak-admin bucket-type activate maps
{mode, max}.
{duration, 1}.
{concurrent, 1}.
@drewkerrigan
drewkerrigan / add_data.sh
Created April 2, 2015 03:56
Geospatial query example with Solr
curl -XPOST http://localhost:8098/types/location_type/buckets/people/datatypes/person1 \
-H "Content-Type: application/json" \
-d '
{
"update": { "username_register": "user1", "city_register": "Denver", "state_register": "NY", "position_register": "42.27,-74.53" }
}'
curl -XPOST http://localhost:8098/types/location_type/buckets/people/datatypes/person2 \
-H "Content-Type: application/json" \
-d '
@drewkerrigan
drewkerrigan / sg.preload.config
Created November 24, 2014 19:41
Sample config which creates a complex nested map Riak Datatype that can be indexed using Riak Search
{mode, max}.
% Setup:
% curl -i -XPUT http://localhost:8098/search/index/my_index
% riak-admin bucket-type create maps '{"props":{"search_index":"my_index","datatype":"map"}}'
% riak-admin bucket-type activate maps
{duration, 1}.
{concurrent, 1}.
@drewkerrigan
drewkerrigan / riakpbc.md
Last active February 6, 2018 13:19
A few snippets describing how to use the riakpbc node.js library

Put

var riakObj = {mykey1: "myvalue1"};

var data    = {
    key: 'my_key',
    bucket: 'my_bucket', 
    type: 'my_bucket_type',
    content = {