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 | |
| class MyCompany_MyModul_Model_Observer | |
| { | |
| /** | |
| * | |
| * | |
| */ | |
| public function addDisableValidatFromKey(Varien_Event_Observer $observer) | |
| { |
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 | |
| $cfg = array( | |
| 'server' => 'mongodb://127.0.0.1:27017/?journal=false&w=1&wTimeoutMS=20000', | |
| 'db' => 'cm_cache', | |
| 'collection' => 'cm_cache' | |
| ); | |
| // set to timezone to UTC, like magento do this | |
| date_default_timezone_set('UTC'); |
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
| iptables -N ftpwhitelist | |
| iptables -A INPUT -j ftpwhitelist |
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 | |
| class Loewenstark_Layout_Model_Observer | |
| { | |
| // set loewenstark_layout.xml before local.xml | |
| public function addLayoutXml($event) | |
| { | |
| $xml = $event->getUpdates() | |
| ->addChild('loewenstark_layout'); | |
| /* @var $xml SimpleXMLElement */ |
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 | |
| define('DS', DIRECTORY_SEPARATOR); | |
| $xml = simplexml_load_file('app/etc/local.xml'); | |
| $mysql_user = (string)$xml->global->resources->default_setup->connection->username; | |
| $mysql_password = (string)$xml->global->resources->default_setup->connection->password; | |
| $mysql_dbname = (string)$xml->global->resources->default_setup->connection->dbname; | |
| $mysql_host = (string)$xml->global->resources->default_setup->connection->host; |
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 | |
| MYSQL_HOST=`xmllint --nocdata --xpath 'string(//config/global/resources/default_setup/connection/host)' app/etc/local.xml` | |
| MYSQL_PASS=`xmllint --nocdata --xpath 'string(//config/global/resources/default_setup/connection/password)' app/etc/local.xml` | |
| MYSQL_USER=`xmllint --nocdata --xpath 'string(//config/global/resources/default_setup/connection/username)' app/etc/local.xml` | |
| MYSQL_DB=`xmllint --nocdata --xpath 'string(//config/global/resources/default_setup/connection/dbname)' app/etc/local.xml` | |
| BACKUPDIR="$HOME/backups/sql" | |
| DIRNAME=`date +%Y-%m-%d`; | |
| GZIP=$(which gzip); |
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
| for ip in $(grep -ri Baidu /var/log/nginx/access.log | cut -f1 -d' ' | sort | uniq); do echo $ip && iptables -I INPUT -s $ip -j DROP; done | |
| for ip in $(grep -ri 200please /var/log/nginx/access.log | cut -f1 -d' ' | sort | uniq); do echo $ip && iptables -I INPUT -s $ip -j DROP; done | |
| for ip in $(grep -ri majestic12 /var/log/nginx/access.log | cut -f1 -d' ' | sort | uniq); do echo $ip && iptables -I INPUT -s $ip -j DROP; done | |
| for ip in $(grep -ri opensiteexplorer /var/log/nginx/access.log | cut -f1 -d' ' | sort | uniq); do echo $ip && iptables -I INPUT -s $ip -j DROP; done | |
| for ip in $(grep -ri seokicks /var/log/nginx/access.log | cut -f1 -d' ' | sort | uniq); do echo $ip && iptables -I INPUT -s $ip -j DROP; done |
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
| <FilesMatch "^(xmlrpc\.php|wp-trackback\.php)"> | |
| Order Deny,Allow | |
| Deny from all | |
| </FilesMatch> |
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 | |
| $installer = $this; | |
| /* @var Loewenstark_Dummy_Model_Resource_Setup $installer */ | |
| $installer->startSetup(); | |
| $mail = ''; | |
| $name = ''; | |
| $company = ''; | |
| $phone = ''; | |
| $fax = ''; |
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 | |
| if(php_sapi_name() != 'cli') | |
| { | |
| echo "only for cli!"; | |
| exit; | |
| } | |
| require 'app/Mage.php'; | |
| Mage::app('admin'); |