Friday 20 November 2015

Upgrade Mysql version 5.6.0 or later ubuntu upgrade

For 14.04 users:

Ubuntu 14.04 defaults to MySQL 5.5, but also has MySQL 5.6 available for installation from the universe archive. Installing 5.6 is as easy as specifying the version:
myuser@mypc:~$ sudo apt-get purge mysql-server-5.5 mysql-client-5.5
myuser@mypc:~$ sudo apt-get autoremove
myuser@mypc:~$ sudo apt-get install mysql-server-5.6 mysql-client-5.6
If you have existing data in a MySql 5.5 database, it should be migrated automatically. Though it is always a good idea to make a backup before doing a major upgrade.

First make a backup of the data in your existing database:

mysqldump --lock-all-tables -u root -p --all-databases > dump.sql
Then after installing the newer version, you can restore if needed by running:

mysql -u root -p < dump.sql 

Tuesday 17 November 2015

How to upload a project to Github





  1. cd var/www/html/github/my-first-pro/
  2. git add .
  3. git commit -m "adding files". -m
  4. git commit -m "adding files". -a
  5. git remote add origin https://github.com/Kanasagra-Jaydip/my-first-pro.git
  6. git push -u origin master

Here is how you would do it in Windows:
  1. If you don't have git installed, see this article on how to set it up.
  2. Open up a Windows command prompt.
  3. Change into the directory where your source code is located in the command prompt.
  4. First, create a new repository in this directory git init. This will say "Initialized empty git repository in ....git" (... is the path).
  5. Now you need to tell git about your files by adding them to your repository. Do this with git add filename. If you want to add all your files, you can do git add .
  6. Now that you have added your files and made your changes, you need to commit your changes so git can track them. Type git commit -m "adding files". -m lets you add the commit message in line.
So far, the above steps is what you would do even if you were not using github. They are the normal steps to start a git repository. Remember that git is distributed (decentralized), means you don't need to have a "central server" (or even a network connection), to use git.
Now you want to push the changes to your git repository hosted with github. To you this by telling git to add a remote location, and you do that with this command:
git remote add origin https://github.com/yourusername/your-repo-name.git
Once you have done that, git now knows about your remote repository. You can then tell it to push (which is "upload") your commited files:
git push -u origin master

How to add grouped products in Magento



In Magento, you can easily create a grouped product. Customers can choose this grouped product to buy all products in group or only buy some of the associated products.

Step 1: Login to your Magento Admin Panel, go to Catalog -> Manage Products




Step 2: On Manage Products page, choose Add Product



Step 3: In Product Type drop-down menu, choose Grouped Product option and then click Continue



Step 4: You should fill all necessary information and settings for this grouped product. Most of settings and information are configured in the same way as they are configured when add a simple product. There only have some differences in weight and price because they are managed by the products that are added into group. Besides, you should mark the checkbox of products you want to add to the grouped product in Associated Products



Finally, you should click Save button

How to Create Creditit Memo in Magento

Once transaction is processed and invoice created, you need to create credit memo if you want to refund the customer. In Magento, the best way to do it is to open order in question and go to the invoice list on the left side of the order form. Click on an invoice you want to refund. Invoice detail information will appear. Now click on 'Credit Memo...' button on top of the form. - See more at: http://www.magedevelopers.com/blog/magento-tutorials/refund-credit-memo-creation-magento/#sthash.R7HV0Ur1.dpuf

In list of products, you can choose quantity to refund and return to stock. Maximum qty is added by default. Additionally, you can specify 'Refund Shipping' amount and adjustment amounts which are added or subtracted from refund total. - See more at: http://www.magedevelopers.com/blog/magento-tutorials/refund-credit-memo-creation-magento/#sthash.R7HV0Ur1.dpuf

When you are satisfied with amount to refund, you can continue with credit memo process. There are two ways to refund, offline and online. Online refund is used if transaction is made through Authorize.net or similar payment gateway. This way Magento will try to automatically refund the customer credit cart trough gateway API. If you choose to refund custom by using offline refund it will only create internal Magento credit memo and not contact any payment gateway. This method is used for check / money transfers or if you used 'Authorize Only' payment type. Using this credit memo type will allow you to continue with Magento order process, but you will have to refund the money to customer manually trough payment gateways website if one is used. - See more at: http://www.magedevelopers.com/blog/magento-tutorials/refund-credit-memo-creation-magento/#sthash.R7HV0Ur1.dpuf

In list of products, you can choose quantity to refund and return to stock. Maximum qty is added by default. Additionally, you can specify 'Refund Shipping' amount and adjustment amounts which are added or subtracted from refund total. - See more at: http://www.magedevelopers.com/blog/magento-tutorials/refund-credit-memo-creation-magento/#sthash.R7HV0Ur1.dpuf

Once transaction is processed and invoice created, you need to create credit memo if you want to refund the customer. In Magento, the best way to do it is to open order in question and go to the invoice list on the left side of the order form. Click on an invoice you want to refund. Invoice detail information will appear. Now click on 'Credit Memo...' button on top of the form. - See more at: http://www.magedevelopers.com/blog/magento-tutorials/refund-credit-memo-creation-magento/#sthash.R7HV0Ur1.dpuf
Once transaction is processed and invoice created, you need to create credit memo if you want to refund the customer. In Magento, the best way to do it is to open order in question and go to the invoice list on the left side of the order form. Click on an invoice you want to refund. Invoice detail information will appear. Now click on 'Credit Memo...' button on top of the form. - See more at: http://www.magedevelopers.com/blog/magento-tutorials/refund-credit-memo-creation-magento/#sthash.R7HV0Ur1.dpuf
Once transaction is processed and invoice created, you need to create credit memo if you want to refund the customer. In Magento, the best way to do it is to open order in question and go to the invoice list on the left side of the order form. Click on an invoice you want to refund. Invoice detail information will appear. Now click on 'Credit Memo...' button on top of the form. - See more at: http://www.magedevelopers.com/blog/magento-tutorials/refund-credit-memo-creation-magento/#sthash.R7HV0Ur1.dpuf

Friday 6 November 2015

Disable mod_rewrite for subdirectory OR Set Apache Password Protected Directories With .htaccess File OR API Protected


If you don't know the username and password to enter, then you can't access the page or site - it's "password protected". It's sometimes handy to be able to password protect your pages like this - for example:


  1. You're building a new site, but you only want yourself (and maybe a select few) to be able to view the work-in-progress.
  2. You have an area of your site that you never want the general public to have access to - for example, your web stats or private pages.
  3. You have some paid (subscription) content on your site that only subscribers should be able to access.
  4. Apache lets you password protect individual files, folders, or your entire site fairly easily. Read on to find out how it's done.


  1. Create a special file called .htaccess in the folder you want to protect.
ErrorDocument 401 "Unauthorized"
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /home/*/public_html/directory/.htpasswd
require user myusername_same_as_.htpasswd_file
     2. Creating the password file Called .htpasswd
The first step is to create a simple text file that will store your username and password, separated by a colon (:). The small catch is that the password must be encrypted. Luckily, there are many free web-based utilities that will encrypt the password for you. Try one of these:
myusername_same_as_.htaccess_file:$apr1$TSQAiMQm$MIJ.m3qpJ3mnY6NXdzppz.