Wednesday, March 30, 2011

magento how to debug sql query

edit this file: lib/varien/Db/Adapter/Pdo/Mysql.php

protected $_debug = true;
protected $_logAllQueries = true;
protected $_debugFile = 'var/debug/sql.txt';

Tuesday, March 22, 2011

magento import export cms pages

mysqldump cms_page and cms_page_store tables

and restore to your destination database

Monday, March 14, 2011

Tuesday, March 8, 2011

mysql find all columns in a database

SELECT table_name, column_name from information_schema.columns WHERE column_name LIKE ’%searchTerm%’ AND table_schema = ‘yourDB’

Friday, March 4, 2011

sudo rm Operation not permitted, undeletable file

ever encounter such a file?
you can't even rm with root.

this file might be marked as immutable, to confirm, you can use lsattr to confirm, if you see an "i" then it's immutable, you can't even remove with root


use chattr -i
the one i had to use is: sudo chattr -s, sudo chattr -u, sudo chattr -a too then able to remove this file
then you can remove

Wednesday, March 2, 2011

Boot debian directly to terminal mode

remove gui on startup

update-rc.d -f gdm remove

then you can start gui, gnome desktop with command


reset, make gui on startup

update-rc.d -f gdm defaults

note, you need to use "gdm3" for debian squeeze

Tuesday, March 1, 2011

windows 7 partition is gone, after installing debian

try this first

sudo update-grub

how to install dual-boot with debian and windows 7

first thing you need to do is to free up some disk space, in windows 7, you can use the new "shrink volume" feature from windows 7 in disk management.

after that, use debian installation cd to boot, and you can use that free space you created from windows 7 to install debian