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
| using MySql.Data.MySqlClient; | |
| using Newtonsoft.Json; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace ConsoleApplication1 | |
| { |
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 | |
| # Backup all available databases | |
| USERNAME="root"; | |
| PASSWORD="password"; | |
| for DATABASE in `mysql -u${USERNAME} -p${PASSWORD} -e "SHOW DATABASES;"` | |
| do | |
| echo mysqldump --routines -u${USERNAME} -p${PASSWORD} ${DATABASE} \> ${DATABASE}.dmp; | |
| mysqldump --routines -u${USERNAME} -p${PASSWORD} ${DATABASE} > ${DATABASE}.dmp; |
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 | |
| ln -s /opt/lampp/bin/mysql /usr/local/bin/mysql | |
| ln -s /opt/lampp/bin/mysqldump /usr/local/bin/mysqldump | |
| ln -s /opt/lampp/bin/php /usr/local/bin/php | |
| ln -s /opt/lampp/lampp /usr/local/bin/lampp |
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 | |
| header('Content-Type: text/plain'); | |
| # Normal server environment | |
| ini_set('display_errors', 'Off'); | |
| error_reporting(0); | |
| $test = 'TEST VALUE'; | |
| function test() |
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
| SELECT | |
| table_name, | |
| ROUND(KBS/POWER(1024,1), 2) KBs, | |
| ROUND(KBS/POWER(1024,2), 2) MBs | |
| FROM | |
| ( | |
| SELECT | |
| table_name, SUM(index_length) KBS | |
| FROM information_schema.tables | |
| WHERE |
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 | |
| namespace cases; | |
| use PHPUnit\Framework\TestCase; | |
| class PhpIniConfigurationsTest extends TestCase | |
| { | |
| /** | |
| * Most common configurations | |
| */ |
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
| USE test; | |
| DROP TABLE IF EXISTS apache_logs; | |
| CREATE TABLE apache_logs ( | |
| log_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Log ID', | |
| processing_time INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Processing time in milliseconds', | |
| http_status INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'HTTP status code', | |
| request_method VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Request URL (GET/POST)', | |
| access_url TEXT NOT NULL COMMENT 'URLs accessed', | |
| PRIMARY KEY (log_id) |
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 | |
| header('Content-Type: text/plain'); | |
| /** | |
| * Build an array to loop. | |
| */ | |
| $time0 = microtime(true); | |
| for($i=9999; $i>0; --$i) | |
| { | |
| $values[] = null; |
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
| [XDebug] | |
| ; Debug: http://localhost/?XDEBUG_SESSION=debug | |
| ; Trace: http://localhost/?XDEBUG_TRACE=debug | |
| ; Profile: XDEBUG_PROFILE cookie | |
| ; | |
| ; http://localhost/?XDEBUG_SESSION=debug&XDEBUG_TRACE=debug&XDEBUG_PROFILE=debug | |
| ; | |
| ; Firefox Plugin: The easiest Xdebug - by - Nikita Nikitin | |
| ; https://addons.mozilla.org/en-US/firefox/addon/the-easiest-xdebug/ | |
| ; |
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
| class trap | |
| { | |
| public static function parameters($mixed) | |
| { | |
| file_put_contents('/tmp/parameters-'.date('YmdH').'.log', "\r\n\r\n".print_r($mixed, true), FILE_APPEND); | |
| } | |
| public static function sql($mixed) | |
| { | |
| file_put_contents('/tmp/sql-'.date('YmdH').'.log', "\r\n\r\n".print_r($mixed, true), FILE_APPEND); |