Skip to content

Instantly share code, notes, and snippets.

View Mpdreamz's full-sized avatar
🐱
😹 😼

Martijn Laarman Mpdreamz

🐱
😹 😼
View GitHub Profile
@duydo
duydo / elasticsearch_best_practices.txt
Last active June 20, 2024 09:59
Elasticsearch - Index best practices from Shay Banon
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
@sjoerdvisscher
sjoerdvisscher / tetriscard.html
Last active December 23, 2015 15:59
Maybe I should put this on the back of my business card...
<p><script>C='▣';f=[];R=[];P=0;while(k=('/SN;__/NK;OL/QN;__/OL;NK4L@@_C4_G@OL'+
'4SO@__4QN@OL'+(l='3NB?_G3_K?OL/QN;__/SK;__4OL@__4LC@_G4LC@_G4_C@_G')+'-__9QL'+
'-__9TQ-XT9XT-VS9TN+SO7__+__7OJ+SO7SO+QN7OL'+l).charCodeAt(P)){D='\0\0';for(j=0
;k<95&j<1e4;)v=Math.max(-1e4,Math.min(1e4,1e6*Math.sin(j*Math.pow(2,k/12)/695))
)/Math.exp(j++/5e3),D+=String.fromCharCode(v&255,v>>8&255);R[P++]=new Audio(
'data:audio/wav;base64,UklGRgAAAABXQVZFZm10IBAAAAABAAEAwF0AAIC7AAACABAAZGF0YSBO'
+btoa(D))}for(e=i=255;i;)f[i]=i--%12&&i<240?i%12?0:'<br>':' ';t=p=r=4;d=function
(c){for(q=p,i=1;q+=(i-1?i&8?[9,-37,-9,37]:[1,12,-1,-12]:[1,2,14,13])[r%4],i<99;i
*=2)if('36cqrtx'.charCodeAt(t)&i)if(-c){if(f[q])return 1}else f[q]=c};onkeydown=
m=function(c){Q=[-1,0,1,12][c?c.keyCode-37:3]||0;d(0);p+=Q;r+=!Q;if(s=d(1))p-=Q,
@gerbsen
gerbsen / ssh_agent_start.fish
Last active July 16, 2024 16:52 — forked from schaary/ssh_agent_start.fish
Auto-launching ssh-agent in fish shell
# content has to be in .config/fish/config.fish
# if it does not exist, create the file
setenv SSH_ENV $HOME/.ssh/environment
function start_agent
echo "Initializing new SSH agent ..."
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
echo "succeeded"
chmod 600 $SSH_ENV
. $SSH_ENV > /dev/null
@russcam
russcam / pkcs12_change_pass.sh
Last active September 26, 2018 11:10
Change the passphrase and private key password for a PKCS#12 archive
#!/bin/bash
current_archive=$1
current_password=$2
new_password=$3
new_archive=$4
if [[ -z "$new_archive" ]]; then
new_archive="${current_archive%.*}_new.p12"
fi