Enable logging in the Symfony production environment

To enable symfony logging edit the file apps/frontend/config/settings.yml
prod:
  .settings:
    logging_enabled:        on
edit apps/frontend/config/factories.yml
prod:
  logger:
    class: sfAggregateLogger
    param:
      level: debug

DoubleClick in IE

The normal sequence of events fired leading up to a doubleclick go as follows.
    • mousedown
    • mouseup
    • click
    • mousedown
    • mouseup
    • click
    • doubleclick
but in IE, if you doubleclick on a link, and image or any element, the events fired are:
    • mousedown
    • mouseup
    • click
    • mousedown
    • mouseup
    • click
    • doubleclick
Thats right, no second mousedown?, and no second click!
As a developer, if you are tracking mousedown, mouseup, and click events… you need to be aware of this because if your users doubleclick by accident any actions that are designed to “stop” onmouseup might try and reference something that wasn’t started… and if the onclick was being used to quit listening for example… that event may never fire.

How to configure HTTPS on Apache 2

Configure HTTPS on Apache 2
1. Create httpd.pem & httpd.key file
# mkdir /data/www/project/ssl/
# openssl req -new -x509 -days 365 -nodes -out /data/www/project/ssl/httpd.pem -keyout /data/www/project/ssl/httpd.key

fix unknown table engine innodb

Hệ thống đang hoạt động bình thường. Nếu xảy ra lỗi “unknown table engine ‘innodb’ ”. Xử lý như sau:
1. Kiểm tra innodb có hoạt động không?
mysql> SHOW VARIABLES LIKE 'have_innodb';
   +---------------+-------+
   | Variable_name | Value |
   +---------------+-------+
   | have_innodb   | NO   |
   +---------------+-------+
--> disabled.

How To Create an IE-Only Stylesheet

Target ALL VERSIONS of IE

<!--[if IE]>
               <link rel="stylesheet" type="text/css" href="all-ie-only.css" />
<![endif]-->

Target everything EXCEPT IE

<!--[if !IE]><!-->
               <link rel="stylesheet" type="text/css" href="not-ie.css" />
 <!--<![endif]-->

Run Crontab Every 5 Minutes, 10 minutes, Seconds, Hours, Days, Months

1. Execute a cron job every 5 Minutes
The first field is for Minutes. If you specify * in this field, it runs every minutes. If you specify */5 in the 1st field, it runs every 5 minutes as shown below.
*/5 * * * * /home/test/test.sh
In the same way, use */10 for every 10 minutes, */15 for every 15 minutes, */30 for every 30 minutes, etc.
2. Execute a cron job every 5 Hours
The second field is for hours. If you specify * in this field, it runs every hour. If you specify */5 in the 2nd field, it runs every 5 hours as shown below.
0 */5 * * * /home/test/test.sh
In the same way, use */2 for every 2 hours, */3 for every 3 hours, */4 for every 4 hours, etc.

Thống kê các bảng có dữ liệu lớn trong mysql


Thống kê các bảng có dữ liệu lớn trong mysql

Rất hữu ích khi cần thống kê để đánh partion.

SELECT table_name, table_rows, data_length, index_length, round(((data_length + index_length) / 1024 / 1024 / 1024 ),4) as `Size(G)` FROM information_schema.TABLES WHERE table_schema = 'your_db_name' ORDER BY DATA_LENGTH DESC;