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
# /etc/nginx/conf.d/default.conf | |
# NEED https://gist.github.com/Hotfirenet/0d5fc63204ecf8f0022294c0825ab408 | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
... | |
if ($bad_referer) { |
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
map $http_referer $bad_referer { | |
hostnames; | |
default 0; | |
# Put regexes for undesired referers here | |
"~site_a_bloquer.com" 1; | |
} |
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
RewriteEngine on | |
#Regle a rajouter pas loin de RewriteEngine on | |
RewriteCond "%{HTTP_REFERER}" "site_a_bloquer.com" [NC] | |
RewriteRule \.(gif|GIF|jpg|JPG|bmp|BMP|jpeg|JPEG|png|PNG)$ http://hotfirenfw.cluster014.ovh.net/Je-suis-un-gros-encule.gif [L,R] |
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
SELECT COUNT(id_order) AS nbOrder | |
, SUM(total_paid_tax_incl) AS 'CA_TTC' | |
, DATE(date_add) AS 'Date' | |
, payment | |
FROM ps_orders | |
WHERE YEAR(date_add) = 2017 | |
GROUP BY DATE(date_add), payment |
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
#!/usr/bin/env bash | |
for f in *.jpg | |
do | |
mv -n "$f" "$(exiftool -d "%Y%m%d_%H%M%S" -CreateDate "$f" | awk '{print $4".jpg"}')" | |
done |
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
// Use [collaborateurs][/collaborateurs] | |
add_shortcode( 'collaborateurs', function () { | |
$search = "/@hotfirenet\.com$/i"; | |
$html = '<div id="collaborateurs" class="items">'; | |
//$users = get_users(); | |
$args = array( |
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
#!/usr/bin/env bash | |
docker rm $(docker ps -a -q) | |
docker rmi $(docker images -q) |
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 | |
/* | |
* Sources: | |
* http://blog.dev-net.fr/ajoutez-vos-propres-fonctions-a-smarty-depuis-un-module-prestashop/ | |
* http://www.smarty.net/forums/viewtopic.php?p=23628#23628 | |
*/ | |
if (!defined('_PS_VERSION_')) | |
exit; | |
class extend_prestashop_smarty extends Module |
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
/* Find on http://ready2gosoft.com/php/mysql-generate-random-string.html | |
USE SELECT genstring(ROUND((RAND() * (128-1))+1)); | |
USE SELECT CONCAT(genstring(ROUND((RAND() * (30-5))+5)), '@', genstring(ROUND((RAND() * (30-5))+5)), '.', genstring(ROUND((RAND() * (5-2))+2))); | |
*/ | |
DROP function if exists genstring; | |
delimiter $$ | |
CREATE FUNCTION genstring(in_strlen int) RETURNS VARCHAR(500) DETERMINISTIC | |
BEGIN |