This file contains hidden or 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
if ( !defined('SAVEQUERIES') && isset($_GET['debug']) && $_GET['debug'] == 'sql' ) | |
define('SAVEQUERIES', true); | |
if ( !function_exists('dump') ) : | |
/** | |
* dump() | |
* | |
* @param mixed $in | |
* @return mixed $in | |
**/ |
This file contains hidden or 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/sh | |
# Use it as sudoer for better results, not optimal I know | |
# Usage : cd /path && sudo sh wp-tools.sh deploy|update|push | |
# Deploy will go to dir and make databases updates along with chmod after git pull | |
# Update will update all components inside the wp install | |
# Push will create a commit and push it to origin/master | |
# Verify if wp cli is installed, installing if not | |
WP_FILE=/usr/local/bin/wp |
This file contains hidden or 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
# Please note : | |
# - This has only been tested on ubuntu 20.04 | |
# - You need to create a S3 Bucket and IAM credentials securely | |
# - This is based on the fact that your user is named "ubuntu" which might not be your case | |
# - Plotting k 32 = 101 Go as far as I remember. 100 of K32 = 10 TB kind of. | |
# This was costing a 550$/month on S3 last time I checked. | |
aws_access_key= | |
aws_secret_key= | |
bucket_name=my_bucket_name |
This file contains hidden or 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 | |
# $1 = Filename | |
# $2 = S3 Bucket Name | |
base=$(basename -- "$1") | |
extension="${base##*.}" | |
filename="${base%.*}" | |
# p720="./videos/720p/$filename.mp4" |
This file contains hidden or 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 | |
// Made this on production grade server (PHP FPM 7.2 & 7.4) and local PHP CLI 7.4 | |
// Solution 2 > Solution 1 | |
// Local cli 7.4 : Did solution1 in 7.2129311561584 seconds. Did solution2 in 4.0765311717987 seconds. | |
// Server 7.2 FPM : Did solution1 in 9.0072309970856 seconds. Did solution2 in 4.500275850296 seconds. | |
// Server 7.4 FPM : Did solution1 in 8.1211979389191 seconds. Did solution2 in 4.0727269649506 seconds. | |
// example code | |
function microtime_float() |
This file contains hidden or 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 | |
class FrontController extends FrontControllerCore | |
{ | |
public function init() | |
{ | |
if (Module::isInstalled('magicredirect') && Module::isEnabled('magicredirect')) { | |
require_once _PS_MODULE_DIR_.'magicredirect/magicredirect.php'; | |
$mod = new MagicRedirect(); |
This file contains hidden or 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
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; |
This file contains hidden or 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
#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; |
This file contains hidden or 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 | |
/** | |
* @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 | |
*/ |
This file contains hidden or 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
# 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) # |
NewerOlder