Skip to content

Instantly share code, notes, and snippets.

View abhinavdangeti's full-sized avatar

Abhi Dangeti abhinavdangeti

  • Couchbase
  • Salt Lake City, UT
  • 11:50 (UTC -06:00)
View GitHub Profile
// Requires cfgBytes.txt to contain output of GET /api/cfg
// Run as: go run parseCfg.go
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
@abhinavdangeti
abhinavdangeti / agent.go
Last active January 31, 2020 21:35
Stats request timing out and select_bucket failing with http://review.couchbase.org/#/c/119401/4
// Steps to run:
// Spin off a couchbase cluster (1 node: DATA + SEARCH), create travel-sample, adjust host, port info in agent.go
// 1. export CBAUTH_REVRPC_URL=http://Administrator:asdasd@localhost:9000/cbft
// 2. go run agent.go
package main
import (
"crypto/tls"
"encoding/json"
@abhinavdangeti
abhinavdangeti / agent.go
Last active December 17, 2019 23:29
Authentication failing for select_bucket with gocbcore.v8
// Steps to run:
// Spin off a couchbase cluster (1 node: DATA + SEARCH), create travel-sample, adjust host, port info in agent.go
// 1. export CBAUTH_REVRPC_URL=http://Administrator:asdasd@localhost:9000/cbft
// 2. go run agent.go
package main
import (
"encoding/json"
"fmt"
This command should set the index up for you..
curl -XPUT -H "Content-type: Application/json" http://<username>:<password>@<ip>:8094/api/index/demo_index -d @temp.json
This should be the content of temp.json..
{
"name": "demo_index",
"type": "fulltext-index",
"params": {
"mapping": {
@abhinavdangeti
abhinavdangeti / index_build.go
Last active June 18, 2018 20:15
Scorch, upsidedown-moss index builder
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"time"
)
package size
import (
// "fmt"
"reflect"
)
var registryStatic map[string]int
var registryDynamic map[string][]dynamicSizeFunc