Skip to content

Instantly share code, notes, and snippets.

Robert Newson rnewson

Block or report user

Report or block rnewson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:14a8175a295017ddf5d772331ea445c5
➜ ~ curl -gi 'http://foo:bar@localhost:15984/db1/_design/personen/_view/actief?keys=["10002","10003"]'
HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Type: application/json
Date: Tue, 27 Aug 2019 10:53:16 GMT
Server: CouchDB/2.3.1-dirty (Erlang OTP/22)
Transfer-Encoding: chunked
X-Couch-Request-ID: 447c12072b
X-CouchDB-Body-Time: 0
View gist:260e113bdfe089b3029f088072008744
keyword -> org.apache.lucene.analysis.core.KeywordAnalyzer
simple -> org.apache.lucene.analysis.core.SimpleAnalyzer
whitespace -> org.apache.lucene.analysis.core.WhitespaceAnalyzer
arabic -> org.apache.lucene.analysis.ar.ArabicAnalyzer
bulgarian -> org.apache.lucene.analysis.bg.BulgarianAnalyzer
brazilian -> org.apache.lucene.analysis.br.BrazilianAnalyzer
catalan -> org.apache.lucene.analysis.ca.CatalanAnalyzer
cjk -> org.apache.lucene.analysis.cjk.CJKAnalyzer
chinese -> org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer
czech -> org.apache.lucene.analysis.cz.CzechAnalyzer
@rnewson
rnewson / chttpd_sup.erl.diff
Created Oct 15, 2018
change cloudant auth caching
View chttpd_sup.erl.diff
diff --git a/src/chttpd/src/chttpd_sup.erl b/src/chttpd/src/chttpd_sup.erl
index fe84b67eb..afdcbcb8d 100644
--- a/src/chttpd/src/chttpd_sup.erl
+++ b/src/chttpd/src/chttpd_sup.erl
@@ -80,20 +80,20 @@ maybe_replace(Key, Value, Settings) ->
end.
lru_opts() ->
- case config:get("chttpd_auth_cache", "max_objects") of
- MxObjs when is_integer(MxObjs), MxObjs > 0 ->
View clouseau-run
exec chpst -u dbcore \
java \
-server \
-Xmx6G \
-Dsun.net.inetaddr.ttl=30 \
-Dsun.net.inetaddr.negative.ttl=30 \
-Dlog4j.configuration=file:/opt/clouseau/etc/log4j.properties \
-cp /opt/clouseau/etc:/opt/clouseau/lib/* \
com.cloudant.clouseau.Main \
/opt/clouseau/etc/clouseau.ini
View gist:2d076a061c1af802ad056519ef25e52d
#!/bin/sh
curl -X PUT http://localhost:5984/_users/org.couchdb.user:rnewson -d '{"name":"rnewson", "roles":[], "type":"user", "password":"orange"}'
@rnewson
rnewson / rfc3394.erl
Created Jan 23, 2017
RFC 3394 key wrapping in erlang
View rfc3394.erl
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
% License for the specific language governing permissions and limitations under
View gist:da524242210dda7509019b6f2ca92e54
["ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-RSA-AES128-SHA256", "ECDHE-RSA-AES128-SHA", "ECDHE-RSA-AES256-SHA384", "ECDHE-RSA-AES256-SHA", "AES128-GCM-SHA256", "AES256-GCM-SHA384", "AES128-GCM-SHA384", "AES128-SHA256", "AES128-SHA", "AES256-SHA256", "AES256-SHA"]
View docker.diff
commit e980bb7459865abcb47067b8daed49953704f4fc
Author: Robert Newson <rnewson@apache.org>
Date: Tue Jun 14 11:59:09 2016 +0100
Build small container for single node
diff --git a/Dockerfile.build b/Dockerfile.build
new file mode 100644
index 0000000..28a9ba5
--- /dev/null
View gist:4c809057c9099f6de5e75c05a2c6eb12
; everyone
➜ ~ curl foo:bar@localhost:15984/db1/_security; curl foo:bar@localhost:15986/db1/_security
{}
{}
; admin_only
➜ ~ curl foo:bar@localhost:15984/db1/_security; curl foo:bar@localhost:15986/db1/_security
{"members":{"roles":["_admin"]},"admins":{"roles":["_admin"]}}
{"members":{"roles":["_admin"]},"admins":{"roles":["_admin"]}}
@rnewson
rnewson / blah.diff
Created May 10, 2016
Optionally allow admin_only security object by default
View blah.diff
diff --git a/src/couch_db_updater.erl b/src/couch_db_updater.erl
index 813161a..8639db2 100644
--- a/src/couch_db_updater.erl
+++ b/src/couch_db_updater.erl
@@ -570,7 +570,7 @@ init_db(DbName, Filepath, Fd, Header0, Options) ->
[{compression, Compression}]),
case couch_db_header:security_ptr(Header) of
nil ->
- Security = [],
+ Security = default_security_object(),
You can’t perform that action at this time.