Skip to content

Instantly share code, notes, and snippets.

@tech-nova
tech-nova / mail_form_utf8_content.php
Last active March 10, 2016 08:46
Pour envoyer un mail en utf-8 (code forgé à la main)
<?php
// Code utilisé pour envoyer un message utf8
// Sous deux formats (html + texte)
// Sans problème d'accent
// Les données injectées dans le mail proviennent d'une page encodée en utf_8
// via <meta charset>
$message_txt = sprintf(utf8_encode("Vous avez reçu un message depuis le formulaire de contact :
@tech-nova
tech-nova / balise_dynamique_perso.php
Created April 9, 2016 10:04
Créer une balise dynamique perso
<?php
function balise_GESTION_TRUC ($p) {
return calculer_balise_dynamique($p, 'GESTION_TRUC', array());
}
function balise_GESTION_TRUC_dyn() {
// Faire des choses en PHP
// Retourner directement un résultat à afficher
@tech-nova
tech-nova / haproxy.cfg
Created June 12, 2016 09:05 — forked from rnewson/haproxy.cfg
haproxy.cfg stanzas to enable Perfect Forward Secrecy and HTTP Strict Transport Security. Requires OpenSSL 1.0.1g or so.
# Bind SSL port with PFS-enabling cipher suite
bind :443 ssl crt path_to_certificate no-tls-tickets ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-RC4-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES128-SHA:AES256-SHA256:AES256-SHA:RC4-SHA
# Distinguish between secure and insecure requests
acl secure dst_port eq 443
# Mark all cookies as secure if sent over SSL
rsprep ^Set-Cookie:\ (.*) Set-Cookie:\ \1;\ Secure if secure
# Add the HSTS header with a 1 year max-age
@tech-nova
tech-nova / haproxy.cfg
Created February 24, 2017 11:18
Configuration de haproxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
@tech-nova
tech-nova / seenthis.net.conf
Last active February 24, 2017 11:31
Configuration de nginx pour seenthis
# Les autres redirections sont gerees par default.conf
server {
listen 8080;
server_name seenthis.net;
access_log /var/www/seenthis.net/log/access.log combined buffer=512k flush=60m;
error_log /var/www/seenthis.net/log/error.log crit;
root /var/www/seenthis.net/public_html;
@tech-nova
tech-nova / seenthis.conf
Created February 24, 2017 11:34
Le pool php5-fpm pour seenthis
; Start a new pool named 'www'.
; the variable $pool can we used in any directive and will be replaced by the
; pool name ('www' here)
[www_seenthis]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)