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 / 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 / kill_screens.sh
Created Jul 19, 2015
Kill all screen detached sessions
View kill_screens.sh
#!/bin/sh
# This line kills everething, be carefull, maybe do a screen -ls first to watch what is running
screen -ls | grep -o '[0-9]*\.[a0-Z9]*' | while read -r v ; do screen -X -S $v quit; done
View Aftership-auto-delivered-prestashop-update.php
<?php
ini_set("allow_url_fopen", "1");
require_once(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../init.php');
// Put your API Key here
$api_key = "";
$state_in_transit = Configuration::get('PS_OS_SHIPPING');
View Change Logo in Wordpress theme
<?php
// Add to functions.php
add_action('login_head', 'custom_wp_login_logo');
function custom_wp_login_logo() {
echo '<style type="text/css">
h1 a {
background-image:url('. get_bloginfo( 'template_directory' ) .'/img/logo_backoffice.jpg) !important;
View Facebook + Twitter Fan Count
<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 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
View Cookieless domain
<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
View Recup mdp prestashop admin
=> 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 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 / 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
You can’t perform that action at this time.