Skip to content

Instantly share code, notes, and snippets.

import boto3
import requests
import pykube
def query_route53_records():
c = boto.client("route53")
for zone in c.get_zones():
records = c.get_all_rrsets(
for r in records:

Keybase proof

I hereby claim:

  • I am bracki on github.
  • I am bracki ( on keybase.
  • I have a public key whose fingerprint is 6973 F3DB F562 53F9 A0A0 55FF A914 9FCB E1AF 1577

To claim this, I am signing this object:

We have to create our own key store since our API endpoint doesn't send the intermediate
SSL certificates
1. Get server certificate:
i.e.: echo | openssl s_client -connect 2>&1 | \
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > jimdoapicert.pem
2. Create keystore:
i.e.: keytool -import -v -trustcacerts -alias 0 -file <(openssl x509 -in jimdoapicert.pem) \
View gist:3e0f2e859f70550408b5d567ca150813
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x606edc]
goroutine 27 [running]:·002()
/build/tmp-build/confd-branch-dynamodb/Godeps/_workspace/src/ +0x5c*iamProvider).Credentials(0xc20822e320, 0x0, 0x7f84591a9980, 0xc2081c7d80)
/build/tmp-build/confd-branch-dynamodb/Godeps/_workspace/src/ +0x9af*DefaultCredentialsProvider).Credentials(0xa53948, 0xc2081c79d0, 0x0, 0x0)
/build/tmp-build/confd-branch-dynamodb/Godeps/_workspace/src/ +0x1e2
View foo.go
func restoreDump(conn mysqlConnection) {
log.Print("Restoring dump")
// Collect the output from the command(s)
var output bytes.Buffer
var stderr bytes.Buffer
bzcat := exec.Command("/bin/bzcat", "/tmp/location")
bzcat.Stderr = &stderr
cmdString := mysqlCommand(conn, []string{"cms"})
View gist:71ffd8a350fd3b09d1fa
(schnuffi)➜ ~ pip -vvvvv install diesel
Using PyPI mirrors:
Downloading/unpacking diesel
Getting page
URLs to search for versions for diesel:
Getting page
Analyzing links from page
Found link (from, version: 2.1.0
Found link (from, version: 2.1.1
bracki /
Last active Aug 29, 2015
pip install diesel
>>> urllib2.urlopen('')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 126, in urlopen
    return, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 513, in http_response
    'http', request, response, code, msg, hdrs)
bracki /
Last active Aug 29, 2015
A quick recap of XConf Hamburg

A quick recap of XConf Hamburg

Today I attended [XConf][XconfHH]. Here is a quick recap of the talks I visited.

Keynote by [@jezhumble][jezhumble]

This has been summarized in other posts far better than I can

bracki / function1.clj
Created Jun 17, 2014
Clojure/Scala Interop
View function1.clj
(defn scala-function1 [f]
"Convert a one-argument Clojure function to a scala.Function1."
(reify scala.Function1
(apply [_ x] (f x))))
View gist:10656012
If you want, I can try and help with pointers as to how to improve the indexing speed you get. Its quite easy to really increase it by using some simple guidelines, for example:
- Use create in the index API (assuming you can).
- Relax the real time aspect from 1 second to something a bit higher (index.engine.robin.refresh_interval).
- Increase the indexing buffer size (indices.memory.index_buffer_size), it defaults to the value 10% which is 10% of the heap.
- Increase the number of dirty operations that trigger automatic flush (so the translog won't get really big, even though its FS based) by setting index.translog.flush_threshold (defaults to 5000).
- Increase the memory allocated to elasticsearch node. By default its 1g.
- Start with a lower replica count (even 0), and then once the bulk loading is done, increate it to the value you want it to be using the update_settings API. This will improve things as possibly less shards will be allocated to each machine.
- Increase the number of machines you have so