Skip to main content

Posts

Showing posts from April, 2016

[magento] remove order

require 'app/Mage.php'; Mage::app('admin')->setUseSessionInUrl(false);                                                                                                         //replace your own orders numbers here: $test_order_ids=array(   '100000127', ); foreach($test_order_ids as $id){     try{         Mage::getModel('sales/order')->loadByIncrementId($id)->delete();         ech...

Browser User Agent List

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36 Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0 Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36 Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36 Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0 Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0;...

[mongo] How to resolve transparent_hugepage issue

Open   /etc/init/mongod.conf   file. Add the lines below immediately after   chown $DEAMONUSER /var/run/mongodb.pid   and before   end script . Restart   mongod   ( service mongod restart ). Here are the lines to add to   /etc/init/mongod.conf : if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled fi if test -f /sys/kernel/mm/transparent_hugepage/defrag; then echo never > /sys/kernel/mm/transparent_hugepage/defrag fi

[ubuntu] unity

You just need to turn the Unity plugin back on. The problem is this is a pain in the bottom because you've now got no graphical method to do this. So: Try to open a terminal with   Ctrl + Alt + T . This may not work but you can try right clicking on the desktop and selecting "Open terminal here." Otherwise, you may need to change to a "hard" terminal by pressing   Ctrl + Alt + F1 and log in. Install   compizconfig-settings-manager   by running sudo apt-get install compizconfig-settings-manager Then run it with this: DISPLAY=:0 ccsm

[magento] to retrieve all categories

<?php define('MAGENTO', realpath(dirname(__FILE__))); require_once MAGENTO . '/../web/app/Mage.php'; Mage::app(); $category = Mage::getModel('catalog/category'); $tree = $category->getTreeModel(); $tree->load(); $ids = $tree->getCollection()->getAllIds(); $categories = array(); $result = array(); if ($ids) {     foreach ($ids as $id) {         $category->load($id);         $categories[$id]['name'] = $category->getName();         $categories[$id]['path'] = $category->getPath();     }     foreach ($ids as $id) {         $path = explode('/', $categories[$id]['path']);         $string = '';         foreach ($path as $pathId) {             $string.= $categories[$p...