Skip to content

Instantly share code, notes, and snippets.

MattLoyeD MattLoyeD

Block or report user

Report or block MattLoyeD

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MattLoyeD
MattLoyeD / index.php
Last active Aug 22, 2019
GIF to MP4 in PHP (with Linux & ffmpeg)
View index.php
<?php
/**
* @author: Matthieu Loye Deroubaix / @matloyed
* @website : http://www.agence-malttt.fr/
* Do what you want with this file :)
* Usage : http://gifme.domain.tld/?url=http://www.domain.tld/blablabla.gif
*/
View gist:fc338a395c2b32444bbfda786452b667
# Image (Lightroom online) tools #
https://v3.polarr.co/
# Vector image editor #
http://editor.method.ac/
# Compression/Optimisation Image #
https://tinyjpg.com/ or https://tinypng.com/
# Lorem ipsum (alternative) #
@MattLoyeD
MattLoyeD / easy_serv_installer.sh
Last active Jan 7, 2017
Easy Mooty Web Server Setup (Ubuntu)
View easy_serv_installer.sh
###
#
# Easy Mooty Server installer
#
# wget http://gist.github.com/script_name.sh
# sudo sh script_name.sh
#
###
# Funcs #
@MattLoyeD
MattLoyeD / install_lamp_presta.sh
Last active Dec 28, 2016
Fast LAMP with prestashop
View install_lamp_presta.sh
sudo apt-get install php apache2 mysql-server mysql-client zip libapache2-mod-php php-json php-xml php-curl php-opcache php-intl php-intl php-mcrypt php-mysql php-zip php-gd php-mbstring sendmail php-mail;
sudo service apache2 restart;
cd /var/www/html/
wget https://download.prestashop.com/download/releases/prestashop_1.7.0.3.zip
unzip prestashop_1.7.0.3.zip ;
mv prestashop.zip html/ ;
cd html/ ;
unzip prestashop.zip;
sudo chmod 777 -R ./ ;
sudo a2enmod rewrite;
@MattLoyeD
MattLoyeD / cron_checkup.sh
Created Aug 27, 2016
Check website availability then reboot services if needed
View cron_checkup.sh
#runs a check of your website http code response (Bad gateway, empty response, or service off) every half minute then send sms if reboot via Free Mobile API
jobjob()
{
var=`curl -I http://www.zogzog.com/ 2>/dev/null | head -n 1 | awk -F" " '{print $2}'`
if [[ -z "$var" ]] || [ "$var" == "502" ] || [ "$var" == "324" ]
then
curl -I "https://smsapi.free-mobile.fr/sendmsg?user=___&pass=___&msg=$var%20Serv%20Autorestart%20!";
sudo service nginx restart; sudo service php7.0-fpm restart;
@MattLoyeD
MattLoyeD / super_backup.php
Last active Jan 29, 2016
Local to ftp backup (sql & files, limited by local or ftp timestamp or folder/file sizes).
View super_backup.php
<?php
$conf = array(
"backup_prefix" => "bc-",
"backup_dir" => dirname(__FILE__).'/backups/',
"backup_files" => true,
"backup_target_dir" => '/folder',
"keep_local_files" => true,
"local_backup_size_limit" => "80GB", // in what you want, like 1GB or 2MB
"local_backup_time_limit" => 7, // in days, 0 for no limit
@MattLoyeD
MattLoyeD / cron_save_sql_ftp.sh
Created Jul 18, 2013
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.
View cron_save_sql_ftp.sh
#!/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 / linux_shell_basic_commands.sh
Last active Dec 19, 2015
Linux Shell Basic Commands
View linux_shell_basic_commands.sh
# 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
@MattLoyeD
MattLoyeD / cron_save_files_ftp.sh
Created Jul 18, 2013
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.
View cron_save_files_ftp.sh
#!/bin/bash
echo "Backup in progress"
nowdate=`date '+%H%M-%m-%d-%Y'`
# your MySQL server's name
SERVER=domain.com
@MattLoyeD
MattLoyeD / cron_img.sh
Last active Dec 14, 2015
Image Optimizer for web (PNG & Jpg) Losslesly
View cron_img.sh
#! /bin/sh
# Usage "sh script.sh /path/to/check chmod"
# TODO : Mtime in find ...
if [ -z "$1" ]; then
DIR="`.`"
else
DIR="$1"
fi
You can’t perform that action at this time.