Debug queries with mytop
mytop is an mysql tool written in Perl to look at the database queries during runtime. This is how to debug queries with mytop. Installation apt-get install mytop Usage mytop -u USERNAME -pPASSWORD -d DATABASE
mytop is an mysql tool written in Perl to look at the database queries during runtime. This is how to debug queries with mytop. Installation apt-get install mytop Usage mytop -u USERNAME -pPASSWORD -d DATABASE
In most Linux distribution the nameservers are stored in the file /etc/resolv.conf So you can edit it via: $> sudo nano /etc/resolv.conf You will see something like that: nameserver 192.168.88.1 nameserver 0.0.0.0 As you can see all nameserver entries follow the pattern: nameserver IPADRESS When searching for an DNS-Server the list is processed top down. […]
Sometimes you’re working in a network that has multiple external IP’s that are multiplexed. So for Typo3 your IP seems to change with nearly every click. With the default configuration you’ll be kicked out every now and then. To get rid of this problem, you can add the following snipped to your /typo3conf/lLocalConfiguration.php or /typo3conf/AdditionalConfiguration.php: […]
$> mysql -u USEERNAME -p $> mysql> USE dbname3; # enter Database changed $> mysql> source ./relative_path_to_file.sql; # enter
To reset filepermissions of Magento, you can run these commands on shell from within the Magento root folder: $> #for magento 1.5+ $> find . -type f -exec chmod 644 {} \; $> find . -type d -exec chmod 755 {} \; //if shelluser for checkout != apacheuser => 775 $> chmod o+w var var/.htaccess […]
$> sed -i ‘s/old-word/new-word/g’ file
To generate a 1024 Bit encrypted SSH key you can use the following command: $> ssh-keygen -b 1024 -t rsa Normally the key is saved in ~/.ssh/id_rsa together with the corresponding public key (~/.ssh/id_rsa.pub). Attention: Make sure you can remember the paraphrase later on if you entered one.
Recently I had to call a PHP script within another script with some arguments. Normally you pass these parameters by GET or POST. But how to do it within another script? Here is how to run PHP script with parameters within another PHP script: //set arguments $_SERVER[‘argv’][1] = ‘-action’; $_SERVER[‘argv’][2] = ‘unsetMaintenanceMode’; $_SERVER[‘argv’][3] = ‘-initRedis’; $_SERVER[‘argv’][4] […]
To show the category IDs in the category tree under Catalog->Categories->Manage Categories you can rewrite Mage_Adminhtml_Block_Catalog_Category_Tree in an own module. You have to rewrite the method buildNodeName like this: /** * Get category name * * @param Varien_Object $node * @return string */ public function buildNodeName($node) { $result = $this->escapeHtml($node->getName()); if ($this->_withProductCount) { $result .= ‘ (‘ . $node->getProductCount() […]
You can define system config value defaults in your modules config.xml like that. <?xml version=”1.0″?> <default> <myconfig_group> <settings> <test>1</test> <cronjobs>0</cronjobs> <client>0813</client> <serviceprovider>117</serviceprovider> <pricelist></pricelist> </settings> <productexport> <lux_kategorie>21</lux_kategorie> <store_view_german>1</store_view_german> <store_view_english>12</store_view_english> </productexport> </myconfig_group> </default> This sets the default value for all stores. If you want to set default values for a special store (scope), you can do it […]