Friday, February 28, 2014

Opencart: Required PHP extension for opencart

Install below extensions:

apt-get install php5-gd
apt-get install php5-curl
apt-get install php5-mcrypt

Thursday, February 27, 2014

SEO Checklist for making page public

Below checklist must be met before making any page public for website:

1. Title:
   It should be short. Use "-" to join keyword pairs. Title is read by customer in google search result so it must be very readable.

 Example:  Learn english - Online english mock tests - Brand Name

2. Description:
  It should be summary of page. Must contain keyword describing the page. It should be in proper language and not stuffed by keywords. It must contain at least 3 sentences or aleast 100 words.

3. canonical tag:
  It show what is primary url for content. It is must for all pages which are public

4. Follow and Index meta tags
   If you don't want page in google result then it must contain meta tag for "NO Index".

5. Keyword exercise: [Most Important]
  write down 5 keywords which are most relevant to page content. These keywords must be present in text of page multiple time.
 use below tool to find keyword relevant to  your page.

  http://internetmarketingengine.com/analyzer/analyzer-lite.php

   Golden questions to ask your self?
    Q1: should customer come on this page searching for above relevant keyword.
    Q2: Is URL of this page contain <most essence summary> and most important keyword to attract customer.


Other Tools:

http://www.wordtracker.com/

http://www.google.co.in/trends/


Rule of Thumb:

Never make a page public without knowing what were right keywords to describe this page.
   

6. URL
 It is most important. Always use .htaccess and UrlBuilder class to build good url.

7. Social Media engagement
  Page must have ways to share page content in social media and ways to get user comments. Facebook comment box is must for each page.

8. ID to indentify page. If a page is auto generated based on data then it must be based on ID.  Always pass ID alone URL to social media as title keep on changing due to modification.

9. 301 Redirect to latest canonical URL. If URL change , it should be 301 redirected to latest URL.

10. Authentic content indicator. use Google plus publisher id in header.

11. Pagination:
  use pagination meta tags as next or prev.

12. Use Responsive design using bootstrap. Each page must be responsive and Fluid and built using Bootstrap.



SEO Tips: How to handle paginated pages

Infinite scroll page is made “search-friendly” when converted to a paginated series -- each component page has a similar <title> with rel=next/prev values declared in the <head>.

Refer to: http://googlewebmastercentral.blogspot.in/2014/02/infinite-scroll-search-friendly.html


Thursday, February 20, 2014

Postfix setup on Ubuntu for GMail

Below steps worked 100% for me:

vim /etc/postfix/main.cf
add below to above:

relayhost = [smtp.gmail.com]:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_CAfile = /etc/postfix/cacert.pem smtp_use_tls = yes


vim /etc/postfix/sasl_passwd

[smtp.gmail.com]:587 USERNAME@gmail.com:PASSWORD

sudo chmod 400 /etc/postfix/sasl_passwd sudo postmap /etc/postfix/sasl_passwd

cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem

sudo /etc/init.d/postfix reload

source: https://rtcamp.com/tutorials/linux/ubuntu-postfix-gmail-smtp/

Monday, February 10, 2014

Ubuntu 12.10: How to fix evolution-calendar factory related crash

Run below query:

sudo apt-get --reinstall install evolution-data-server indicator-datetime unity-scope-gdocs



Sunday, February 9, 2014

PHP: How to check if key exists in array

php manual:

array_key_exists

(PHP 4 >= 4.0.7, PHP 5)
array_key_exists — Checks if the given key or index exists in the array

Description ¶

bool array_key_exists ( mixed $key , array $array )
array_key_exists() returns TRUE if the given key is set in the array. key can be any value possible for an array index.


GIT: How to git push to remote repo

You can update remote git using below method:

step 1: add remote git
 $git remote add <remote-git-nick-name> <remote git address>

ex: git remote  add rgit brmeena@remotegit.com:/var/remotegit/.git

step 2: git push rgit master


Note: run below command on remote server:
  git config receive.denyCurrentBranch ignore


Saturday, February 8, 2014

Ordering Mysql items multiple time in a query

Hint: below php statement

$query="select * from question_category_info where q_parent_category_id='$parent_id' ORDER BY priority DESC, q_category_name ASC";
       


Wednesday, February 5, 2014

android: customize text color using spannable string

use below hint:

SpannableString deleteStr = new SpannableString("Delete Question");
deleteStr.setSpan(new ForegroundColorSpan(Color.BLACK), 0, deleteStr.length(), 0);
menu.add(2, 2, 2, deleteStr);