Skip to content

Instantly share code, notes, and snippets.

View mathieue's full-sized avatar

Mathieu Elie mathieue

View GitHub Profile
@mathieue
mathieue / haproxy.cfg.txt
Last active December 15, 2015 22:49
Websocket on port 80 and subpath with HAProxy !
frontend mayappfront
bind 0.0.0.0:80
acl is_front hdr_end(host) -i myapp.fr
acl is_websocket path_beg -i /websockets
use_backend websocketappprod if is_websocket is_front
use_backend backend if is_front
default_backend backend
backend backend
balance roundrobin
@mathieue
mathieue / 6379.conf
Last active April 23, 2022 16:23
redis conf with disk persistance
## Generated by install_server.sh ##
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
@mathieue
mathieue / bulk-import-sample.json
Last active October 7, 2017 07:46
prez d3.js + elasticsearch on bordeaux open data @BordeauxJS
{ "index" : { "_index" : "musees", "_type" : "capc"} }
{"Auteur" : "AA BRONSON (TIMS Mickael, dit)", "Titre" : "Jorge, February 3, 1994", "Date" : 2000, "Domaine" : "Photographie", "Deno" : null, "MatSuppTech" : "Impression sépia sur mylar", "Description" : null, "Dimensions" : "3 x (180,5 x 91,5) cm", "Column 10" : null, "Column 11" : null, "Column 12" : null, "Column 13" : null, "Column 14" : null, "Column 15" : null, "Column 16" : null, "Column 17" : null, "Column 18" : null, "Column 19" : null, "Column 20" : null, "Column 21" : null }
{ "index" : { "_index" : "musees", "_type" : "capc"} }
{"Auteur" : "ABSALON (MEIR Eshel, dit)", "Titre" : "Cellule (3)", "Date" : 1991, "Domaine" : "Sculpture", "Deno" : null, "MatSuppTech" : "Bois, carton, Plexiglas, tubes fluorescents, peinture glycerophtalique", "Description" : null, "Dimensions" : "133x240x161 cmPorte : 34 x 179 x 25 cm", "Column 10" : null, "Column 11" : null, "Column 12" : null, "Column 13" : null, "Column 14" : null, "Column 15" : null, "Column 16" :
@mathieue
mathieue / sentinel
Created February 4, 2013 16:19
redis sentinel startup script
#!/bin/bash
### BEGIN INIT INFO
# Provides: redis sentinel
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts redis sentinel
# Description: Starts redis sentinel using start-stop-daemon
### END INIT INFO
# linux-tips.sh
# https://gist.github.com/3927552
# collection of great tips picked from the UNIX TOOLBOX
# http://cb.vu/unixtoolbox.xhtml
# get distrib infos
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
@mathieue
mathieue / install-varnish-debian-with-munin.sh
Created October 2, 2012 12:45
Install varnish on debian squeeze with munin plugins
curl http://repo.varnish-cache.org/debian/GPG-key.txt | apt-key add -
echo "deb http://repo.varnish-cache.org/debian/ squeeze varnish-3.0" >> /etc/apt/sources.list
apt-get update
apt-get install varnish
# test
varnishtop -i rxurl
varnishstat
# munin plugins
@mathieue
mathieue / install-nginx-munin-debian.sh
Created October 2, 2012 12:19
Install nginx with munin plugins on debian
apt-get install munin-plugins-extra libio-all-lwp-perl
echo "[nginx_*]
env.url http://localhost/nginx_status
" > /etc/munin/plugin-conf.d/nginx
vi /etc/nginx/sites-available/default
# in server section
location /nginx_status {
stub_status on;
access_log off;
#! /bin/sh
### BEGIN INIT INFO
# Provides: logstash-shipper
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
@mathieue
mathieue / udp-multi-socat.sh
Created August 28, 2012 23:57
udp multiplexer with socat
socat - udp4-listen:8125,fork | tee >(socat - udp-sendto:127.0.0.1:8135) >(socat - udp-sendto:127.0.0.1:8140)
@mathieue
mathieue / remove-host.sh
Created August 11, 2012 19:47
Remove entry in known host by line number (sed)
sed -i "209 d" .ssh/known_hosts