Skip to content

Instantly share code, notes, and snippets.

@bbrks
bbrks / proof.md
Created June 16, 2024 20:34
keyoxide.org proof

aspe:keyoxide.org:JOZYSIWAWQBFZ6CS4PSCOXUTIE

@bbrks
bbrks / script.groovy
Created August 17, 2022 12:34
Jenkins script for each job's build update description with parameters
Jenkins.instance.getAllItems(Job.class).each{
if (it.name == "SyncGateway-Integration") {
it.getBuilds().each{
println 'old description: '+it.getDescription()
if (it.getEnvironment().get('TIMEOUT') != null) {
it.setDescription("timeout: ${SG_COMMIT} - ${BUILD_USER}")
} else {
it.setDescription("${SG_COMMIT} - ${BUILD_USER}")
}
println 'new description: '+it.getDescription()
@bbrks
bbrks / couchbase-server
Created May 22, 2020 09:09
UFW application for Couchbase Server 6.5 - Client-to-node ports - /etc/ufw/applications.d/couchbase-server
[couchbase-server]
title=couchbase-server
description=Couchbase Server Client-to-node ports
ports=8091:8096,11210,11207,18091:18096/tcp
@bbrks
bbrks / gist:df8128d317c4ad3f8ba20b153233b92f
Created February 25, 2020 23:46
github.com/couchbase/sync_gateway bench 1.13.8 vs. 1.14
bbrks@ben-pc-debian:~/github.com/couchbase/sync_gateway$ benchcmp sync_gateway-1.13.8.out sync_gateway-1.14.out
benchcmp is deprecated in favor of benchstat: https://pkg.go.dev/golang.org/x/perf/cmd/benchstat
benchmark old ns/op new ns/op delta
BenchmarkPartitionToVbNo/map-12 13.3 12.4 -6.77%
BenchmarkPartitionToVbNo/atoi-12 4.26 4.67 +9.62%
BenchmarkPartitionToVbNo/parseUint-12 14.8 7.05 -52.36%
BenchmarkLogKeyEnabled/Wildcard-12 0.54 0.54 -0.18%
BenchmarkLogKeyEnabled/Hit-12 0.68 0.68 +0.15%
BenchmarkLogKeyEnabled/Miss-12 0.68 0.68 +0.15%
BenchmarkToggleLogKeys/E
@bbrks
bbrks / couchbase-server.xml
Created January 23, 2020 13:51
Couchbase Server 6.5.0 - Client-to-node ports firewall-cmd service
<service version="1.0">
<short>Couchbase Server 6.5.0 - Client-to-node ports</short>
<port protocol="tcp" port="8091"/> <!-- rest_port -->
<port protocol="tcp" port="8092"/> <!-- capi_port -->
<port protocol="tcp" port="8093"/> <!-- query_port -->
<port protocol="tcp" port="8094"/> <!-- fts_http_port -->
<port protocol="tcp" port="8095"/> <!-- cbas_http_port -->
<port protocol="tcp" port="8096"/> <!-- eventing_http_port -->
<port protocol="tcp" port="11210"/> <!-- memcached_port -->
<port protocol="tcp" port="11207"/> <!-- memcached_ssl_port -->
@bbrks
bbrks / failing
Created January 6, 2020 20:58
CBG-656 logs
=== RUN TestBlipPushRevisionInspectChanges
2019-12-31T20:37:06.777Z [INF] rest.TestBlipPushRevisionInspectChanges: Setup logging: level: debug - keys: *
2019-12-31T20:37:06.777Z [INF] Auth: Attempting credential authentication couchbase://127.0.0.1?http_idle_conn_timeout=90000&http_max_idle_conns=64000&http_max_idle_conns_per_host=256&kv_pool_size=2&n1ql_timeout=75000&operation_tracing=false
2019-12-31T20:37:06.779Z [INF] Successfully opened bucket test_data_bucket
2019-12-31T20:37:06.781Z [INF] Set query timeouts for bucket test_data_bucket to cluster:1m15s, bucket:1m15s
2019-12-31T20:37:06.781Z [INF] Flushing bucket test_data_bucket
2019-12-31T20:37:07.451Z [INF] GoCBCustomSGTranscoder Opening Couchbase database test_data_bucket on <couchbase://127.0.0.1> as user "test_data_bucket"
2019-12-31T20:37:07.451Z [INF] Auth: Attempting credential authentication couchbase://127.0.0.1?http_idle_conn_timeout=90000&http_max_idle_conns=64000&http_max_idle_conns_per_host=256&kv_pool_size=2&n1ql_timeout=75000&operation
@bbrks
bbrks / Dockerfile
Last active November 13, 2019 13:33
sgcollect_info centos6 builder
FROM centos:6
RUN useradd -d /home/user -m -s /bin/bash user
RUN yum -y update && yum -y install centos-release-scl unzip epel-release && yum -y install python27 python-pip && pip install virtualenv
COPY build.sh /
RUN chmod +x /build.sh
ARG SG_COMMIT="master"
@bbrks
bbrks / gist:3c09f2e67092145e4d849df7ce8260c7
Created July 26, 2019 18:08
TestContinuousChangesSubscription data race
2019-07-26T17:50:19.418Z [INF] rest.TestContinuousChangesSubscription: Setup logging: level: info - keys: Changes, SyncMsg, Cache, Sync, HTTP
2019-07-26T17:50:19.419Z [INF] Opening Walrus database test_data_bucket-892d586e2c81503fc33b9de07dfb7549 on <walrus:>
2019-07-26T17:50:19.419Z [INF] Logging stats with frequency: 1m0s
2019-07-26T17:50:19.419Z [INF] Opening db /db as bucket "test_data_bucket-258ca80841a54623c7192b2f05e8238a", pool "default", server <walrus:>
2019-07-26T17:50:19.419Z [INF] Opening Walrus database test_data_bucket-258ca80841a54623c7192b2f05e8238a on <walrus:>
2019-07-26T17:50:19.419Z [INF] Design docs for current view version (2.1) do not exist - creating...
2019-07-26T17:50:19.422Z [INF] Design docs successfully created for view version 2.1.
2019-07-26T17:50:19.422Z [INF] Verifying view availability for bucket test_data_bucket-258ca80841a54623c7192b2f05e8238a...
2019-07-26T17:50:19.423Z [INF] Views ready for bucket test_data_bucket-258ca80841a54623c7192b2f05e8238a.
2019-07-26T17:50:19.423
@bbrks
bbrks / couchbase-server-docker-ports.md
Created March 25, 2019 19:22
Couchbase Server Docker ports

Node-local

-p 11213:11213 -p 9119:9119 -p 9998:9998

Node-to-node

-p 4369:4369 -p 8091-8096:8091-8096 -p 9100-9105:9100-9105 -p 9110-9118:9110-9118 -p 9120-9122:9120-9122 -p 9999 -p 11209-11211:11209-11211 -p 18094 -p 21100-21299:21100-21299
12:43 $ mkfile -n 2g /tmp/sglog-20180529/sg_debug.log
✔ ~/dev/sync_gateway/master/godeps/src/github.com/couchbase/sync_gateway [master|…1⚑ 4]
12:43 $ ls -l /tmp/sglog-20180529/
total 40
-rw------- 1 benbrooks wheel 2.0G 29 May 12:43 sg_debug.log
-rw-r--r-- 1 benbrooks wheel 44B 29 May 12:40 sg_error.log
-rw-r--r-- 1 benbrooks wheel 6.0K 29 May 12:42 sg_info.log
-rw-r--r-- 1 benbrooks wheel 319B 29 May 12:40 sg_warn.log
✔ ~/dev/sync_gateway/master/godeps/src/github.com/couchbase/sync_gateway [master|…1⚑ 4]
12:44 $ ./tools/sgcollect_info test2.zip