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
use std::io::{Read, Write}; | |
use std::net::{TcpListener, TcpStream}; | |
use std::str; | |
use std::thread; | |
fn handle_client(mut stream: TcpStream) { | |
match stream.peer_addr() { | |
Err(_) => (), | |
Ok(pn) => println!("Received connection from: [{}]", pn), | |
} |
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
import argparse | |
import gevent | |
from gevent.subprocess import Popen | |
vbucket_count = 1024 | |
backup_script = "/opt/couchbase/bin/cbbackup" | |
parser = argparse.ArgumentParser(description="cbbackup wrapper to back up vbuckets in batches") | |
parser.add_argument('-b', action='store', dest='batch_size', type=int, |
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
import urllib2 | |
import json | |
import subprocess | |
import sys | |
def main(): | |
cluster_ip = sys.argv[1] | |
bucket = sys.argv[2] | |
bucket_map_url = "http://" + cluster_ip + \ |
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
{ | |
"name": "xyz_3", | |
"sdk_version": "n/a", | |
"cluster_id": "0095a9cfef8dc3ac1fe6de12affe5745", | |
"couchbase_version": "2.5.1-1083-rel-enterprise", | |
"node_count": "2 - Recommend at least 3 nodes", | |
"customer_id": "xyz", | |
"type": "cluster" | |
} |
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
{ | |
"Virtual Host": { | |
"status": "INFO", | |
"description": "Xen 3.4.3.amazon (preserve-AD)" | |
}, | |
"OS Name": { | |
"status": "INFO", | |
"description": "Linux 2.6.32-358.14.1.el6.x86_64" | |
}, | |
"Installed CPUs": { |
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
{ | |
"customer_contacts": "n/a", | |
"account_type": "n/a", | |
"name": "xyz", | |
"sales_rep": "[email protected]", | |
"note": "", | |
"customer_type": "customer", | |
"type": "customer", | |
"sla": "n/a" | |
} |
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
function (doc, meta) { | |
if (meta.type != "json") return; | |
var stringToUtf8Bytes = function (str) { | |
var utf8 = unescape(encodeURIComponent(str)); | |
var bytes = []; | |
for (var i = 0; i < str.length; ++i) { | |
bytes.push(str.charCodeAt(i)); | |
} |
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
import sys | |
import json | |
import random | |
import string | |
from couchbase import Couchbase | |
from couchbase import FMT_JSON | |
host = sys.argv[1] | |
bucket = sys.argv[2] |
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
-module(regis_server). | |
-behaviour(gen_server). | |
-include_lib("stdlib/include/ms_transform.hrl"). | |
-export([start_link/0, stop/0, register/2, unregister/1, whereis/1, | |
get_names/0, lookup/1]). | |
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, | |
code_change/3, terminate/2]). | |
start_link() -> |
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
-on_load(init/0). | |
-module(merger). | |
-on_load(init/0). | |
-export([ | |
new/0, new/1, new/2, | |
out/1, | |
in/3, | |
size/1, |