show table information

DESCRIBE table_name;
show Field from  table_name;
SHOW INDEX FROM table_name;

keepalived iptables config (vrrp protocol)

Don't forget to configure iptables to allow vrrp protocol between servers.

Example: 
# Allow keepalived
-I INPUT -i eth1 -d 224.0.0.0/8 -p vrrp -j ACCEPT
-I OUTPUT -o eth1 -d 224.0.0.0/8 -p vrrp -j ACCEPT
-I INPUT -i eth2 -d 224.0.0.0/8 -p vrrp -j ACCEPT
-I OUTPUT -o eth2 -d 224.0.0.0/8 -p vrrp -j ACCEPT

xampp: install & enable php_memcache on Window

1. Download the library that map with your PHP version.  (Ex: 5.6.x)

Download here: http://windows.php.net/downloads/pecl/releases/memcache/3.0.8/
- XAMPP run in 32 bit. So, I choose this file: php_memcache-3.0.8-5.6-ts-vc11-x86.zip

2. Unzip and copy 2 files: php_memcache.dll & php_memcache.pdb into "ext" folder of php.
Ex: my folder is "F:\xampp\php\ext"

3. Restart apache on XAMPP

4. Test :
    php -i | findstr "memcache"

Note: 
- If you see this warning message: "PHP Warning:  PHP Startup: memcache: Unable to initialize module".
Please check your PHP version, then try to download another "php_memcache" package.

AH01630: client denied by server configuration on mac os x

1. Configure vhost

sudo vi /Applications/XAMPP/etc/extra/httpd-vhosts.conf

Listen 8000
<VirtualHost localhost:8000>
        #ServerName test.com
        DocumentRoot "/Volumes/data/projects/magento/project1/"

        <Directory "/Volumes/data/projects/magento/project1/">
                Options Indexes FollowSymLinks IncludesNoExec
                AllowOverride All
                <LimitExcept GET POST HEAD >
                        Deny from all
                </LimitExcept>
                Require all granted
        </Directory>
</VirtualHost>

2. Configure httpd.conf 
- Load vhost configuration: find & uncomment line below: 
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
- Find & configure User and Group param as below
User yourUser
Group admin


xampp - php - install intl pecl extension on MAC (OSX)

Magento 2 (M2) require this extension of php for installation.
On window, just enable php_intl.dll but on MAC, it may be more difficult than i think :)

1. Check which php path
user$ which php

2. If you are using xampp on mac it should be
/Applications/XAMPP/xamppfiles/bin/php
but if its
/usr/bin/php
you need to change your OSx php

user$ PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}"
user$ php -v
PHP 5.6.24 (cli) (built: Aug 26 2016 05:57:56) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
user$ which php
/Applications/XAMPP/xamppfiles/bin/php

3. Install brew
user$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

4. Install icu4c
user$: brew install icu4c

5. Install autoconf
user$  brew install autoconf

6. Install Intl via PECL
user$ cd <your xampp path>/bin
user$ sudo ./pecl update-channels
user$ sudo ./pecl install intl

7. You can check if Intl was installed successfully
user$ cd <your xampp path>/bin
user$ ./php -m | grep intl  
# it return 'intl'

set proxy to run composer, npm, bower and git


Nodejs:
npm config set proxy http://192.168.193.23:3128
npm config set https-proxy http://192.168.193.23:3128

bower: lúc dùng bower install
set thêm trong file .bowerrc
{
"proxy":"http://192.168.193.23:3128",
"https-proxy":"http://192.168.193.23:3128"
}

git:
git config --global http.proxy 192.168.193.23:3128

Composer:
set HTTP_PROXY=http://192.168.193.23:3128
set HTTPS_PROXY=http://192.168.193.23:3128

Oracle Case Insensitive Sorts & Compares

Features of Oracle 10gR2 but this article is very useful for me. It explain very clearly about case insensitive
Here is the content of article
Thank you! Natalka Roshak.

To get us started, here's a simple sample table with a few rows in it.
SQL> select * from invoice_demo order by invoice_id
SQL> /

INVOICE_ID SUPPLIER_NAME
---------- ------------------------------
      1000 Max Books
      1001 MAX BOOKS
      1002 max books
      1003 janus pet supply