Skip to content

Instantly share code, notes, and snippets.

View jchris's full-sized avatar

Chris Anderson jchris

View GitHub Profile
@jchris
jchris / sg crash.log
Created June 20, 2013 23:19
test makes Sync Gateway crash if you run it over and over again and control c it if it gets stuck and run it again
16:17:18.807032 Reset guest user to config
16:17:18.807057 Starting auth server on :4985
16:17:18.819518 Starting server on :4984 ...
16:17:25.028532 HTTP: GET /db/
16:17:25.029184 WARNING: all_docs got error: Reduce is not supported yet, sorry -- db.(*Database).queryAllDocs() at database.go:299
16:17:25.182783 HTTP: GET /db/
16:17:25.182877 WARNING: all_docs got error: Reduce is not supported yet, sorry -- db.(*Database).queryAllDocs() at database.go:299
16:17:25.189725 HTTP: GET /db/_changes?filter=sync_gateway%2Fbychannel&feed=continuous&channels=ok%2Cabc%2Cempty
16:17:25.189957 HTTP: GET /db/test-doc-b
16:17:25.190017 HTTP: --> 404 missing
@jchris
jchris / CouchChat-config.js
Created June 17, 2013 18:42
can't access /chat/_persona
{
"log": ["CRUD", "REST+"],
"databases": {
"chat": {
"browserid" : {
"origin" : "http://mineral.local:4984/"
},
"users": {
"GUEST": {"disabled": true},
@jchris
jchris / idle netstat
Created June 10, 2013 16:27
netstat -an at various times, debugging sync gateway
➜ sync_gateway git:(master) ✗ netstat -an
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 127.0.0.1.8091 127.0.0.1.51468 ESTABLISHED
tcp4 0 0 127.0.0.1.51468 127.0.0.1.8091 ESTABLISHED
tcp46 0 0 *.4985 *.* LISTEN
tcp46 0 0 *.4984 *.* LISTEN
tcp4 0 0 127.0.0.1.11210 127.0.0.1.51465 ESTABLISHED
tcp4 0 0 127.0.0.1.51465 127.0.0.1.11210 ESTABLISHED
tcp4 0 0 127.0.0.1.11210 127.0.0.1.51464 ESTABLISHED
@jchris
jchris / gist:5580341
Created May 14, 2013 22:54
error with npm install couchbase
➜ twitterfight brew install libcouchbase
==> Downloading http://packages.couchbase.com/clients/c/libcouchbase-2.0.6.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/opt/boxen/homebrew/Cellar/libcouchbase/2.0.6 --disable-examples --disable-tests --disable-couchbasemock
==> make install
🍺 /opt/boxen/homebrew/Cellar/libcouchbase/2.0.6: 105 files, 912K, built in 13 seconds
➜ twitterfight npm install couchbase
npm http GET https://registry.npmjs.org/couchbase
npm http 304 https://registry.npmjs.org/couchbase
npm http GET https://registry.npmjs.org/bindings
➜ TouchBooksAlloy git:(public-api) titanium build -p iphone
Titanium Command-Line Interface, CLI version 3.0.24, Titanium SDK version 3.0.2.GA
Copyright (c) 2012-2013, Appcelerator, Inc. All Rights Reserved.
Please report bugs to http://jira.appcelerator.org/
[ERROR] No app.js found
Ensure the app.js file exists in your project's "Resources" directory.
16:26:53.738| Logging mode 2 enabled in domains: {CBLDatabase, CBLModel, RemoteRequest}
16:26:53.740| CBLDatabase: Starting replicator manager for CBLManager[/Users/jchris/Library/Application Support/iPhone Simulator/6.1/Applications/85364980-089C-47E4-BB88-0ED6B3BA3153/Library/Application Support/CouchbaseLite]
16:26:53.753| CBLDatabase: Created CBLManager[/Users/jchris/Library/Application Support/iPhone Simulator/6.1/Applications/85364980-089C-47E4-BB88-0ED6B3BA3153/Library/Application Support/CouchbaseLite]
16:26:53.753| CBLDatabase: Opening CBLDatabase[<0x7648760>chats]
16:26:53.753| CBLDatabase: Open /Users/jchris/Library/Application Support/iPhone Simulator/6.1/Applications/85364980-089C-47E4-BB88-0ED6B3BA3153/Library/Application Support/CouchbaseLite/chats.touchdb (flags=200006)
16:26:53.840| CBLDatabase: Begin transaction (level 1)...
16:26:53.842| CBLDatabase: Commit transaction (level 1)
16:26:53.843| CBLLiveQuery: Initial row count is 0
16:26:53.856| CBLDatabase: Opening CBLDatabase[<0x7647f60>_rep
./sync_gateway ~/code/CouchChat-iOS/sync-gateway-config.json
16:23:39.792740 Enabling logging: [CRUD REST+]
Sync Gateway starting with config settings:
{
"Interface": ":4984",
"AdminInterface": ":4985",
"Persona": {
"Origin": "http://animal.local:4984/"
},
"Log": [
@jchris
jchris / sync.js
Last active December 14, 2015 05:28
Sync function runs validation and generates access() and channel() maps.
config.sync = function(doc, oldDoc, userCtx, secObj) {
if (doc.channel_id) {
// doc belongs to a channel
channel("ch-"+doc.channel_id);
// this document describes a channel
if (doc.channel_id == doc._id) {
// magic document, treat it carefully
if (oldDoc && oldDoc.owners.indexOf(userCtx.name) === -1) {
throw({unauthorized:"you are not a channel owner"});
}
@jchris
jchris / tests.log
Created October 31, 2012 21:38
running make check inside the node repository checkout
ether 14:15:26 ~/couchbase-sdks/node(work) jchrisa
make check
(cd tests && ./runtests.sh 0*.js)
00-args.t.js .. OK
01-set.js .. OK
assert.js:3657: Uncaught AssertionError: JSON values should be converted back to objects
assert.js:3657: Uncaught AssertionError: Unicode characters should round trip.
timeout, assuming failure
02-get.js .. FAIL
03-multiget.js .. OK