Skip to content

Instantly share code, notes, and snippets.

View ingenthr's full-sized avatar

Matt Ingenthron ingenthr

View GitHub Profile
@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 / 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: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 / 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 / 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 / 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;