Skip to content

Instantly share code, notes, and snippets.

karussell /
Last active Jun 10, 2020
append to foreign pull request
# Here is how to append commits to a pull request from a foreign repository without (slow) cloning
# When you put the function in .bashrc you can use it via:
# cd graphhopper # go into your local copy of the repo where the pull request was made
# pranch graphhopper msbarry:sample-and-3d-simplify
# The first argument is your organisation and the second argument is "foreign_organisation:foreign_branch" e.g. copied from the pull request
forbranch=${2#*:} # == foreign branch
fororg=${2%%:*} # == foreign organisation
karussell /
Last active May 25, 2020
Alternative Roads to Rome
* Licensed to GraphHopper and Peter Karich under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
* GraphHopper licenses this file to you 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
karussell / Query-DSL-elasticsearch.txt
Last active May 7, 2020
Bird's Eye View on ElasticSearch its Query DSL
View Query-DSL-elasticsearch.txt
Several times in a month there pop up questions regarding query structure on the ElasticSearch user group.
Although there are good docs explaining this in depth probably the bird view of the Query DSL is necessary to
understand what is written there. There is even already some good external documentation available:
And there were attempts to define a schema:
sudo apt-get install python3-venv
python3 -m venv ~/.python-venv/
source ~/.python-venv/bin/activate
git clone
cd geocoder-tester
pip install -r requirements.txt
py.test ...
wget -q -O vrp.json
JOB_ID=$(curl -X POST -H "Content-Type: application/json" "http://localhost:8080/optimize" --data @vrp.json | cut -d'"' -f4)
sleep 2
curl -X GET "http://localhost:8080/solution/$JOB_ID"
// for more than 4K locations or for slow network you need to gzip the body
OkHttpClient client = new OkHttpClient();
client.setConnectTimeout(20, TimeUnit.SECONDS);
client.setReadTimeout(20, TimeUnit.SECONDS);
client.interceptors().add(new GzipRequestInterceptor());
karussell /
Last active Apr 1, 2020
hetzner pricing for 256GB RAM servers and beyond
name CPU 256GB-price max GB max-price price/1GB
SB (auction) Xeon® E5-1650 v3 Hexa-Core ~100€ 256 ~100€ 0.31-0.43
AX161 EPYC™ 7502P 32-Core Zen2 167.00€ 512 263.00€ 0.514-0.652
PX92 Xeon® W-2145 Octa-Core 174.93€ 256 174.93€ 0.683
DX152 Xeon® SP Silver 10-Core 274.89€ 786 503.37€ 0.640-1.074
SX292 Xeon® E5-1650 v3 Hexa-Core 308.21€ 256 308.21€ 1.204

The Xeon SP Silver is likely the "Xeon Silver 4210".

karussell /
Created Jul 10, 2011
Backup ElasticSearch with rsync
# TO_FOLDER=/something
# FROM=/your-es-installation
DATE=`date +%Y-%m-%d_%H-%M`
echo "rsync from $FROM to $TO"
# the first times rsync can take a bit long - do not disable flusing
rsync -a $FROM $TO
# now disable flushing and do one manual flushing
View truck.yml
# Specify a vehicle (FlagEncoder) or another custom profile like
base: car
# in meter
vehicle_height: 3.8
vehicle_width: 2.5
# in tons
vehicle_weight: 4.5
# The formula is defined in CustomWeighting, where the speed_factor can be used to increase and decrease speed.
View request.json
"configuration" : {
"routing" : {
"profile" : "car"
"clustering" : {
"max_quantity" : 10,
"min_quantity" : 5,
"num_clusters" : 5
You can’t perform that action at this time.