Skip to content

Instantly share code, notes, and snippets.

View ingenthr's full-sized avatar

Matt Ingenthron ingenthr

View GitHub Profile
@aboron
aboron / add-lofs.txt
Created March 2, 2019 18:36
Adding lofs filesystems to smartos zones
When adding filesystems using json at initial creation, include:
"filesystems": [
{
"type": "lofs",
"source": "tank/Movies",
"target": "/Movies"
},
{
"type": "lofs",
"source": "tank/TV",
@daschl
daschl / BulkFetchExample.java
Last active March 29, 2017 09:36
Full Fetch travel-sample example
import com.couchbase.client.core.metrics.DefaultLatencyMetricsCollectorConfig;
import com.couchbase.client.core.metrics.LatencyMetricsCollectorConfig;
import com.couchbase.client.java.Bucket;
import com.couchbase.client.java.CouchbaseCluster;
import com.couchbase.client.java.document.JsonDocument;
import com.couchbase.client.java.document.json.JsonObject;
import com.couchbase.client.java.env.CouchbaseEnvironment;
import com.couchbase.client.java.env.DefaultCouchbaseEnvironment;
import com.couchbase.client.java.query.AsyncN1qlQueryResult;
import com.couchbase.client.java.query.AsyncN1qlQueryRow;
diff --git a/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java b/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java
index 3d0bc03..56a9641 100644
--- a/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java
+++ b/couchbase2/src/main/java/com/yahoo/ycsb/db/couchbase2/Couchbase2Client.java
@@ -633,10 +633,14 @@ public class Couchbase2Client extends DB {
@Override
public Observable<RawJsonDocument> call(AsyncN1qlQueryRow row) {
String id = new String(row.byteValue());
- return bucket.async().get(
- id.substring(id.indexOf(table + SEPARATOR), id.lastIndexOf('"')),
@almereyda
almereyda / falsehoods.md
Created April 14, 2016 15:11 — forked from wboykinm/falsehoods.md
Falsehoods programmers believe about addresses

Falsehoods programmers believe about addresses

This is an anchor-linked version of the excellent, amazing original opus magnum by Michael Tandy.

An address will start with, or at least include, a building number.

Counterexample: Royal Opera House, Covent Garden, London, WC2E 9DD, United Kingdom.

When there is a building number, it will be all-numeric.

Counterexample: 1A Egmont Road, Middlesbrough, TS4 2HT

@brett19
brett19 / _README.md
Last active September 25, 2015 13:36

This is a listing of various examples used for the Couchbase Go SDK GA Release Blog.

Blog Post

package org.couchbase.couchswitching;
import com.couchbase.client.core.BackpressureException;
import com.couchbase.client.core.RequestCancelledException;
import com.couchbase.client.deps.com.fasterxml.jackson.databind.JsonNode;
import com.couchbase.client.deps.com.fasterxml.jackson.databind.ObjectMapper;
import com.couchbase.client.java.AsyncBucket;
import com.couchbase.client.java.CouchbaseCluster;
import com.couchbase.client.java.document.RawJsonDocument;
import com.couchbase.client.java.error.TemporaryFailureException;
@bcantrill
bcantrill / dtrace-on-rust
Last active May 29, 2023 07:37
DTrace on Rust. This shows running dtrace(1M) on a simple Rust program. Rust is running in a 64-bit LX-branded zone on SmartOS, an illumos derivative. Running stock (alpha) Rust and latest SmartOS.
root@1eec2cd3-2cba-e416-e1b6-845b715b736c:~# uname -a
Linux 1eec2cd3-2cba-e416-e1b6-845b715b736c 3.13.0 BrandZ virtual linux x86_64 x86_64 x86_64 GNU/Linux
root@1eec2cd3-2cba-e416-e1b6-845b715b736c:~# rustc -Vv
rustc 1.0.0-nightly (44a287e6e 2015-01-08 17:03:40 -0800)
binary: rustc
commit-hash: 44a287e6eb22ec3c2a687fc156813577464017f7
commit-date: 2015-01-08 17:03:40 -0800
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly
root@1eec2cd3-2cba-e416-e1b6-845b715b736c:~# cat hello.rs
@bsodmike
bsodmike / mongodb.md
Last active April 22, 2019 20:13
'Scaling 100GB of Data', posted on MongoDB

I managed to recover this post by checking Google's cached copy as it was randomly taken down; Enjoy!

Surpassing 100GB of data in your application requires you to have in-depth knowledge of how to operate and run MongoDB. MongoHQ recommends going through the 100GB Scaling Checklist as you grow. Watch the webinar recording on the subject for the full overview:

  • Identify your data behavior: Figure out how your data patterns and how they are working within your application. You will need to link your data to how your application accesses this data. Consider the simple queries and the more complex queries you will need to look up, like multi-range queries.
  • Refactor your schema to simplify queries
  • Remove data that does not fit MongoDB: remove “unrefactorable” data
  • Separate hot and cold data
  • Don’t lean on mongodump’: this disrupts RAM and c
@apage43
apage43 / DumpDB.java
Last active December 21, 2015 21:29
package dumper;
import com.couchbase.client.TapClient;
import net.spy.memcached.tapmessage.ResponseMessage;
import java.net.URI;
import java.util.ArrayList;
import java.util.zip.InflaterOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.ByteArrayInputStream;
@daschl
daschl / gist:5748526
Last active December 18, 2015 07:39
// MAin Code
public static void main(final String[] args) throws Exception {
// Load Configuration
ApplicationContext context =
new AnnotationConfigApplicationContext(ApplicationConfig.class);
// Load Repository
BlogPostRepository repo = context.getBean("blogPostService", BlogPostService.class).repository;
// Store 2 Blog Posts