Skip to content

Instantly share code, notes, and snippets.

View MattLoyeD's full-sized avatar
🎯
Focusing

Matthieu D MattLoyeD

🎯
Focusing
View GitHub Profile
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
var f_page = "mooty.d"; // the page name for your fan page, e.g. the 'mooty.d' part of http://facebook.com/mooty.d
var t_page = "mooty.d"; // the account name for your main twitter account
function add_commas(number) {
if (number.length > 3) {
var mod = number.length % 3;
@MattLoyeD
MattLoyeD / cron_img.sh
Last active December 14, 2015 14:33
Image Optimizer for web (PNG & Jpg) Losslesly
#! /bin/sh
# Usage "sh script.sh /path/to/check chmod"
# TODO : Mtime in find ...
if [ -z "$1" ]; then
DIR="`.`"
else
DIR="$1"
fi
<ifmodule mod_deflate.c>
<filesmatch ".(js|json|css|ico|txt|htm|html|php)$">
SetOutputFilter DEFLATE
</filesmatch>
</ifmodule>
FileETag MTime Size
<ifmodule mod_expires.c>
ExpiresActive On
=> http://www.webbax.ch/2011/10/21/reinitialiser-le-mot-de-passe-administrateur-sous-prestashop/
1 / Récupérer votre _COOKIE_KEY_
Rendez-vous dans le fichier /config/settings.inc.php et récupérer la valeur de la variable _COOKIE_KEY_,
exemple : rESub0yysMZpryFSzZvaRPN9KOFIOzEM5Y6FHage4FOsnV1gN4UZcXkM
2 / Ajouter votre nouveau mot de passe
@MattLoyeD
MattLoyeD / cron_save_sql_ftp.sh
Created July 18, 2013 10:15
Cron SH file to save your SQL and export the backup to an FTP. Script can remove files older than X (7 here) days on localhost. All files and folder must be chmod 777 for convinience. Including this.
#!/bin/bash
echo "SQL Backup in Progress"
#Date
NOWDATE=`date '+%H%M-%m-%d-%Y'`
# your MySQL server's name
SERVER=domain.com
@MattLoyeD
MattLoyeD / cron_save_files_ftp.sh
Created July 18, 2013 10:10
Cron SH file to save your site and export the backup to an FTP. Script can remove files older than X (7 here) days on FTP and on localhost. All files and folder must be chmod 777 for convinience. Including this.
#!/bin/bash
echo "Backup in progress"
nowdate=`date '+%H%M-%m-%d-%Y'`
# your MySQL server's name
SERVER=domain.com
@MattLoyeD
MattLoyeD / linux_shell_basic_commands.sh
Last active December 19, 2015 22:29
Linux Shell Basic Commands
# Find all files heavier >20M / human readable
find / -type f -size +20M -exec ls -lh {} \; | awk '{ print $NF ": " $5 }'
# Find all heavy folders
du -sh /*
# OR
du -h | sort -h
# Silent Curl for cron ?
curl --silent http://domain.com/cron.php