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
ErrorDocument 503 /maintenance.php | |
RewriteEngine On | |
#RewriteCond %{REMOTE_ADDR} !^111\.222\.333\.444$ #to ignore IP | |
RewriteCond %{REQUEST_URI} !\.(png|jpg)$ #you can add other extension like JS or whatever (to exclude the 503) | |
RewriteCond %{REQUEST_URI} !/maintenance.php$ #excluding the maintenance page itself | |
RewriteRule .* - [R=503,L] |
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
#!/bin/bash | |
# This will find ANY "base64" or "eval(" or "eval)" which are potentially a malware and write all output in detections.txt | |
# WARNING : This bash script need to be executed in the "infected" folder, like /var/www/ | |
find . -type f -exec grep -Hn "base64\|eval(\|eval)" '{}' \; &> detections.txt |
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
/* variable(s) */ | |
expireAfter1d = new Date(); | |
expireAfter1d.setDate(expireAfter1d.getDate() + 1); | |
/* fonctions */ | |
function getCookie(cname) { | |
var name = cname + "="; | |
var ca = document.cookie.split(';'); | |
for(var i=0; i<ca.length; i++) { | |
var c = ca[i].trim(); |
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 | |
$pattern = file_get_contents('fr_FR.txt'); | |
$fmt = new NumberFormatter('fr_FR', NumberFormatter::PATTERN_RULEBASED, $pattern); | |
echo $fmt->format(52450.00); | |
?> |
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
# Methode 1 | |
# block specific domains | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# match example.org/com etc... | |
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)?example\. [NC] | |
# rewrite to specific file | |
RewriteRule \.(gif|jpg|bmp|jpeg|png)$ http://example.org/bad.jpg [R,NC,L] | |
</IfModule> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Simple Leaflet Map</title> | |
<meta charset="utf-8" /> | |
<link | |
rel="stylesheet" | |
href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" | |
/> | |
</head> |
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/sysctl.conf - Configuration file for setting system variables | |
# See /etc/sysctl.d/ for additional system variables. | |
# See sysctl.conf (5) for information. | |
# | |
#kernel.domainname = example.com | |
# Uncomment the following to stop low-level messages on console | |
#kernel.printk = 3 4 1 3 |
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
# Enable OPcache | |
opcache.enable=1 | |
# The Memoru used by OPcache, default 64MB | |
# 128MB can ba good for 5 to 10 websites | |
opcache.memory_consumption=64 | |
# 4MB seem to be prety "low", 8MB or 16MB seem better for website with lot of same class/variables | |
# Quick "explanation" : if you have the string "foobar" 1000 times in your code, | |
# internally OPcache will store 1 immutable variable for this string and just use a pointer |
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 | |
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
# 301 --- articles/articles-4-13+les-resistances.php => articles/3-electronique/7-les-resistances/ | |
RewriteRule ^articles/articles-4-13\+les-resistances\.php$ /articles/3-electronique/7-les-resistances/? [L,R=301] |
OlderNewer