Skip to content

Instantly share code, notes, and snippets.

View NTCoding's full-sized avatar

Nick Tune NTCoding

View GitHub Profile
@NTCoding
NTCoding / gist:4184996
Created December 1, 2012 20:52
raven_query
public class Get
{
private readonly IDocumentSession session;
private readonly ISecurityContext security;
public Get(IDocumentSession session, ISecurityContext security)
{
this.session = session;
this.security = security;
}
@NTCoding
NTCoding / gist:4185003
Created December 1, 2012 20:53
raven_config
private static IDocumentStore GetStore()
{
var environment = ConfigurationManager.AppSettings["Environment"];
if (environment == "Azure")
{
return new DocumentStore
{
ConnectionStringName = "RavenDB",
ApiKey = ConfigurationManager.AppSettings["RavenApiKey"],
@NTCoding
NTCoding / gist:5150286
Last active December 14, 2015 21:19
riak_makefile_extract
compile:
./rebar compile
deps:
./rebar get-deps
generate:
./rebar generate
rel: deps compile generate riaknostic-rel
@NTCoding
NTCoding / gist:5150597
Created March 13, 2013 09:40
riak reltoool
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
{sys, [
{lib_dirs, ["../deps", "../deps/riak_search/apps"]},
{rel, "riak", "1.3.0rc2",
[
@NTCoding
NTCoding / gist:5150616
Created March 13, 2013 09:43
riak_reltool_overlays
{overlay_vars, "vars.config"}.
{overlay, [
{mkdir, "data/ring"},
{mkdir, "log"},
{copy, "files/erl", "{{erts_vsn}}/bin/erl"},
{template, "files/app.config", "etc/app.config"},
{template, "files/nodetool", "{{erts_vsn}}/bin/nodetool"},
{template, "files/riak", "bin/riak"},
{template, "files/riak-admin", "bin/riak-admin"},
@NTCoding
NTCoding / gist:5150677
Created March 13, 2013 09:55
riak_start_erlexec
CMD="$BINDIR/erlexec -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$SCRIPT \
-embedded -config $RUNNER_ETC_DIR/app.config \
-pa $RUNNER_LIB_DIR/basho-patches \
-args_file $RUNNER_ETC_DIR/vm.args -- ${1+"$@"}"
@NTCoding
NTCoding / gist:5150701
Created March 13, 2013 09:59
nodetool_definition
# Setup command to control the node
NODETOOL="$ERTS_PATH/escript $ERTS_PATH/nodetool $NAME_ARG $COOKIE_ARG"
....
$NODETOOL rpc riak_kv_console status $@
@NTCoding
NTCoding / gist:5150712
Created March 13, 2013 10:01
nodetool_extract
["rpc", Module, Function | RpcArgs] ->
case rpc:call(TargetNode, list_to_atom(Module), list_to_atom(Function),
[RpcArgs], 60000) of
ok ->
ok;
{badrpc, Reason} ->
io:format("RPC to ~p failed: ~p\n", [TargetNode, Reason]),
halt(1);
_ ->
halt(1)
@NTCoding
NTCoding / gist:5229174
Created March 23, 2013 20:08
riak_rel_script
{release,{"riak","1.3.0rc2"},
{erts,"5.9.1"},
[{kernel,"2.15.1"},
{lager,"1.2.1"},
{sasl,"2.2.1"},
{os_mon,"2.2.9"},
{runtime_tools,"1.8.8"},
{erlang_js,"1.2.1"},
{inets,"5.9"},
{mochiweb,"1.5.1"},
@NTCoding
NTCoding / gist:5229196
Created March 23, 2013 20:16
riak_core_app
-module(riak_core_app).
-behaviour(application).
%% Application callbacks
-export([start/2, prep_stop/1, stop/1]).
%% ===================================================================
%% Application callbacks
%% ===================================================================