PHP / MYSQL / GIT / Magento / Html / CSS / Js Tips….

PHP / MYSQL / GIT / Magento / Html / CSS / Js Tips….

Please post and share your ideas on this Page…

13 Responses to “PHP / MYSQL / GIT / Magento / Html / CSS / Js Tips….”

  1. nithincninan Says:

    How do I make Git ignore file mode (chmod) changes?

    >>>>> git config core.fileMode false

    http://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-file-mode-chmod-changes

    thanks!
    Nithin Chacko Ninan
    nithincninan@gmail.com
    +919895382293

  2. nithincninan Says:

    How do I grant privileges in MySQL?

    grant all on *.* to ‘ user ‘@’%’ identified by ‘ pass ‘ with grant option;

    eg: grant all on *.* to ‘root_web1’@’%’ identified by ‘admin’ with grant option;
    eg: grant all on *.* to ‘root’@’%’ identified by ” with grant option;

  3. nithincninan Says:

    Extracting a *.tar.bz2 file?

    tar xjvf file.tar.bz2

  4. nithincninan Says:

    1. Set Date in Server….

    [root@corraserver01 ~]# date –set “Tue Jan 13 16:27:02 IST 2015”
    Tue Jan 13 16:27:02 IST 2015
    [root@corraserver01 ~]# date
    Tue Jan 13 16:27:04 IST 2015
    [root@corraserver01 ~]# date –set “Tue Dec 30 16:27:02 IST 2014”
    Tue Dec 30 16:27:02 IST 2014
    [root@corraserver01 ~]# date –set “Tue Jan 13 16:27:02 IST 2015”
    Tue Jan 13 16:27:02 IST 2015
    [root@corraserver01 ~]#

  5. Nithin Says:

    git archive dev | gzip > wor.tar.gz

  6. Nithin Says:

    Git export commamd

    git archive dev | gzip > filename.tar.gz

  7. Nithin Says:

    Display each sub-directory size in a list format using 1 line command

    : du -h –max-depth=1

  8. nithincninan Says:

    Warning: Your Magento folder does not have sufficient write permissions

    >>>>> go to Magento home directory and just give permissions for your web root.

    1) e.g. (in ubuntu) : sudo chown -R www-data .
    You could also change the permissions

    2) sudo chmod 777 -R downloader/*
    I hope it helps….

  9. nithincninan Says:

    Git: If you want to overwrite of local file from master branch to your branch, use the below comment in git
    >>>> git checkout origin/master <>

  10. nithincninan Says:

    GIT: Need to edit the most recent git commit use the below comment:

    >>>>>> git commit –amend -m “…..”

    Note: use -m if you want to wipe out the old message and use a new one

  11. Nithin Ninan Says:

    Mysql providing grant Privilage to other ip adderss:

    mysql> grant all on dbname.* to ‘user’@’192.168.1.%’ identified by ‘password’;
    Query OK, 0 rows affected (0.00 sec)

    mysql> flush privileges;
    Query OK, 0 rows affected (0.14 sec)

    mysql> quit
    Bye

    nithin@nithin-Vostro-260s:~$ netstat -tunlp | grep 3306
    (Not all processes could be identified, non-owned process info
    will not be shown, you would have to be root to see it all.)
    tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN –

    nithin@nithin-Vostro-260s:~$ sudo vi /etc/mysql/my.cnf

    change the below settings in /etc/mysql/my.cnf

    #bind-address = 127.0.0.1
    to
    bind-address = 0.0.0.0

    This is to provide the db/file access to all other ips

    nithin@nithin-Vostro-260s:~$ sudo service mysql restart
    mysql stop/waiting
    mysql start/running, process 31150
    nithin@nithin-Vostro-260s:~$

  12. Nithin Ninan Says:

    Switching php70 to php56 (if you are using mac inbuilt apache )

    1. brew install php56 –with-apache – which creates the proper file path /usr/local/opt/php56/libexec/apache2/libphp5.so.
    2. brew unlink httpd24 – uninstall brew apache

    3. brew unlink php70 – Disable php7
    4. brew link php56 – Enable php5

    Change your loaded config in apache configuration vi /etc/apache2/httpd.conf : LoadModule php5_module /usr/local/Cellar/php56/5.6.30_6/libexec/apache2/libphp5.so

    brew reinstall libtool –universal && brew unlink libtool && brew link libtool – if libtool is not set as universe, set to universal link:

    Check PHP -v version is changed to php7 to php5

    Note ****
    if you are using php brew apache use this link: https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions :

    – sudo apachectl stop
    – sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null

  13. Nithin Ninan Says:

    installing pEAR ON mAC OS – PHP5

    cd Cellar/
    Nithins-MacBook-Pro:Cellar nithincn$ curl -O http://pear.php.net/go-pear.phar
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 3510k 100 3510k 0 0 116k 0 0:00:30 0:00:30 –:–:– 164k
    Nithins-MacBook-Pro:Cellar nithincn$ sudo php -d detect_unicode=0 go-pear.phar
    Password:
    Cannot load Xdebug – extension already loaded

    Below is a suggested file layout for your new PEAR installation. To
    change individual locations, type the number in front of the
    directory. Type ‘all’ to change all of them or simply press Enter to
    accept these locations.

    1. Installation base ($prefix) : /usr/local/Cellar/php56/5.6.30_6
    2. Temporary directory for processing : /tmp/pear/install
    3. Temporary directory for downloads : /tmp/pear/install
    4. Binaries directory : /usr/local/Cellar/php56/5.6.30_6/bin
    5. PHP code directory ($php_dir) : /usr/local/Cellar/php56/5.6.30_6/share/pear
    6. Documentation directory : /usr/local/Cellar/php56/5.6.30_6/docs
    7. Data directory : /usr/local/Cellar/php56/5.6.30_6/data
    8. User-modifiable configuration files directory : /usr/local/Cellar/php56/5.6.30_6/cfg
    9. Public Web Files directory : /usr/local/Cellar/php56/5.6.30_6/www
    10. System manual pages directory : /usr/local/Cellar/php56/5.6.30_6/man
    11. Tests directory : /usr/local/Cellar/php56/5.6.30_6/tests
    12. Name of configuration file : /usr/local/etc/php/5.6/pear.conf

    1-12, ‘all’ or Enter to continue: 1
    (Use $prefix as a shortcut for ‘/usr/local/Cellar/php56/5.6.30_6’, etc.)
    Installation base ($prefix) [/usr/local/Cellar/php56/5.6.30_6] : /usr/local/Cellar/pear

    Below is a suggested file layout for your new PEAR installation. To
    change individual locations, type the number in front of the
    directory. Type ‘all’ to change all of them or simply press Enter to
    accept these locations.

    1. Installation base ($prefix) : /usr/local/Cellar/pear
    2. Temporary directory for processing : /tmp/pear/install
    3. Temporary directory for downloads : /tmp/pear/install
    4. Binaries directory : /usr/local/Cellar/pear/bin
    5. PHP code directory ($php_dir) : /usr/local/Cellar/pear/share/pear
    6. Documentation directory : /usr/local/Cellar/pear/docs
    7. Data directory : /usr/local/Cellar/pear/data
    8. User-modifiable configuration files directory : /usr/local/Cellar/pear/cfg
    9. Public Web Files directory : /usr/local/Cellar/pear/www
    10. System manual pages directory : /usr/local/Cellar/pear/man
    11. Tests directory : /usr/local/Cellar/pear/tests
    12. Name of configuration file : /usr/local/etc/php/5.6/pear.conf

    1-12, ‘all’ or Enter to continue: 4
    (Use $prefix as a shortcut for ‘/usr/local/Cellar/pear’, etc.)
    Binaries directory [$prefix/bin] : /usr/local/bin

    Below is a suggested file layout for your new PEAR installation. To
    change individual locations, type the number in front of the
    directory. Type ‘all’ to change all of them or simply press Enter to
    accept these locations.

    1. Installation base ($prefix) : /usr/local/Cellar/pear
    2. Temporary directory for processing : /tmp/pear/install
    3. Temporary directory for downloads : /tmp/pear/install
    4. Binaries directory : /usr/local/bin
    5. PHP code directory ($php_dir) : /usr/local/Cellar/pear/share/pear
    6. Documentation directory : /usr/local/Cellar/pear/docs
    7. Data directory : /usr/local/Cellar/pear/data
    8. User-modifiable configuration files directory : /usr/local/Cellar/pear/cfg
    9. Public Web Files directory : /usr/local/Cellar/pear/www
    10. System manual pages directory : /usr/local/Cellar/pear/man
    11. Tests directory : /usr/local/Cellar/pear/tests
    12. Name of configuration file : /usr/local/etc/php/5.6/pear.conf

    1-12, ‘all’ or Enter to continue:
    Beginning install…
    Configuration written to /usr/local/etc/php/5.6/pear.conf…
    Initialized registry…
    Preparing to install…
    installing phar:///usr/local/Cellar/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.4.2.tar…
    installing phar:///usr/local/Cellar/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.4.1.tar…
    installing phar:///usr/local/Cellar/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.10.3.tar…
    installing phar:///usr/local/Cellar/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.1.1.tar…
    installing phar:///usr/local/Cellar/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.4.2.tar…
    install ok: channel://pear.php.net/Archive_Tar-1.4.2
    install ok: channel://pear.php.net/Console_Getopt-1.4.1
    install ok: channel://pear.php.net/Structures_Graph-1.1.1
    install ok: channel://pear.php.net/XML_Util-1.4.2
    install ok: channel://pear.php.net/PEAR-1.10.3
    PEAR: Optional feature webinstaller available (PEAR’s web-based installer)
    PEAR: Optional feature gtkinstaller available (PEAR’s PHP-GTK-based installer)
    PEAR: Optional feature gtk2installer available (PEAR’s PHP-GTK2-based installer)
    PEAR: To install optional features use “pear install pear/PEAR#featurename”

    ******************************************************************************
    WARNING! The include_path defined in the currently used php.ini does not
    contain the PEAR PHP directory you just specified:

    If the specified directory is also not in the include_path used by
    your scripts, you will have problems getting any PEAR packages working.

    Would you like to alter php.ini ? [Y/n] : Y

    php.ini include_path updated.

    Current include path : .:
    Configured directory : /usr/local/Cellar/pear/share/pear
    Currently used php.ini (guess) : /usr/local/etc/php/5.6/php.ini
    Press Enter to continue:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s