Skip to content

Instantly share code, notes, and snippets.

View jbarotin's full-sized avatar
😃

Jérôme BAROTIN jbarotin

😃
  • Lorient, France
View GitHub Profile
@meineerde
meineerde / haproxy_1_5.cnf
Last active January 19, 2023 02:23
HAPROXY: Redirect all requests to a URL starting with /foo to /bar while retaining everything following it
# In HAProxy 1.5, we have to jump through some hops to accomplish a rewrite of a request's path...
# We use a temporary header to build our new path from the existing one in the request
# and then directly perform a redirect
# Clean the request and remove any existing header named X-Rewrite
http-request del-header X-REWRITE
# Copy the full request URL into the X-REWRITE request header unchanged
http-request add-header X-REWRITE %[url] if { path_beg /foo }
@six519
six519 / convert_test.py
Created August 20, 2014 07:44
Convert file to another file format using LibreOffice API in Python
#!/usr/bin/env python3
"""
VIEW COMPLETE CODE AT
=====================
* https://github.com/six519/libreoffice_convert
THANKS
======
@chrisgillis
chrisgillis / ssl_smtp_example.go
Created April 16, 2014 14:48
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@shrkw
shrkw / gunicorn_with_virtualenv
Created October 31, 2013 10:51
CentOS init script for Gunicorn with Virtualenv
#!/bin/sh
#
# gunicorn_sr Startup script for gunicorn for sr
#
# chkconfig: - 86 14
# processname: gunicorn
# pidfile:
# description: Python application server
#
### BEGIN INIT INFO
@shawndumas
shawndumas / .gitconfig
Created August 5, 2013 19:08
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
@Botffy
Botffy / NiochatServer.java
Created October 9, 2012 18:45
simple Java NIO chat server
package niochat;
import java.net.*;
import java.nio.*;
import java.nio.channels.*;
import java.io.IOException;
import java.util.*;
public class NiochatServer implements Runnable {
private final int port;