Thursday, September 11, 2014

JavaScript Debug in WebStorm

To debug javascript in webstorm, we need google chrome extension After add this extension, follow the bellow step:

1. Go into 'Tool Bar' -> 'Edit Configuration' option.

2. Then Click on left most 'Plus Sign' and add 'Javascript Debug' 

           Edit the name field as you want! and then carefully add the path of your file file in the 'URL'  
Also change the 'Browser' Option into chrome.

That's all! Happy Debugging! 

Wednesday, September 03, 2014

Install xdebug for PHP5

I am going to install xdebug, please follow the bellow instruction:

1. Run this command in terminal:
          sudo pecl install xdebug

if you face problem like:
     
      Download of "pecl/xdebug" succeeded, but it is not a valid package archive
      Error: cannot download "pecl/xdebug"



Then try by the bellow command:
                   sudo pecl install -Z xdebug

2. After the command execution end, the build process complete with this command and you will see message in the terminal like bellow:

Build process completed successfully
Installing '/usr/lib/php5/20121212+lfs/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.2.5
configuration option "php_ini" is not set to php.ini location
You should add "zend_extension=xdebug.so" to php.ini


3. Then edit php.ini by the following command:

       sudo gedit /etc/php/apache2/php.ini

    and append like  bellow:

   zend_extension = /usr/lib/php5/20121212+lfs/xdebug.so

4. Then restart apache by the bellow command:

   sudo service apache2 restart


Or you may follow the xdebug wizard instruction:

                   http://www.xdebug.org/wizard.php

Sunday, June 08, 2014

Fix ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

When i had been working with nginx, i got the issue "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)" when i execute the following command:
$ mysql -u root 
Error 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
To Fix the issue, i performed the bellow command:
1. Stop mysqld deamons.
$ sudo service mysql stop
2. Go to mysql/bin directory
$ cd /usr/bin
3. Start mysql deamons with option.
$ sudo mysqld_safe --skip-grant-tables
4. Open another terminal and open a mysql session to execute this:
$ mysql
mysql> use mysql;
mysql> UPDATE user SET password=PASSWORD('YOUR_NEW_PASSWORD_HERE') WHERE user = 'root';
mysql> exit;
5. Now kill the mysqld_safe process and restart mysqld normally:  
$ sudo service mysql start
That's it. Now you can access the mysql console :)



Saturday, June 07, 2014

Fix: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

I have already apache web server installed. Then i am going to install nginx. After installation i gonna start nginx server but failed! and shows mw the following message:

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

The issue is arise due to apache web server. Because i already run this within port 80. So the issue is fixed when i stop apache web server process and then start  again nginx web server. I followed the bellow command in terminal:

sudo service apache2 stop

sudo service nginx start

The above fixed my issue!

Thursday, January 09, 2014

See What Version of a Package Is Installed on Ubuntu

To check which version of package is installed in your machine, you can use a simple terminal command which is given bellow:


           dpkg -s <packagename> 


For Example, i want to see the openssl pacakage version, so that the command will looks like:

          dpkg -s openssl


Monday, December 23, 2013

Current Git branch name in Terminal

To know which branch is active now, we need to check git status. But Here i describe a technique that enable your terminal to show current branch.

If you use linux for OS then just add the following code to .bashrc file in your home directory:

function fetch_git_branch () {
  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
 
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOR="\[\033[0m\]"
 
PS1="$GREEN\u@\h$NO_COLOR:\w$YELLOW\$(fetch_git_branch)$NO_COLOR\$ "
 
Once you put this code on the specified location, then you need to reload your .bashrc or re-enter your terminal window by closing previous window.

To reload .bashrc, follow this command:

source ~/.bashrc
  
Also, If your terminal is not default colour activated  when you open terminal window, then just add following line to the .bashprofile in your home directory:


[[ -s ~/.bashrc ]] && source ~/.bashrc
 
If you are on mac, you should put this code to .bash_profile in your home directory. For windows, it is set by default. No need to add extra care!

Saturday, November 30, 2013

Polymorphic use of Gmail Account

Last several month ago, i was busy with some module test which is developed by me and all test needs to different mail account to reproduce scenario that is arise on the production server. I initiate the test on staging server and use my gmail account.

My gmail account is: naim.cse07@gmail.com and i use it as different combination with "." and "+"  character like bellow:

  1. naim.cs.e.07@gmail.com
  2. na.im.cse.07@gmail.com     
  3. na+im.cse07@gmail.com       

To know more about that. please take a look at this llink http://gmailblog.blogspot.com/2008/03/2-hidden-ways-to-get-more-from-your.html