Skip to content

Instantly share code, notes, and snippets.

View checker.py
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(zone.id)
for r in records:
View keybase.md

Keybase proof

I hereby claim:

  • I am bracki on github.
  • I am bracki (https://keybase.io/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:

View Knallhorst.java
/*
We have to create our own key store since our API endpoint doesn't send the intermediate
SSL certificates
(see https://svn.jimdo-server.com/trac/ticket/52929).
1. Get server certificate:
i.e.: echo | openssl s_client -connect mobile.jimdoapi.com:443 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]:
github.com/awslabs/aws-sdk-go/aws.func·002()
/build/tmp-build/confd-branch-dynamodb/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials.go:252 +0x5c
github.com/awslabs/aws-sdk-go/aws.(*iamProvider).Credentials(0xc20822e320, 0x0, 0x7f84591a9980, 0xc2081c7d80)
/build/tmp-build/confd-branch-dynamodb/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials.go:265 +0x9af
github.com/awslabs/aws-sdk-go/aws.(*DefaultCredentialsProvider).Credentials(0xa53948, 0xc2081c79d0, 0x0, 0x0)
/build/tmp-build/confd-branch-dynamodb/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials.go:60 +0x1e2
github.com/awslabs/aws-sdk-go/internal/signer/v4.Sign(0xc208040680)
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 http://pypi.python.org/simple/diesel
URLs to search for versions for diesel:
* http://pypi.python.org/simple/diesel/
Getting page http://pypi.python.org/simple/diesel/
Analyzing links from page https://pypi.python.org/simple/diesel/
Found link https://pypi.python.org/packages/source/d/diesel/diesel-2.1.0.tar.gz#md5=bf52eb9c2d51fedc667348af613f3250 (from https://pypi.python.org/simple/diesel/), version: 2.1.0
Found link https://pypi.python.org/packages/source/d/diesel/diesel-2.1.1.tar.gz#md5=0184b336fea8f5d4482befde5716ce14 (from https://pypi.python.org/simple/diesel/), version: 2.1.1
@bracki
bracki / diesel.md
Last active Aug 29, 2015
pip install diesel
View diesel.md
>>> urllib2.urlopen('http://jamwt.com/diesel/diesel-3.0.16.tar.gz')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
@bracki
bracki / xconfhh.md
Last active Aug 29, 2015
A quick recap of XConf Hamburg
View xconfhh.md

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
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