Skip to content

Instantly share code, notes, and snippets.

View AntoineAugusti's full-sized avatar
🚄
High speed, low carbon

Antoine Augusti AntoineAugusti

🚄
High speed, low carbon
View GitHub Profile
@AntoineAugusti
AntoineAugusti / gist:4287238
Created December 14, 2012 17:43
Rebuild virusmails directory
mkdir /var/lib/amavis/virusmails/
chmod 750 /var/lib/amavis/virusmails/
chown amavis /var/lib/amavis/virusmails/
@AntoineAugusti
AntoineAugusti / gist:4287255
Created December 14, 2012 17:46
Inodes in a directory
find . -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n
@AntoineAugusti
AntoineAugusti / gist:4292585
Created December 15, 2012 10:33
Requeue / send mail
# Pour voir la mail queue
mailq
# Pour rajouter les emails en attente dans la mail queue et demander à Postfix de tenter à nouveau de les envoyer
postsuper -r ALL
postfix flush
# Il faut commenter la ligne de content_filter comme ci-dessous
#content_filter = amavis:[127.0.0.1]:10024
#amavis unix - - - - 2 smtp
# -o smtp_data_done_timeout=1200
# -o smtp_send_xforward_command=yes
@AntoineAugusti
AntoineAugusti / gist:4293720
Created December 15, 2012 10:44
Reload configuration files for Postfix
postfix reload
# Reponse de Postfix :
#postfix/postfix-script: refreshing the Postfix mail system
postsuper -r ALL
# Exemple de reponse :
#postsuper: Requeued: 42 messages
postfix flush
@AntoineAugusti
AntoineAugusti / gist:4347250
Created December 20, 2012 17:57
Cookie for multiple subdomains
<?php
ini_set('session.cookie_domain', substr($_SERVER['SERVER_NAME'], strpos($_SERVER['SERVER_NAME'], "."), 100));
@AntoineAugusti
AntoineAugusti / gist:4374455
Created December 25, 2012 17:56
_trackEvent, signup page
// Dans le menu
<a href="signup" onClick="_gaq.push(['_trackEvent', 'Page d\'inscription', 'Clic', 'Menu']);" title="Inscription">Inscription</a>
// Dans l'article de blog
<a href="signup" onClick="_gaq.push(['_trackEvent', 'Page d\'inscription', 'Clic', 'Article de blog']);" title="Inscription">Inscription</a>
// Dans le footer
<a href="signup" onClick="_gaq.push(['_trackEvent', 'Page d\'inscription', 'Clic', 'Footer']);" title="Inscription">Inscription</a>
<?php
function age($naiss)
{
list($jour, $mois, $annee) = split('[/]', $naiss);
$today['mois'] = date('n');
$today['jour'] = date('j');
$today['annee'] = date('Y');
$annees = $today['annee'] - $annee;
program triInsertion;
const MAX = 20;
var t : array[1..MAX] of integer;
var nb : integer;
type tableau = array[1..MAX] of integer;
{On recherche où placer l'élément sur l'intervalle [1..borneSup]}
function obtenirIndiceDInsertion (t : tableau; borneSup, lEntier : integer) : integer;
var i : integer;
begin