Using a source PNG image with dimensions of 144x144, which will be our apple-touch-icon
used for Apple iOS and tablet devices.
$ convert -resize 32x32 -colors 256 favicon.png favicon.ico
Markup for HTML page <head>
area:
IgnoreAgent +http://www.baidu.com/search/spider.html) | |
IgnoreAgent ; 360Spider | |
IgnoreAgent ; Claritybot) | |
IgnoreAgent ; Google Web Preview) | |
IgnoreAgent ; Googlebot | |
IgnoreAgent www.webwombat.com.au | |
IgnoreAgent Aboundex/* | |
IgnoreAgent Apache-HttpAsyncClient/* | |
IgnoreAgent Apache-HttpClient/* | |
IgnoreAgent AppEngine-Google* |
IgnoreAgent +http://www.baidu.com/search/spider.html) | |
IgnoreAgent ; 360Spider | |
IgnoreAgent ; Claritybot) | |
IgnoreAgent ; Google Web Preview) | |
IgnoreAgent ; Googlebot | |
IgnoreAgent Aboundex/* | |
IgnoreAgent Apache-HttpAsyncClient/* | |
IgnoreAgent Apache-HttpClient/* | |
IgnoreAgent AppEngine-Google* | |
IgnoreAgent Baiduspider* |
PHP script that takes a mysqldump file and brute force replaces URLs into an output dump file.
Ensure to dump the source SQL database using the --skip-extended-insert
switch to ensure INSERT INTO()
statements don't end up on singular and very long lines, which won't help the script crunch all the replacements.
E.g.
$ mysqldump \
-hlocalhost -uUSERNAME -p \
<?php | |
$testExpression = '/(?i)te(?-i)st/'; | |
testPCRESectionOnly($testExpression,'test'); | |
testPCRESectionOnly($testExpression,'TEst'); | |
testPCRESectionOnly($testExpression,'teST'); | |
testPCRESectionOnly($testExpression,'TEST'); | |
/* | |
Should return: |
<?php | |
function generateRandString() { | |
$randString = ''; | |
while (strlen($randString) < 32) { | |
// generate a character between 0-9 a-f | |
$character = mt_rand(0,15); | |
if ($character > 9) $character += 39; | |
$randString .= chr($character + 48); | |
} |
<?php | |
function isValidEmailAddress($email) { | |
return ( | |
(preg_match('/^[^\r\n\t]+@[^\r\n\t ]+\.(?i)[a-z]{2,10}$/',$email)) && | |
(count($partList = explode('@',$email)) == 2) && | |
(!preg_match('/\.{2}/',$partList[1])) | |
); | |
} |
location / { | |
try_files $uri /framework/main.php?url=$uri&$query_string; | |
} | |
error_page 404 /assets/error-404.html; | |
error_page 500 /assets/error-500.html; | |
location ^~ /assets/ { | |
sendfile on; | |
try_files $uri =404; |