This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# ALL FAME GOES HERE : https://gist.github.com/mipearson/1146151 | |
# | |
# 1/ Place where you want (like /usr/share/munin/plugins/nginx_status_codes.py ) | |
# 2/ Link in /etc/munin/plugins/ : | |
# ln -s /usr/share/munin/plugins/nginx_status_codes.py /etc/munin/plugins/nginx_errors | |
# chmod +x /etc/munin/plugins/nginx_errors | |
# 3/ Test with | |
# munin-run nginx_errors | |
# 4/ If nescessary : add these lines in your munin conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
# -*- coding: utf-8 -*- | |
import os | |
import os.path | |
import re | |
class VMFileRotator: | |
def __init__(self, path, regexp, max_keep = 2): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# DEPLOYED WITH ANSIBLE | |
DESTFOLDER="/root/backups" | |
MAIL="[email protected]" | |
DIST_SERVER="[email protected]" | |
DIST_FOLDER="/home/backup-user/" | |
LOGFILE=$$.log | |
echo "" > $LOGFILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://www.impots.gouv.fr/portal/dgi/public/popup?espId=1&typePage=cpr02&docOid=documentstandard_6182 | |
// Impots sur revenus 2018 | |
// Voir commentaire du gist pour les années suivantes | |
function impotBareme(montant){ | |
var impot = 0; | |
var tranches = new Array(); | |
tranches.push([6011, 0]); | |
tranches.push([11991, 0.055]); | |
tranches.push([26631, 0.14]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Sidereo\CoreBundle\Controller; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | |
use Sidereo\CoreBundle\Entity\App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
# pip install requests | |
import requests | |
from requests.auth import HTTPBasicAuth | |
def get_distributors(base_url, auth): | |
print "--- GET HOTELS" | |
url = base_url + "/api/distributors.json" | |
r = requests.get(url, auth=auth) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# DOWNLOAD LAST BILLS ON OVH VIA REST API | |
import requests | |
from pprint import pprint | |
from lxml import html, etree | |
import StringIO | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from PIL import Image | |
from PIL.ExifTags import TAGS | |
from pprint import pprint | |
def get_exif(fn): | |
try: | |
ret = {} |
NewerOlder