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

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

reason:
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

solution:

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


startx

reset, make gui on startup


update-rc.d -f gdm defaults


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