This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import httplib | |
import json | |
from datetime import datetime, date, time | |
from time import sleep | |
import os.path | |
from multiprocessing import Process | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Christians-MacBook-Air:nyc_traffic_accidents acd$ vagrant up | |
Bringing machine 'default' up with 'virtualbox' provider... | |
==> default: Box 'puppetlabs/ubuntu-14.04-64-puppet' could not be found. Attempting to find and install... | |
default: Box Provider: virtualbox | |
default: Box Version: >= 0 | |
==> default: Loading metadata for box 'puppetlabs/ubuntu-14.04-64-puppet' | |
default: URL: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-puppet | |
==> default: Adding box 'puppetlabs/ubuntu-14.04-64-puppet' (v0.3.0) for provider: virtualbox | |
default: Downloading: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-puppet/version/3/provider/virtualbox.box | |
==> default: Successfully added box 'puppetlabs/ubuntu-14.04-64-puppet' (v0.3.0) for 'virtualbox'! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add mapping | |
curl -XPUT localhost:9200/restaurants -d '{ | |
"mappings": { | |
"areas": { | |
"properties": { | |
"name": { | |
"type": "string" | |
}, | |
"area": { | |
"type": "string" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var fs = require('fs'); | |
var optimist = require('optimist') | |
.usage('Simple web server to log incoming requests.\n\nUsage: $0 [options]') | |
.options({ | |
file: { | |
alias: 'f', | |
describe: 'Path of file to log to. Server will log to stdout if no file specified.' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPOST http://localhost:9200/test/test -d'{ | |
"title": "one", | |
"total": 10 | |
}' | |
curl -XPOST http://localhost:9200/test/test -d'{ | |
"title": "one", | |
"total": 10 | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% ------------------------------------------------------------------- | |
%% | |
%% keylister: Utility for listing all keys in a bucket | |
%% | |
%% Copyright (c) 2013 Basho Technologies, Inc. All Rights Reserved. | |
%% | |
%% This file is provided to you under the Apache License, | |
%% Version 2.0 (the "License"); you may not use this file | |
%% except in compliance with the License. You may obtain | |
%% a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% ------------------------------------------------------------------- | |
%% | |
%% riak_graphite: Server process to emit statistics to Graphite | |
%% | |
%% Copyright (c) 2013 Basho Technologies, Inc. All Rights Reserved. | |
%% | |
%% This file is provided to you under the Apache License, | |
%% Version 2.0 (the "License"); you may not use this file | |
%% except in compliance with the License. You may obtain | |
%% a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PBStatusFun = fun() -> | |
VnodePids = [Pid || {_, Pid} <- riak_core_vnode_manager:all_index_pid(riak_kv_vnode)], | |
Links = [process_info(Pid, [links]) || Pid <- VnodePids], | |
WorkerPoolPids = [WPPid || [{links,[_, WPPid]}] <- Links], | |
WorkerPoolLinks = [process_info(Pid, [links]) || Pid <- WorkerPoolPids], | |
PoolboyPids = [PoolboyPid || [{links,[_, PoolboyPid]}] <- WorkerPoolLinks], | |
[poolboy:status(Pid) || Pid <- PoolboyPids] | |
end. | |
PBStatusCountFun = fun() -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% ------------------------------------------------------------------- | |
%% | |
%% pb_status_monitor: PoolBoy pool monitor | |
%% | |
%% Copyright (c) 2013 Basho Technologies, Inc. All Rights Reserved. | |
%% | |
%% This file is provided to you under the Apache License, | |
%% Version 2.0 (the "License"); you may not use this file | |
%% except in compliance with the License. You may obtain | |
%% a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env escript | |
%% -*- erlang -*- | |
-include_lib("kernel/include/file.hrl"). | |
-compile(export_all). | |
-define(LOG(S), io:format(S)). | |
-define(LOG(S,A), io:format(S,A)). | |
main(Dirs) -> | |
CodePath = case os:getenv("RIAK_LIB") of |
OlderNewer