View diskmonitor.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 | |
# Pourcentage du seuil d'espace disque | |
THRESHOLD=80 | |
EMAIL="xxx@xxx.com" | |
IP=$(ifconfig eth0 | awk '/inet / {print $2}' | cut -d ':' -f2) | |
date=`date` | |
iLigne=0 | |
for DF in `df -h |awk {'print $5'}` ; do |
View motiondetection.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 | |
# Time mobile offline before active detection (seconds) | |
IDLE_TIME_TRIGGER_DETECTION=3600 | |
# IPs to check for availability | |
IP="192.168.1.89 192.168.1.92" | |
# motion URL | |
MOTION_URL="http://127.0.0.1:7999/1/detection" |
View mysqldump-table-prefix-filter.sql
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
mysql -u {username} -p{password} -N -e 'show tables like "{prefix}\_%"' {dbname} | xargs mysqldump -u {username} --password={password} --single-transaction {dbname} > {filename}.sql |
View bootstrap-sols-same-height.js
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
$(window).load(function() { | |
$(window).resize(resizeColSameHeight); | |
resizeColSameHeight(); | |
}); | |
/** | |
* Redimensionnement hauteur des colonnes bootstrap "col-same-height" ligne par ligne selon la taille de la vue | |
*/ | |
function resizeColSameHeight() { | |
if ($('.col-same-height').length > 0) { |
View prestashop-fix-doublons-positions-bdd.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
<?php | |
$db = Db::getInstance(); | |
$res = $db->executeS('SELECT DISTINCT id_category, id_shop FROM '._DB_PREFIX_.'category_shop'); | |
foreach ($res as $row) { | |
$res2 = $db->executeS('SELECT cs.* FROM '._DB_PREFIX_.'category_shop cs | |
INNER JOIN '._DB_PREFIX_.'category c ON c.id_category = cs.id_category | |
WHERE cs.id_shop = '.$row['id_shop'].' | |
AND c.id_parent='.$row['id_category'].' | |
ORDER BY cs.position'); |
View visual-composer-cols-same-height.js
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
jQuery(window).load(function() { | |
jQuery(window).resize(resizeColSameHeight); | |
resizeColSameHeight(); | |
}); | |
/** | |
* Redimensionnement hauteur des colonnes bootstrap "col-same-height" ligne par ligne selon la taille de la vue | |
*/ | |
function resizeColSameHeight() { | |
if (jQuery('.col-same-height').length > 0) { |
View backup.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 | |
# DECLARATIONS VARIABLES | |
mysqldbs=(db1 db2 db3) | |
wwwdirs=(dir1 dir2 dir3) | |
nbjours=30 | |
jourtodelete=$((nbjours+1)) | |
# ROTATION ANCIENNES VERSIONS | |
for (( jour = ${nbjours[*]}; jour > 1; jour-- )) |