Skip to content

Instantly share code, notes, and snippets.

View bracki's full-sized avatar

Jan Brauer bracki

View GitHub Profile
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
#!/usr/bin/env python
# Quick and dirty demonstration of CVE-2014-0160 by
# Jared Stafford (jspenguin@jspenguin.org)
# Modified so that it finds cookies
import sys
import struct
import socket
import time
import select
@bracki
bracki / image.go
Created March 2, 2014 21:11
Simple image renderer with Go.
package main
import (
"bytes"
"github.com/quirkey/magick"
"io/ioutil"
"log"
"net/http"
"net/url"
"path/filepath"
@bracki
bracki / Makefile
Created January 31, 2014 20:43
Generic Makefile for PECL debian packages
TOP := $(CURDIR)
PKGDIR = $(TOP)/pkg
all: build
$(PKGDIR):
mkdir -p $(PKGDIR)
clean:
rm -rf $(PKGDIR)
ec2 = Jenkins.instance.clouds.iterator().next()
template = ec2.getTemplate('jimdo-dev-box')
template.description = 'geloet'
template.save()
groovy.lang.ReadOnlyPropertyException: Cannot set readonly property: description for class: hudson.plugins.ec2.SlaveTemplate
at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2377)
at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3347)
at org.codehaus.groovy.runtime.InvokerHelper.setProperty(InvokerHelper.java:183)
(ns riemann.test.nagios
(:use riemann.nagios
clj-nsca.core
clojure.test)
(:require [riemann.logging :as logging]))
(logging/init)
(def test-event
{:host "host01" :service "test_service" :state "ok" :description "Quick brown fox"})
@bracki
bracki / TimedJsonWebSignatureSerializer.py
Last active May 1, 2018 22:21
A TimedJsonWebSignatureSerializer that checks for http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#expDef. A bit like the TimedSerializer, but with self contained expiry time.
from itsdangerous import JSONWebSignatureSerializer, BadSignature, SignatureExpired
import calendar
import datetime
class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer):
EXPIRES_IN_AN_HOUR = 3600
def __init__(self, secret_key, salt=None, serializer=None, signer=None, signer_kwargs=None, algorithm_name=None, expires_in=None):
@bracki
bracki / ThriftOverHttp.scala
Last active September 6, 2017 10:04
Thrift HTTP transport implemented as a Filter for Twitter's Finagle.
class ThriftOverHttp extends Filter[ThriftClientRequest, Array[Byte], HttpRequest, HttpResponse] {
def apply(request: ThriftClientRequest, service: Service[HttpRequest, HttpResponse]) = {
val httpRequest = convertThriftRequestToHttpRequest(request)
val response = service(httpRequest)
response flatMap { res =>
Future.value(res.getContent().array())
}
}
private def convertThriftRequestToHttpRequest(request: ThriftClientRequest) = {
@bracki
bracki / rvm2rbenv.txt
Created December 3, 2012 20:51 — forked from brentertz/rvm2rbenv.txt
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################