View cron.hourly.backup
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 | |
current_hour=$(date +"%H") | |
current_day=$(date +"%d") | |
current_month=$(date +"%m") | |
dbuser=backup | |
dbpass=****** | |
dbname=mydb | |
from=backup@domain.com |
View gist:5e9cea32d588507c9aad
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 | |
define('DEBUG', true); // true = enable debug mode | |
define('DEBUG_ALLOW_ERRORS', false); // false = break on every notice/warning/error(throw exception) | |
set_error_handler('error_handler'); | |
// set_exception_handler(array('Kohana_Exception', 'handler')); | |
function error_handler($code, $error, $file = NULL, $line = NULL){ | |
if (error_reporting() & $code) |
View gist:2593862
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 | |
private function getCurrentRule() { | |
$return = false; | |
$rules = array_reverse($this->getRules()); | |
$today = time() ; | |
$year = Date('Y') ; | |
$day = Date('d') ; | |
$month = Date('m') ; |
View an-other-one.sh
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 | |
# Author: Michaël Marinetti | |
# Description: in each files ( $ext extension) | |
# if they not contains $search add $content (absolute path) before $add_before (a vim regex, beginning with / or ?) | |
dir=www | |
ext="htm" | |
search="_setAccount" | |
content=~/correct-html-header | |
add_before="/<\/head>/-1" |
View gist:2916695
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
$ svn diff | |
Index: classes/AdminTab.php | |
=================================================================== | |
--- classes/AdminTab.php (revision 15980) | |
+++ classes/AdminTab.php (working copy) | |
@@ -1524,6 +1524,8 @@ | |
echo Tools::displayDate($tr[$key], (int)$cookie->id_lang); | |
elseif (isset($params['type']) AND $params['type'] == 'datetime') | |
echo Tools::displayDate($tr[$key], (int)$cookie->id_lang, true); | |
+ elseif (isset($params['type']) AND $params['type'] == 'log') |
View gist:2935331
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
Etat HTTP 500 - | |
type Rapport d'exception | |
message | |
description Le serveur a rencontré une erreur interne () qui l'a empêché de satisfaire la requête. | |
exception |
View etc-ssh-sshd_config
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
1) chown root:sftp /home/web -R | |
fortement basé sur http://shapeshed.com/chroot_sftp_users_on_ubuntu_intrepid/ , et un grand merci à la communauté freenode/gandi-hosting ! | |
---------------------------------------------------- | |
# Package generated configuration file | |
# See the sshd_config(5) manpage for details |
View post-receive
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
read oldrev newrev refname | |
branch=${refname#refs/heads/} | |
dir_develop=/home/www/dev.mywebsite.com | |
dir_master=/home/www/mywebsite.com | |
mail=michael@mywebsite.com | |
if (test "$branch" = "develop") then | |
cd $dir_develop |
View bashrc.bash
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 | |
# list of colors, just what I use for test | |
txtrst=\[\033[00m\] # no color | |
txtred=\[\033[31m\] # Red | |
txtred=\[\033[32m\] # Green | |
txtblu=\[\033[34m\] # Blue | |
RANDOM_PROMPT() | |
{ |
View Firstpage.php
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> | |
<head> | |
<link href="/js/jquery/jquery.cleditor.css" rel="stylesheet" type="text/css"/> | |
<script type="text/javascript" src="/js/jquery.min.js"></script> | |
<script type="text/javascript" src="/js/jquery/jquery.cleditor.js"></script> | |
<script type="text/javascript" src="/js/jquery/jquery.form.js"></script> | |
<script type="text/javascript"> | |
$("#myform").submit(function(e){ |
OlderNewer