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
http://wi-fizzle.com/downloads/base64.sql | |
Corrections at: http://stackoverflow.com/questions/358500/base64-encode-in-mysql | |
Urlencode/urldecode As MySQL Stored Functions | |
http://www.dzone.com/snippets/urlencodeurldecode-mysql | |
http://jeremythomerson.com/2013/05/30/urlencoder-function-for-mysql/ |
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 | |
$path = '/home/USER/public_html'; | |
function resources($path) | |
{ | |
$resources = array( | |
'file' => $path, | |
'href' => array(), | |
'src' => array(), | |
'success' => false, |
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 | |
ini_set('log_errors', 'On'); | |
ini_set('display_errors', 'On'); | |
ini_set('error_log', dirname(__FILE__).'/error_log'); | |
error_reporting(E_ALL|E_STRICT); | |
?> |
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 /PATH -type f -name "*.php" -size +50 > /tmp/large-scripts.log |
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 CONCAT('DROP TRIGGER `', trigger_name, '`;') FROM information_schema.triggers WHERE trigger_schema = 'DATABASE_NAME'; |
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 | |
/** | |
* Converts YYYY-MM-DD format into DD/MM/YYYY | |
*/ | |
function _dmy($yyyymmddhhiiss='0000-00-00 00:00:00') | |
{ | |
$date = substr($yyyymmddhhiiss, 0, 10); | |
list($yyyy, $mm, $dd) = explode('-', $date); | |
$dmy = "{$dd}/{$mm}/{$yyyy}"; | |
return $dmy; |
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 | |
header('Content-Type: text/plain'); | |
$path = '/home/USER/public_html'; | |
chdir($path); | |
$files = glob('*.php'); | |
$total = 0; | |
$catches = 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
<?php | |
function md5_dir($path='/tmp') | |
{ | |
global $counter; | |
global $skip_directories; | |
global $skip_extensions; | |
$handle = opendir($path); | |
while(false!==($file=readdir($handle))) | |
{ | |
if(in_array($file, $skip_directories)) continue; |
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
CREATE TABLE `_dt` ( | |
`dt` DATETIME DEFAULT NULL | |
); | |
DROP EVENT IF EXISTS e_minutely; | |
DELIMITER $$ | |
CREATE EVENT e_minutely | |
ON SCHEDULE | |
EVERY 1 MINUTE |
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 ENCODE('mytext', 'mykey'); | |
SELECT AES_ENCRYPT('mytext', 'mykey'); | |
SELECT DECODE(ENCODE('mytext', 'mykey'), 'mykey')='mytext' ok; | |
SELECT AES_DECRYPT(AES_ENCRYPT('mytext', 'mykey'), 'mykey')='mytext' ok; |