Skip to content

Instantly share code, notes, and snippets.

1556
421190 10.22.128.29:52541 -> 10.22.64.26:11210 SYN
421191 10.22.64.26:11210 -> 10.22.128.29:52541 SYN, ACK
421192 10.22.128.29:52541 -> 10.22.64.26:11210 ACK
421193 10.22.128.29:52541 -> 10.22.64.26:11210 PSH, ACK
421194 10.22.64.26:11210 -> 10.22.128.29:52541 ACK
518476 10.22.64.26:11210 -> 10.22.128.29:52541 PSH, ACK
519297 10.22.128.29:52541 -> 10.22.64.26:11210 ACK
569494 10.22.128.29:52541 -> 10.22.64.26:11210 RST, ACK
Fields are:
1) Number of frames since previous RST packet seen
2) Frame number
3) Is this an ACK (1 == 0x014 RST, ACK; 0 == 0x004 RST)
4) Source IP:Port
5) Destination IP:Port
334643 334644 1 10.22.128.29:45814 -> 10.22.64.26:8091
10 334655 1 10.22.128.29:45900 -> 10.22.64.26:8091
10 334666 1 10.22.128.29:46016 -> 10.22.64.26:8091
@couchtim
couchtim / SimpleAppend.java
Created October 3, 2012 07:12
simple stand-alone append test
import net.spy.memcached.*;
import net.spy.memcached.ConnectionFactoryBuilder.Protocol;
import net.spy.memcached.auth.AuthDescriptor;
import net.spy.memcached.auth.PlainCallbackHandler;
import net.spy.memcached.internal.OperationFuture;
import net.spy.memcached.ops.OperationStatus;
public class SimpleAppend {
public static Boolean checkOp(String tag, OperationFuture result) {
System.err.print(tag + ": ");
@couchtim
couchtim / gist:3822134
Created October 2, 2012 18:34
simple libcouchbase example
#include <sys/types.h>
#include <libcouchbase/couchbase.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define DIE(msg) do { fprintf(stderr, "%s:%d: Fatal error: %s\n", __FILE__, __LINE__, (msg)); exit(1); } while (0)
@couchtim
couchtim / pipe-to-loop.sh
Created September 30, 2012 04:36
Demo of bash/dash subshell when pipe to loop construct
[root@localhost couchbase-stuff]# cat tmp.sh
#! /bin/sh
count=0
/bin/ls /etc | while read f; do
count=$((count + 1));
echo $count $f;
done
# This prints 0 in bash and dash; prints count (e.g., 262) in ksh
@couchtim
couchtim / gist:3375697
Created August 17, 2012 03:32
Couchbase View query w/ Java: how to quote startkey?
/*
export CLASSPATH
CLASSPATH=`echo 1.1/*.jar | tr \ :`:
javac CouchbaseView/App.java
java CouchbaseView.App
*/
package CouchbaseView;
import com.couchbase.client.CouchbaseClient;
@couchtim
couchtim / gist:3372689
Created August 16, 2012 19:04
Java Couchbase: Found 81 docs. This view result doesn't contain documents
/* When I run this, I get:
[root@localhost java]# java CouchbaseView.App
2012-08-16 11:09:29.316 INFO com.couchbase.client.CouchbaseConnection: Added {QA sa=/10.4.2.13:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2012-08-16 11:09:29.380 INFO com.couchbase.client.CouchbaseClient: viewmode property isn't defined. Setting viewmode to production mode
2012-08-16 11:09:29.383 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@377653ae
2012-08-16 11:09:29.426 INFO net.spy.memcached.auth.AuthThread: Authenticated to 10.4.2.13/10.4.2.13:11210
2012-08-16 11:09:29.495 INFO com.couchbase.client.ViewConnection: Added 10.4.2.13/10.4.2.13:8092 to connect queue
2012-08-16 11:09:29.926 INFO com.couchbase.client.http.AsyncConnectionManager: Opening new CouchDB connection
2012-08-16 11:09:29.933 INFO com.couchbase.client.http.AsyncConnectionManager$ConnRequestCallback: /10.4.2.13:8092 - Session request successful
@couchtim
couchtim / StoreHandler.java
Created April 2, 2012 15:07 — forked from ingenthr/StoreHandler.java
Sample of exponential backoff on a set with Couchbase Server
package com.couchbase.sample.dataloader;
import com.couchbase.client.CouchbaseClient;
import java.io.IOException;
import java.net.URI;
import java.util.List;
import net.spy.memcached.internal.OperationFuture;
import net.spy.memcached.ops.OperationStatus;
/**