Skip to content

Instantly share code, notes, and snippets.

View rudak's full-sized avatar
💾
fra

rudak rudak

💾
fra
View GitHub Profile
@rudak
rudak / script-backup.sh
Last active December 18, 2015 20:49
Un script de backup qui va bien
#!/bin/bash
# Backup des dossiers web
RACINE=/var/www
LINE=-------------------
AN=$(date +%Y)
MOIS=$(date +%m)
JOUR_SEMAINE=$(date +%u)
@rudak
rudak / header logwatch
Created November 29, 2015 10:10
header par defaut de logwatch
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Logwatch $Version ( $VDate )</title>
<meta name="generator" content="Logwatch $Version ( $VDate )">
<style type="text/css">
h1 {color: gray; border-bottom: 3px double silver; font-family: sans-serif; }
h2 {color: white; border-bottom: 1px solid silver; font-family: sans-serif; }
h3 {color: white; border-bottom: 1px solid silver; font-family: sans-serif; }
th {background: #6D88AD; text-align: left; font-family: sans-serif; }
@rudak
rudak / logwatch footer
Created November 29, 2015 10:09
footer par defaut de logwatch
@rudak
rudak / scss mixin respond to
Created October 19, 2015 18:49
mixin qui va bien pour faire des petites retouches a destination de design responsive.
@mixin respond-to($media) {
@if $media == portable {
@media only screen and (max-width: $portable - 1) { @content; }
}
@else if $media == tablette {
@media only screen and (min-width: $portable ) and (max-width: $tablette - 1) { @content; }
}
}
/* Utilisation*/
@rudak
rudak / Picture.php
Created October 19, 2015 18:37
Symfony2 Picture entity exemple
<?php
namespace Main\ExempleBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Picture
@rudak
rudak / post-update
Created April 28, 2015 18:19
basic hook post-update
#!/bin/bash
echo "************"
echo " PULL AUTO"
echo "************"
cd /home/pi/lcd
unset GIT_DIR
git pull origin master
@rudak
rudak / backup sql cron
Last active August 29, 2015 14:16
mon script de backup sql journalier
#!/bin/bash
LINE=-------------------
AN=$(date +%Y)
MOIS=$(date +%m)
JOUR=$(date +%d)
HEURE=$(date +%H%M)
DOSSIER=SQL_Backups
DATE="$AN$MOIS$JOUR"_"$HEURE"
@rudak
rudak / menu
Created January 13, 2015 23:06
menu rapidos
#/usr/bin/python3.4
# -*-coding:utf-8 -*
import os
import time
class menu:
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
// si tu as une div #twitage et que tu mets ton nom twitter
// la ou il faut et que tu as chargée la lib jQuery qui va
// bien ca marche tout seul...
// [a améliorer]
var moulinette = {
sortie : '',
nettoyage: function(chaine) {
this.sortie = this.parse_liens(chaine);
this.sortie = this.parse_listes(this.sortie);