Skip to content

Instantly share code, notes, and snippets.

View ingenthr's full-sized avatar

Matt Ingenthron ingenthr

View GitHub Profile
@ingenthr
ingenthr / GameSimDriver.java
Created April 12, 2011 18:58
Simple game simulator
/*
* This benchmark has been based on the FTP101 driver
*/
package com.couchbase.demo.gamesim;
import com.google.gson.Gson;
import com.sun.faban.driver.*;
import com.sun.faban.driver.util.Random;
import com.sun.faban.harness.EndRun;
import java.net.URISyntaxException;
@ingenthr
ingenthr / ketamaLocatorCheck.java
Created May 9, 2011 23:57
A quick check for a particular key with the KetamaLocator
package com.couchbase.mbinspector;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.ParseException;
import java.util.ArrayList;
@ingenthr
ingenthr / console.out
Created January 8, 2012 20:47
Proposed change from debian/compat 8 to debian/compat 7
jenkins@ip-10-204-203-56:~/workspace/libvbucket/label/ubuntu-x86-sdk-builder.couchbaseqe.com$ make dist-deb
{ test ! -d "libvbucket-1.7.2_13_gc422d4c" || { find "libvbucket-1.7.2_13_gc422d4c" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -fr "libvbucket-1.7.2_13_gc422d4c"; }; }
test -d "libvbucket-1.7.2_13_gc422d4c" || mkdir "libvbucket-1.7.2_13_gc422d4c"
test -n "" \
|| find "libvbucket-1.7.2_13_gc422d4c" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec /bin/bash /home/jenkins/workspace/libvbucket/label/ubuntu-x86-sdk-builder.couchbaseqe.com/config/install-sh -c -m a+r {} {} \; \
|| chmod -R a+r "libvbucket-1.7.2_13_gc422d4c"
@ingenthr
ingenthr / gist:1579869
Created January 8, 2012 22:01
build failure on couchbase-java-client
$ ant clean
Buildfile: /Users/ingenthr/src/couchbase-java-client/build.xml
clean:
BUILD SUCCESSFUL
Total time: 0 seconds
ingenthr-mbp:couchbase-java-client ingenthr$ ant test
Buildfile: /Users/ingenthr/src/couchbase-java-client/build.xml
@ingenthr
ingenthr / hellocouchbase.c
Created January 9, 2012 19:24
hello couchbase
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2012 Couchbase, Inc.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@ingenthr
ingenthr / gist:1612750
Created January 14, 2012 20:20
Accessing Couchbase 2.0 views
URI aserver = new URI("http://10.1.6.171:8091/pools/");
List<URI> servers = new ArrayList<URI>();
servers.add(aserver);
CouchbaseClient cbc = new CouchbaseClient(servers, "default", "");
System.err.println(cbc.get("MattIngenthron"));
View view = cbc.getView("$dev_testing", "atest");
Query myQuery = new Query();
myQuery.setRange("Bob", "N");
ViewFuture queryResultsFuture = cbc.query(view, myQuery);
ViewResponseWithDocs queryResults = queryResultsFuture.get();
@ingenthr
ingenthr / Makefile
Created January 21, 2012 00:17
Updating toolchain on CentOS
#
# This makefile set up all of the build dependencies we need for building
# the membase server on RedHat Linux
#
# For questions please contact trond@membase.com
#
# Copyright (c) 2010, Membase, Inc.
# All rights reserved.
#
# Set your path to /opt/local/bin:$PATH, then run make build-compile-env
@ingenthr
ingenthr / output
Created January 23, 2012 09:46
URL check
http://www.couchbase.com/agreement/community
HTTP/1.1 200 OK
http://www.couchbase.com/agreement/free-license
HTTP/1.1 200 OK
http://www.couchbase.com/agreement/services
HTTP/1.1 200 OK
http://www.couchbase.com/agreement/subscription
HTTP/1.1 200 OK
http://www.couchbase.com/case-studies/adaction
HTTP/1.1 200 OK
@ingenthr
ingenthr / example.java
Created February 7, 2012 23:56
turning off optimization with CouchbaseClient
List<URI> baselist = new ArrayList<URI>();
baselist.add(new URI("http://localhost:8091/pools"));
CouchbaseConnectionFactoryBuilder cfb = new CouchbaseConnectionFactoryBuilder();
cfb.setShouldOptimize(false);
CouchbaseClient myclient = new CouchbaseClient(cfb.buildCouchbaseConnection(baselist, "default", "default", ""));
@ingenthr
ingenthr / iqTimeout.java
Created February 8, 2012 01:12
example of capping input queue and blocking with timeout
List<URI> baselist = new ArrayList<URI>();
baselist.add(new URI("http://localhost:8091/pools"));
CouchbaseConnectionFactoryBuilder cfb = new CouchbaseConnectionFactoryBuilder();
cfb.setOpTimeout(10000); // wait up to 10 seconds for an operation to succeed
cfb.setOpQueueMaxBlockTime(5000); // wait up to 5 seconds when trying to enqueue an operation
CouchbaseClient myclient = new CouchbaseClient(cfb.buildCouchbaseConnection(baselist, "default", "default", ""));