Sunday, December 30, 2012

Copy to multiple destination

We can't copy a single file to multiple destination with just a single cp command. But we have a workaround.
If we want to copy a single file to multiple destination folders, then just follow the below command:
echo dir1 dir2 dir3 | xargs -n 1 cp file1


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to fix WARNING: You are not using an encrypted connection

There was an warning message on drupal.
WARNING: You are not using an encrypted connection, so your password will be sent in plain text. Learn more.

How to fix
To fix the above warning message, we need to change the permission and ownership of the file.
type this command:
chown www-data:www-data -R /var/www/drupal(or your drupal web root name)/sites



See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Git remote repo address

We can get the remote repository address with the below git command:
git remote show origin



See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to fix “The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.”

We are getting error with ckfinder in drupal. It was showing the below error message:
The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.

    Follow the below steps to solve this problem.
  • 1. Open settings.php file: drupal_site_name/sites/default/settings.
  • 2. Uncomment “$cookie_domain = ‘example.com’;” and give your domain name. eg: $cookie_domain = ‘localhost’;


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

failed to load java vm library in OpenProj

We have set java jre. But still it was showing the message:
failed to load java vm library in OpenProj

Later we found that we have install jre for 64bit on a windows7. So, OpenProj couldn't find the java jre path. We have found that OpenProj runs on 32bit machine. So, we need to install java jre for 32 bit machine.
To edit the path, we need to go to the below path to edit OpenProj configuration file.
  • go to this path: C:\Users\tahsin.hasan\AppData\Roaming\OpenProj\{13702021-43FB-480C-912F-D9B74A538288}
  • Set the java jre to 32bit(x86) path.


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

unwanted <p> tag in drupal content

I found there was some unwanted

tags coming into the drupal contents. To solve this issue, I followed the steps below:

  • go to configure.
  • > content authoring
  • > text formats
  • > configure
  • > uncheck convert line breaks to <br>, <p> tags


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Same cookie deletion problem

Two cookies will be identical if they have same cookie name, domain & path. For example,
setcookie('a','value','/','www.example.com'); 
setcookie('a','value','/','example.com'); 

The above two cookie variable are not same. Their domain name is different.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

how to update svn in mac?

We will follow the below steps to upgrade our svn version on mac machine.
  • In Terminal, type "svn --version" to find out what version you currently have.
  • Install macports and using macports install svn. this will install the latest svn into your system.
  • Got to your terminal and check your $PATH by typing "echo $PATH". If you don't see /opt/subversion/bin in there, make sure you add it by typing export PATH=/opt/subversion/bin:$PATH. If it DOES exist and appears AFTER /usr/bin, then you may need to remove an older copy of svn that came installed on OS X. To do so, go to /usr/bin and remove all files starting with svn. This isn't an exact science but it should do the trick.
  • Make sure you reload your .profile first by typing . ./.profile* or you can close the terminal and reopen again. also you can type source .profile. this will also reload profile.
  • Type "svn --version". You should see that you have the newest version installed!


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Missing table borders in FF

I was working on displaying a report on a website. I was applying a border to the table cells. some of the cells are not displaying border on firefox. But they are ok with other browsers.

Then I apply the below code block for table property:
table{
border-collapse: separate;
border-spacing: 0;
}


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Saturday, December 29, 2012

how to install apache mpm worker

Apache mpm worker is a multi-preprocessing module of apache. By default Apache runs with mpm prefork. If you install worker type of multiprocessor, then it will uninstall the prefork module from the system.
By installing mpm worker process, it will uninstall the php5 process for apache. you need to use fastcgi for working with worker thread.
To install worker thread, type the following commands:
sudo apt-get install apache2-mpm-worker


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Friday, December 28, 2012

Integrate Xcode with Corona SDK

    Follow these steps to integrate XCode 3.x with Corona SDK. NOTE: Not suitable for XCode4.0
  • 1. Launch XCode, Create a new project, “File” > “New Project”
  • 2. Template for project should be “Other” > “External Build System” and give the project a name and save it.
  • 3. Under “Targets” in the left hand “Groups & Files” window in the main xcode editing window, then double click “Your Projects Name”
  • 4. Remove all the “Build Settings”, dont know what they did but removing them didnt hurt
  • 5. In “Build Tool” enter the path to either the “simulator” link or the “Corona Terminal” app just so you know, if you put the Corona folder in your Applications folder the the paths are as follows “/Applications/CoronaSDK/Corona Terminal” .
  • 6. Under “Arguments” enter “$(PROJECT_DIR)”, this passes the location of the folder, what Corona looks for, to the simulator so it launches and builds the app without asking for the location of the project folder
  • 7. Right click on the top of the main xcode window, the toolbar, and select “Customize Toolbar” and add the “Build” icon to the bar and click “Done”
  • 8. Clicking the “Build” icon will now launch your application in Corona
  • 9. If the corona simulator is already on and you save changes to the main.lua file, the simulator will prompt you to reload the lua file.
  • 10. The project directory must contain a file that goes by the name of ‘main.lua’, this file can link itself to other modules.
  • 11. Place Lua.pbfilespec and Lua.xclangspec in: ~/Library/Application Support/Developer/Shared/Xcode/Specifications/ and/or /Developer/Library/Xcode/Specifications/ http://f3gamesig.pbworks.com/w/file/42079531/Lua.pbfilespec http://f3gamesig.pbworks.com/w/file/42079528/Lua.xclangspec
  • 12. reboot Xcode.
NOTE: If the directories don’t exist create them.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Sunday, December 23, 2012

How to remove Clamav

To remove clamav from ubuntu, type the below commands:
sudo apt-get --purge remove clamav clamav-base clamav-daemon clamav-freshclam libclamav2

Clamav anti virus takes some memory as it continuously checks for virus database update. It takes slows down server.


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Saturday, December 22, 2012

session.gc_maxlifetime value

This value (default 1440 seconds) defines how long an unused PHP session will be kept alive. For example: A user logs in, browses through your application or web site, for hours, for days. No problem. As long as the time between his clicks never exceed 1440 seconds. It's a timeout value. PHP's session garbage collector runs with a probability defined by session.gc_probability divided by session.gc_divisor. By default this is 1/100, which means that above timeout value is checked with a probability of 1 in 100. session.cookie_lifetime This value (default 0, which means until the browser's next restart) defines how long (in seconds) a session cookie will live. Sounds similar to session.gc_maxlifetime, but it's a completely different approach. This value indirectly defines the "absolute" maximum lifetime of a session, whether the user is active or not. If this value is set to 60, every session ends after an hour a minute.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Sunday, December 2, 2012

How to Check What's Using Port 80 or 443

I am using Xampp. And Apache runs on port 80. When I install Skype or some other HTTP services, then it also runs on the same port. Hence, Apache can't run on this machine. So, I need to check which port is running on that port. To check this, need to do the followings:
  • 1) Go to START-->Run and type cmd to bring up a Command prompt.
  • 2) In the Command Prompt window. type netstat -aon.
  • 3) Open up the Windows Task Manager
  • 4) Then stop the process ID that was running on port 80.


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

files & folder permission in linux server

We will set the appropriate file permission on the files and folders on the server. Below is the standard file permission settings.
files - 640
folder - 755

If you want to change the folder permission for all the subfolders, then run the below command:
chmod 0755 * $(find . -type d) -R
If you want to change the file permission for all the subfolders, then run the below command:
chmod 0640 * $(find . ! -type d) -R


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

size and daily/weekly/monthly not work together in logrotator

I have configured the logrotate file. And I have noticed that for some reason, my logrotate is not working. When I googled, I found that if you set the size value and the period together, they won't work.
The size and daily option don't work together in logrotate. So, I removed the period option and left the size option only, then it worked like a charm.
size 10K


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to remove v9 from Firefox/ crome / and any other browser,

Every time, I opened up a new window, it brings the below url:
www.v9.com/us/newtab
This is very much annoying. I need to remove it. I searched google and came up with the following solution:
  • Go to your control panel
  • uninstall program
  • their scroll down you will see one application without any image named new tab uninstaller and publisher elec software uninstall this bug and boom, everything is normal now.
  • now just for confirmation check your homepage is set to default or what ever u like.


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Error: bad username; while reading /etc/crontab

This error means we haven't set up the username on the crontab for a cron job. you need to define the username before the command section. Like the following:
0 1 * * *  root /var/www/ispcp/engine/backup/ispcp-backup-all yes &>/var/log/ispcp/ispcp-backup-all-mngr.log


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

how to debug crontab

If you want to see the status of your crontab or see why your cronjob is not running, then run the below command:
cat syslog | grep cron

Crontab related errors are written on the syslog file. So, we can get related information from there.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Location picker in Joomla! mobile

We find our location on google map using searches. jQuery comes with a nice plugin to get the location on google map using search. The below mentions the procedures to follow:
  • We use this site’s http://webcoda.co.uk/2010/10/the-jquery-location-picker/ plugin for this purpose.
  • We get the required javascript file from http://code.google.com/p/locationpicker/.
  • Place the javascript file under /templates/mobile_pda/resources/scripts.

You will see rest of the steps with images on the Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Lavalamp menu in Joomla! mobile

Now we are going to add lavalamp menu to our site. Let’s discuss it’s integration process here:
  • We get a discussion on the lavalamp menu plugin on http://www.geektantra.com/2010/02/jquery-sliding-menu/.
  • We go to this site to download the related files for this plugin: http://www.geektantra.com/. We get the styles, scripts and images files.
  • Now take the script files, jquery.sliding-menu.js to /templates/mobile_pda/resources/scripts.
  • We add horizontal and vertical menu here. We have different styling for them. So, we define different ids.

You will see rest of the steps with images on the Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Styling dropdown in Joomla! mobile

We apply styling to our select box. We use some jquery plugin to style our select boxes.Let’s discuss the steps to integrate the plugin:
  • We use http://jamielottering.github.com/DropKick/ to style our select box.
  • First download the files from http://github.com/JamieLottering/DropKick/zipball/master. There will be some js file, some styling files and some images.
  • We place the jquery-1.6.2.js, jquery.dropkick-1.0.0.js under /templates/mobile_pda/resources/scripts.

You will see rest of the steps with images on the Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Dynamic rating on Joomla! mobile

We use feedback or rating system in our site for different purposes. We use http://www.greepit.com/Opineo/ jquery plugin for our feedback system. We follow the below steps to integrate the feedback plugin in our mobile site:
  • 1. First we download the files from http://www.greepit.com/Opineo/admin-form.html. There will be images, js, style folders and demo.php and result.php files.
  • 2. For this plugin, we use jquery-1.4.2.js. We place this file and opineo.js in the templates/[your_module_name]/html/scripts folder.
  • 3. In the default.php the html code describes three different options to display the feedback system.

You will see rest of the steps with images on the Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Creating a sliding menu in Mobile Joomla!

    We will follow the steps to have a sliding menu in our mobile:
  • 1. The menu section is handled by the menu module. We will create this sliding menu for Android devices. The menu section of Android device is controlled by mod_mj_pda_menu module.

You will see rest of the steps with images on the Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Integrating Ocean Blue menu in Mobile Joomla!

We will integrate a menu to our Mobile Joomla!. Let's see the steps:
  • Now we will add a new menu for Android phones. We will go to templates->mobile_pda->css.
  • We open up the mj_xhtml.css file in an editor.

You will see rest of the steps with images on the Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Mobile Joomla! Template file structure

To design on the joomla Mobile menu, we first need to understand the template file structure of them. Under the template folder, we will see four different folders.These are the template files that are created due to installation of mobile joomla. These template file structure are same as other joomla template file structure.
You will see rest of the steps with images on the Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Mobile menu

We follow the step by step procedure to create a menu item for mobile device.
  • 1. In the admin panel, we will go to Menus->Menu Manager->Add New Menu.
  • 2. This will bring new Menu creation page. We will enter title, menu type and description.
  • 3. Then we add menu items under our newly created menu. We can add many items under it. But we will add one menu item here. We will go to Menus-> Mobile Menu->Add New Menu Item.
  • 4. Now we will see the Menu Item creation page. Here we are going to create a category list menu item. We choose the item type as category list, menu title to Mobile Category. We left others as they are. We will discuss about the options later in the chapter.
You will see rest of the steps with images on the Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Configuring device specific settings in Mobile Joomla!

There are Smartphone, iPhone, WAP, iMode. Let’s start with Smartphone configuration options. There are several options in each device settings section. We will discuss what options do what here:
  • 1. Template Name: There are four different types of template in mobile joomla: mobile_iphone, mobile_imode, mobile_pda, mobile_wap.
  • 2. Homepage: Choose a page for site’s device specific homepage.
  • 3. Image adaptation method: There is image remove or resize options in the drop down menu.
  • 4. Use style to force image size: We can use styles to set the height and width of images.
  • 5. Gzip compression: Gzip compression option enables us to show compressed content for mobile devices.
  • 6. Remove unsupported tags: we can remove the tags that are not supported in a specific device.
  • 7. Remove script tags: We remove different scripts from the site by enabling this option.
You will see rest of the steps with images on the Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Configuring mobile joomla

Let’s start with the following steps to configure mobile joomla:
  • 1. To modify the configuration options of mobile joomla, we need to first go to the admin panel. Then we will go to components->mobile joomla->settings.
  • 2. Then we will see the global settings tab for configuration. These will be applied to all the different mobile devices.
  • 3. We can enable file cache and browser caching with this panel.
  • 4. To have different domains for different mobile devices, we can add options in the admin. First we will enable the domain support option.
You will see rest of the steps with images on the Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Disabling Mobile Joomla

We sometimes want to remove mobile joomla from our site. In this section we look into this ways to work around the situation.Let’s see the ways to disable Mobile joomla from our site:
  • 1. We will go to the administration section. We go to extension->plug-in manager.
  • 2. In the Plugin Manager we will search for Mobile Joomla.
You will see rest of the steps with images on the Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Mobile viewing in web browser

User agent switcher gives us the opportunity to switch between different user agents. To view the appearance of our site in a mobile device we will use this firefox addons. Let’s see how we can implement user agent switcher to meet up our need:
  • 1. First we need to go to this url, https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/, to download the addons.
  • 2. After clicking the download button, the firefox addon installation window will open. We will click the install button. When the installation will be complete, we need to restart our browser.

You will see rest of the steps with images on the Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Installation of Joomla and VirtualHost

    Let’s discuss the step by step procedure:
  • 1. We will download the latest release of joomla from the web: http://www.joomla.org/download.html.
  • 2. We extract the folder, name it joomla or what ever you want and place it under the document root folder.
  • 3. Now turn on the apache and mysql server on xampp.
  • 4. And type http://localhost/joomla into the browser.
  • 5. To create a virtual host under windows, go to xampp/conf/extra/httpd-vhosts.conf. write a code block like the below:
    
        ServerAdmin postmaster@joomla.com
        DocumentRoot "D:/xampp/htdocs/joomla "
        ServerName local.joomla.com
        ServerAlias www.local.joomla.com
        ErrorLog " D:/logs/local.joomla-error.log"
        CustomLog " D:/logs/ local.joomla-access.log" combined
    
    
  • 6.And also need to modify the WINDOWS\system32\drivers\etc\hosts file. Add the below line:
    127.0.0.1 local.joomla.com
    

You will see more detail approach on Joomla Mobile Development Beginners Guide.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Monday, November 5, 2012

timestamp with day light saving for different timezone

Timestamp is a fixed time interval from unix epoch. It will be same for all the different timezones. We will get the same timestamp output for time(), mktime() or gmmktime().
If we use arguments with mktime() or gmmktime(), then the timestamps may vary. So, we will use the Timezone features that is added on PHP 5.3. This is eliminate any differences of timestamp related problems.


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Saturday, November 3, 2012

increase file upload size in dream host

If you are using shared hosting from Dreamhost, then you don't have root access. When you want to increase the file upload size for PHP, then we need to follow their way for increasing the file upload size.
Let's increase our file upload size in the following way:
mkdir ~/[your website directory]/cgi-bin

create a file called php-copy.sh and put it in your website directory.
If we use PHP5, then we will add the below code block into the file:
#!/bin/sh
CGIFILE="$HOME/[your website directory]/cgi-bin/php.cgi"
INIFILE="$HOME/[your website directory]/cgi-bin/php.ini"
rsync -a /dh/cgi-system/php5.cgi "$CGIFILE"
# REMOVE THE FOLLOWING LINE TO CREATE THE UPDATE-ONLY SCRIPT:
cp /etc/php5/cgi/php.ini "$INIFILE"

perl -p -i -e '
s/.*post_max_size.*/post_max_size = 100M/;
s/.*upload_max_filesize.*/upload_max_filesize = 100M/;
' "$INIFILE"

Notice how in these lines it is set to 100M

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Standard Form Markup

We have a confusion over what will be our best HTML form markup. I have faced this problem recently. So, I am sharing my experiences here.

Semantic Markup

First of all we can use the normal HTML elements to create a simple form. Below is the code block for this:
Legend Name

Definition List

Now, we can have a full control of our HTML markup elements using the definition list. It's more flexible than the previous structure. Let's see the code below:

With this structure, we can apply CSS style to the elements. We will apply float: left and a common width to dt. And float: right and a common width to dd. To remove all the styling of dt and dd we apply clear style to dl. This will give us a two column layout structure.
I prefer this option, though there are many ways to have the same look and fill, but this is the simplest and effective way.


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Thursday, October 18, 2012

how to revert commit in git

If we want to rollback to our previous commit, then we just use the below command:
git revert head


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, October 10, 2012

rails auth devise cookie prob

We can modify the devise generated cookie attributes in rails application in the following code block:
Application.config.session_store :cookie_store, {
  :key =>           '_session_id',
  :path =>          '/',
  :domain =>        nil,
  :expire_after =>  nil,
  :secure =>        false,
  :httponly =>      true,
  :cookie_only =>   true
}

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

get all attributes of an element

If we want to see all the attributes of an HTML elements, we can run the following javascript code block.
var el =this;
    var attrib="";
        for(var i = 0; i < el.attributes.length; i++) {
            attrib = attrib + ' ' + el.attributes.item(i).nodeName + ' = "' + el.attributes.item(i).nodeValue + '"';
        }

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to hide a menu or module from Logged in users in Joomla

    Joomla 1.6 brings the capability for that. Ok, here is how to get this done,
  • 1. Create a new group in Users > Groups. Name it GUESTS. Select Parent Group as PUBLIC.
  • 2. Goto Users > Options > Component tab. Select GUEST as the "Guest User Group" there.
  • 3. Create a new ACL in Users > Acces Levels . Name it as GUEST USERS.
  • 4. Edit GUESTS USERS ACL, which you just created and select GUESTS group to it. Dont add PUBLIC group to it.
  • 5. Edit PUBLIC ACL and add GUEST USERS ACL to it.
  • 6. Now you are done with the group and access level creation. Now goto Global Configuration and select DEFAULT ACCESS LEVEL as GUEST USERS.
  • 7. Now, you are ready to go. Make any menu item or module to test. Just select , Access as GUEST USER in that item and test on frontend. You can see that menu item/module when you are not logged in. And as soon as you login, that menu item/module will be hidden.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Passing JavaScript Array To PHP Through JQuery $.ajax

If you want to pass a javascript array to php, you can do that in the following manner. First, set your javascript array into a variable.
data: { activitiesArray : activities },

That's it! now you can access it in PHP. Just use the following way:
   

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

The action you have requested is not allowed.

In code igniter, we set the csrf protection to true for form submission. For some reason, if we don't have the token passed from a submitted form, then we get the below error:
The action you have requested is not allowed.

To solve this problem, we need to turn off the csrf protection in code igniter.
$config['csrf_protection'] = FALSE; 

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

delete all .svn file from subfolders in linux

If we want to remove a specific folder from all the subfolders, then run the below command:
find . -name ".svn" -exec rm -rf {} \;

Sometimes, we need to remove all the .svn file from the subfolders, then this command is helpful.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Terminate user session accessed to a postgresql db

When you try to remove a postgresql database, you may find that your database is accessed by some other user. Then run the below sql command in the postgresql database. It will remove the accessed user sessions.
select pg_terminate_backend(procpid) from pg_stat_activity where datname = 'openbravo';

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

ping: unknown host

In the resolv.conf file, we have the ip address of our name servers. If for some reason, we may have missed the name server value in the resolv.conf file. Then we will have the above error message. To solve this problem, you need to go through the below steps:
Go to the below file:
/etc/resolv.conf

And write the following, this is a sample file, you need to write your server name and the name server ip addresses.
search cyberciti.biz
nameserver 202.54.1.10
nameserver 202.54.1.11

For example, for Rackspace, we have the below name server ip addresses :
nameserver 173.203.4.8
nameserver 173.203.4.9


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

sudo: add-apt-repository: command not found

If you want to add java repository or any repository using the add-apt-repository command, then you may find the above error message. To solve this error, run the following command on the terminal:
sudo apt-get install python-software-properties

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

E: Package 'sun-java6-jdk' has no installation candidate

I have come across this error while installing java on ubuntu 11.04 (Natty). Later, I found that the java repository is not added to ubuntu. So, I have added the java repository to my ubuntu server.
sudo add-apt-repository ppa:ferramroberto/java

sudo apt-get update

sudo apt-get install sun-java6-jdk sun-java6-plugin

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Tuesday, September 11, 2012

cloning a specific branch git branch

To clone a specific remote branch into our local machine, we need to write the below command:
git clone -b  

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Call-time pass-by-reference has been deprecated

While working on a drupal project, I have come across the following error:
Call-time pass-by-reference has been deprecated

To solve this problem, just replace the call by references with call by value, like &$varriable name with $variable name in the function that was named in the error block.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

URL rewrite in nginx

In this article, we will see how to rewrite urls in nginx. In the server tag, we will use the attribute server_name and rewrite urls for our redirection. We need to use two server blocks for this purpose.
Here we are going to rewrite all our www.example.com urls to example.com. In the first server block, we will write the rewrite code for www.example.com. We need to use 'http://' otherwise, it will fall into infinite loop and show 414 error.
In our second server block, we will write server configuration code for example.com.
server {
    server_name  www.example.com;
    rewrite ^(.*) http://example.com$1 permanent;
}

server {
    server_name  example.com;
    Put here your domain hosting configuration.
}

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Logrotate for nginx

To create a logrotate file for nginx server, we need to change the post rotate command to restart the nginx server. we will kill the nginx process for this purpose.

/home/shared/log/*log{
        rotate 2
        daily
        size 10k
        compress
        delaycompress
        sharedscripts
      postrotate
            [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
    endscript
}

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Monday, September 3, 2012

how to use timestamp data type in more than two columns in mysql

If you use phpmyadmin and want to have two columns that hold timestamp fields, it will give you an error. We can't add more then one field as timestamp value.
Sometime, we have created_at and updated_at fields which might be timestamp column. To add these two columns as timestamp, we have alter table structure and run the following sql command:
ALTER TABLE customer_info CHANGE created_at created_at TIMESTAMP NOT NULL DEFAULT 0,
CHANGE  `updated_at`  `updated_at` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL;

At first, we set the default value of the first timestamp column as zero and set the current timestamp on second timestamp column.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Friday, August 10, 2012

.gitignore file not working

I have created a file to ignore some specific files and folders with git. I have created the following file:

abc
abc/*
xyx
xyx/*

When I try to add files with the below command:

git add *

I got the error 'no files added'.
Then I run:

git rm -r --cached .

This removes everything from the cache. Now I run the command:

git add .

Now it will add the files. So, I can commit the changes.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, July 18, 2012

how to create git branch

To see the existing list of branches on the local machine, run the below command:

git branch

To create a new branch, use this:
git checkout -b new_branch

This is a shorthand for:
git branch new_branch
git checkout new_branch

To delete a branch from local machine:
git branch -D new_branch

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Tuesday, July 17, 2012

Get the list of cookies in iOS phonegap

To get the list of cookies stored into our iPhone, we use below code block:

NSArray *cookieArray;
cookieArray = [cookieStorage cookies];
NSInteger numcookies = [cookieArray count]; 
NSLog(@"cookies count:%d", numcookies); 

for (NSHTTPCookie *each in [cookieStorage cookies]) {
    NSLog(@"\nCOOKIE Name: %@, Value:%@, Expires At: %@\n", [each name], [each value], [each expiresDate]); 
    }


Cookies are stored into the NSHTTPCookieStorage. From that storage, we get each one using NSHTTPCookie object. each object has name, value and expireDate attributes.


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Monday, July 16, 2012

Password protected directory

We work with test and staging server. But we don't want others to access the website. We can stop access for unauthorized users by using passwd feature. First, we create a user/password pair with the passwd command.

htpasswd -c /home/pwww/.htpasswd jerry


Then we create a .htaccess file on the same level where our directory is located that we want to be protected. We placed the below code block in the file:

AuthUserFile /home/pwww/.htpasswd
AuthGroupFile /dev/null
AuthName EnterPassword
AuthType Basic
require user jerry


Then try to reload your directory access using browser. You will get a window asking for authentication.


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Thursday, July 12, 2012

iptables configuration

We can set several different configuration values for the iptables.
To flush the current rules we run the below command:
sudo /sbin/iptables -F

To accept a certain port, run the below:
sudo /sbin/iptables -A INPUT -i eth0 -p tcp -m tcp --dport 30000 -j ACCEPT

To accept certain state, run the below:
sudo /sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

We rejected all incoming and forwarded requests:
sudo /sbin/iptables -A INPUT -j REJECT
sudo /sbin/iptables -A FORWARD -j REJECT

Now accept all outgoing and selected incoming request:
sudo /sbin/iptables -A OUTPUT -j ACCEPT
sudo /sbin/iptables -I INPUT -i lo -j ACCEPT

Reject all incoming loop requests
sudo /sbin/iptables -I INPUT ! -i lo -d 127.0.0.0/8 -j REJECT

It displays the existing rules with line numbers
sudo /sbin/iptables -L --line-numbers

We accept HTTP and HTTPS requests.
sudo /sbin/iptables -I INPUT 3 -p icmp -m icmp --icmp-type 8 -j ACCEPT
sudo /sbin/iptables -I INPUT 5 -p tcp --dport 80 -j ACCEPT 
sudo /sbin/iptables -I INPUT 5 -p tcp --dport 443 -j ACCEPT

We enable the logging features of iptables.
sudo /sbin/iptables -I INPUT 8 -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
To save an existing rules table, use the below commands:
sudo sh -c '/sbin/iptables-save > /etc/iptables.save'


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to install fail2ban

We can install fail2ban quite easily in ubuntu. Just install it from aptitude.
sudo apt-get install fail2ban

We make a local copy for the configuration file.
 
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local

In the configuration file, we can change several different options as per our need. Like below:
enabled = true
port    = ssh
filter  = sshd
logpath  = /var/log/auth.log
maxretry = 5

We enable the fail2ban for a specific section by setting enable to true. After changing the configuration, we restart fail2ban.
sudo /etc/init.d/fail2ban restart

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to Change Git user

If you want to change the git user credentials in a machine, Then following the below steps.
First, go to the .ssh folder under your user directory.
cd ~/.ssh

We create a folder to backup your existing keys.
mkdir key_backup

And then copy those keys to the backup folder.
cp id_rsa* key_backup

And delete the old keys
rm id_rsa*

Now we create the new keys for our email address.
ssh-keygen -t rsa -C "your_email@youremail.com"

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to install sqlitebrowser

To view sqlite data, we can use the sqlitebrowser from aptitude. The installation command is pretty simple, same as other plugin installation. Just run the following command:
sudo apt-get install sqlitebrowser


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Error with Frontaccounting branch creation

I was trying to create sales report for a customer with the frontaccounting software. But I was facing the following error with the system:
The selected customer and branch are not valid, or the customer does not have any branches.

After googleing the problem, I found that I need to set the default_location value to DEF in the cust_branch table.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to detect keyboard close in iPhone phonegap

When we tap into any textbox or textarea in iPhone, it triggers the built-in keyboard in iPhone. We need to detect the close of this keyboard event. The 'blur' event on textbox and textarea detects the close of the keyboard.
The following code detects the keyboard close event and rearrange the page layout by scrolling to top left corner.
$("input[type=text], textarea").bind("blur", function(e) {
    window.scrollTo(0.0);
    loaded();
  });

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

difference between index, primary, full text, unique in phpmyadmin

In phpmyadmin, we can set attribute for a field with following properties :
  • 1. Index
  • 2. Primary
  • 3. Full Text
  • 4. Unique

Then what is the difference between index, primary, full text,unique in phpmyadmin.
Index: this create a non-unique columns.
primary: there will be one primary key for a table.
fulltext: this is used for full text searching. but others are used for b-treee(selecting, sorting, ranges from left most column) or hash table.
unique: this will be unique throughout the columns

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Error: Select query cannot join with another table

I was joining two tables in Zend framework. I come across following error:
Error:  Select query cannot join with another table

The code that I was using is as below:
$calc = $this->select()
  ->from(array('c'=>'sed_cal'),array('c.id','c.name'))
  ->join(array('ctr'=>'sed_calc_to_road'),'c.id = ctr.calc_id')
  ->where('ctr.road_id',$id)
  ->order(array('c.id ASC'));

After searching the web, I found that I need to use the setIntegrityCheck function with false value. Hence, the code goes as this:
$calc = $this->select()
  ->setIntegrityCheck(false)
  ->from(array('c'=>'sed_cal'),array('c.id','c.name'))
  ->join(array('ctr'=>'sed_calc_to_road'),'c.id = ctr.calc_id')
  ->where('ctr.road_id',$id)
  ->order(array('c.id ASC'));

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80no listening sockets available, shutting down

I was trying to run apache, but it was not running and it was displaying the following error message.
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80no listening sockets available, shutting down

It was showing that some other process is using port 80. So, I run the below command to kill the process:
sudo fuser -k -n tcp 80

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Problem with successive ajax call & resolve it?

I was working on a mobile application using phonegap recently. I was making calls to the API to fetch data. I found that before completing a request call, another request was made. So, there were some deadlock of request calls.

Hence, we need to remove the request calls that are not used any longer. We need to detect whether the request is completed or not.


The below is the code block to stop ajax request calls. The $.ajax request returns an object. We check this object, whether any request call is running or not. If one request call is there, then we terminate it using the abort function.

var req = null;

function sendRequest (text)
{
        // Check for pending request & cancel it
        if (req) req.abort ();

        req = $.ajax ({
                // various options..
                success: function (data)
                {
                        // Process data
                        ...
                        // reset request
                        req = null;
                }
        });
}

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

jQuery selector for not starting with

Recently, I want to trace the anchor tags that doesn't start with a hash tag(#). There is a function in jquery named 'not'. and also using the selector modifier '^' to detect the start of the attribute.

Hence, the syntax will be as following:
$('a:not([href^=#])')

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Thursday, June 21, 2012

Joomla Customized 500 error problem solution

I was working with Joomla. Got an error message as 'Error:500'. It was working on my local machine, but it's giving error on my server.

Finding no other clues, I searched the error log file. And found that it is not getting the path for the temporary folder and log folder of joomla. The path was not correct.

I have changed the path and now it is working correctly.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, June 6, 2012

How to empty an array in javascript

I have an array in javascript.
var A = [1,2,3,4];

I want to make it empty. It's pretty simple. Just use the below:
A.length = 0;

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, May 30, 2012

How to update cache manifest

In HTML5, we use cache manifest file for caching contents. While updating the content, there is a problem to view the latest changes as the browser stores the contents as cache. To solve this problem, we type the below command on the browser console to update the cache of the application:
javascript:applicationCache.update()


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Thursday, May 24, 2012

jQuery doesn't apply style on dynamically loaded contents

If we add any contents dynamically, the jQuery doesn't apply styles to that contents. Suppose, we add contents using $.html() function of jQuery. But found that the styles are missing on that code block.

To solve this problem, we need to trigger create event on that html element. Like the following:
$.html('some html here').trigger('create');


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Tuesday, May 8, 2012

Mount remote file system via ssh

Sometimes we need to sync files with different remote servers. We can use rsync, but we need to use cron for that. And this means at a certain time, a request need to be made. So, this involves some memory usage.
By mounting a remote folder, we can easily make synchronization. For this, first we need to install the sshfs.
sudo apt-get install sshfs
To mount a specific folder, we need to write the below command:
sshfs user@hostname: mount point
If you have a customized port:
sshfs -p 3000 hostname: mountpoint
We can set several options with the command, like allow_others, no_remote_lock etc.
sshfs -p 3000 hostname: mountpoint -o allow_others -o no_remote_lock
You can find other options by typing:
sshfs --help
To unmount it:
fusermount -u mountpoint

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to detect accordion close or open?

jQuery mobile comes up with accordion feature which is the 'collapsable' property. We can detect this accordion event with the below code:
 

Menu 1 : Click to open / close

Paragraph 1.1

Paragraph 1.2

Paragraph 1.3

Menu 2 : Click to open / close

Paragraph 2.1

Paragraph 2.2

Paragraph 2.3


For the above code block, we use the blow script:
$(".ui-collapsible").live ("tap", function (event)
{
  var txt = "";
  if ($("#id1 h1.ui-collapsible-heading-collapsed").length) 
    txt += "Menu 1: closed\n";
  else 
    txt += "Menu 1: open\n";
    
  if ($("#id2 h1.ui-collapsible-heading-collapsed").length) 
    txt += "Menu 2: closed\n";
  else 
    txt += "Menu 2: open\n";
    
  alert (txt);
});
Here we test there the class 'ui-collapsible-heading-collapsed' is present or not.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, May 2, 2012

Mount Rackspace clound files

We will cloud fuse to mount cloud files. first we download cloud fuse into the server where we want to mount the cloud files.
git clone git://github.com/redbo/cloudfuse.git

We need the below libraries into our system installed.
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev libxml2-dev libssl-dev libfuse-dev libxml2 gcc fuse-utils

Then we go to the folder and run the make command:
cd cloudfuse/
./configure 
make
sudo make install
which cloud fuse

And then we create a file under the user which will own this file.
sudo vim ~/.cloudfuse

These are the username, api key and auth url to the Rackspace cloud.
username=[username]
api_key=[key]
authurl=https://auth.api.rackspacecloud.com/v1.0

Go to /etc/fstab and add the following command:
cloudfuse       /media/cloudfile       fuse    defaults,gid=33,umask=000,allow_other  0 0

Change the group id, file path and umask as your need.
Now make a folder to the mounting point.
mkdir /media/cloudfile
And finally we mount it.
sudo mount /media/cloudfile

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

fuse: failed to exec fusermount: No such file or directory

While using cloudfuse to mount device, I have come across the following error:
 fuse: failed to exec fusermount: No such file or directory 

To solve this error, we need to install fuse-utils into our system.
sudo apt-get install fuse-utils


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Ecliplse error: incompatible profile file name.

While install eclipse in my machine, I came across this error message for install PDT.
An internal error occurred during: "Computing size". Incompatible profile file name. Expected format is {timestamp}.profile.gz (or {timestamp}.profile) but was ._1328723081571.profile.g
I then found that this is a mac profile issue. To solve this problem, we need to go to the eclipse folder and delete the hidden files. Just run the following command and the error will be gone.
cd /path/to/your/eclipse/folder
find . -iname '._*' -exec rm -rf {} \;

On windows environment, you can't run the above command on command prompt. You need to install the Git Bash. Then run the above command.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, April 25, 2012

How to export from git

To export a project from git, we need to use the 'archive' command of git. Archive command has several different options. we can export from remote host using the '--remote' option.

To change the format of the export file compression we can set it using '--format' option. And also we modify the level of compression from 0 to 9.
And we specify the output file path where we want to store the exported files.

The following command will export content into 'b' folder with zip compression.
git archive HEAD --format=zip > b.zip


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Sunday, April 22, 2012

How to close Child browser in iPhone phonegap?

Here we will see how we can close the child browser in iPhone phone gap automatically. There is a function in the child browser plugin named 'onLocationChange', which triggers when a the page url has been changed. we can detect this using the following code:
window.plugins.childBrowser.onLocationChange = function(loc){
        if (loc.indexOf("http://example.com") >= 0)
        {
          window.plugins.childBrowser.close();
        }

Here when the browser the detects page url is 'example.com', then it closes the child browser.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Saturday, April 21, 2012

is not allowed to connect to this MySQL server

I was connecting to a remote mysql server from my machine. And I was getting this error:
is not allowed to connect to this MySQL server


To accept remote connection to mysql server, we need to modify the my.cnf file on which the mysql server is running.
Go to /etc/mysql/my.cnf.
And comment out the following line:
bind_address = 127.0.0.1

Now run the below command on the remote mysql server machine:
$ mysql -u root -p
Enter password:

mysql> use mysql

mysql> GRANT ALL ON *.* to root@'192.168.1.4' IDENTIFIED BY 'your-root-password'; 

mysql> FLUSH PRIVILEGES;

we assume that 192.168.1.4 is the ip from which the request would be made to the remote mysql server.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Monday, April 16, 2012

File backup with rsync

rsync provides us to synchronize two folders. We can also make the synchronization over remote servers with ssh or rsh. There are different options we can use according to our need. The following command helps us to make an incremental backup of our filesystem:

rsync -a --delete source/ destination/

The delete command will remove the deleted files of source from the destination.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Friday, April 13, 2012

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller class

The error message
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller class
If you come across with this error. then there is some problem with your application configuration file and the module file name pattern.
Your module section of the configuration file should look like this:
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.defaultModule = "auth"
resources.frontController.params.displayExceptions = 0
resources.modules = ""
 

And don't add prefix to the IndexController and ErrorController file name. Left it as it is.
Or if you use the below line in your configuration file
resources.frontController.params.prefixDefaultModule = "1"

Then you need to add prefix to the above classnames, not filename.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Saturday, March 24, 2012

Mysql Error – SQLSTATE[HY000] [2002]

I have come across the following error:
Mysql Error – SQLSTATE[HY000] [2002] No such file or directory
To solve this, you need to open up your php.ini file (mine was in /etc/). Look for the following line:
pdo_mysql.default_socket=/var/mysql/mysql.sock

If that line exists for you, try changing it to:
pdo_mysql.default_socket=/tmp/mysql.sock

Restart apache after saving, and that’s all I had to do.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Multiple database connection on same credentials

If you are opening two separate connections to two different databases (but on the same host, and with the same user and password):
$db1 = mysql_connect($dbhost, $dbuser, $dbpass);
$rv = mysql_select_db($dbname1, $db1);
$db2 = mysql_connect($dbhost, $dbuser, $dbpass);
$rv = mysql_select_db($dbname2, $db2);

At this point, both $db1 and $db2 will have selected the database named by $dbname2.
The workaround is to require that the second MySQL connection is new:
$db1 = mysql_connect($dbhost, $dbuser, $dbpass);
$rv = mysql_select_db($dbname1, $db1);
$db2 = mysql_connect($dbhost, $dbuser, $dbpass, TRUE);
$rv = mysql_select_db($dbname2, $db2);

Now, $db1 should have selected $dbname1, and $db2 should have selected $dbname2.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Multiple mysql connection with different servers

If you want to connect with different server with different credentials, then you need to connect with all the different servers and for each handle, you need to select the database and the queries.
$handle_db1 = mysql_connect("localhost","myuser","apasswd"); 
$handle_db2 = mysql_connect("127.0.0.1","myuser","apasswd"); 
$handle_db3 = mysql_connect("localhost:3306","myuser","apasswd"); 
$handle_db4 = mysql_connect("localhost","otheruser","apasswd"); 

We select the databases with each handle.
// give each handle it's own database to work with, permanently. 
mysql_select_db("db1",$handle_db1); 
mysql_select_db("db2",$handle_db2); 
mysql_select_db("db3",$handle_db3); 
mysql_select_db("db4",$handle_db4); 

And for querying the databases, we also set the handlers here.
//do a query from db1: 
$query = "select * from test"; $which = $handle_db1; 
mysql_query($query,$which); 
The below is for our second database.
//do a query from db2 : 
$query = "select * from test"; $which = $handle_db2; 
mysql_query($query,$which);

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Tuesday, March 20, 2012

jQuery calls error callback on successful ajax request (status 200)

Sometimes though the jQuery ajax code block is right, it goes to the error condition block. we found no clues on this kind of strange behavior. Why this happened?
Actually, the request successfully reached the destination server, but when it returns the client expects one kind of response, but the server returns in different format. this produces the error.
It was expecting a Json response, but it was getting empty result, that's why it was showing on the error callback though it was a successful call.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

setting svn editor

I have come across the following error:
svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no 'editor-cmd' run-time configuration option was found
To solve this problem, we need to add an editor for svn. we add the below line the bash profile file.
vim ~/.bash_profile
export SVN_EDITOR=vim

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

POST with cross origin policy

If we try to submit a form or something using POST method in cross domain, then we face the cross origin error. We can mitigate this error by first setting the access control on the domain address and the access control header.
header('Access-Control-Allow-Origin: http://www.example.com');
//if you need cookies or login etc
header('Access-Control-Allow-Credentials: true');

After we submit the form, on the response header we set the followings:
if ($this->getRequestMethod() == 'OPTIONS')
{
  header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
  header('Access-Control-Max-Age: 604800');
  //if you need special headers
  header('Access-Control-Allow-Headers: x-requested-with');
  exit(0);
}


See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Saturday, March 17, 2012

PHP Fatal error: require_once(): Failed opening required 'system/startup.php'

I have found this error while working with an opencart shop. I am getting the following error into my error logs.
PHP Fatal error: require_once(): Failed opening required 'system/startup.php' (include_path='.:/usr/share/php:/usr/share/pear') in admin/index.php on line 15
Then I checked the config.php file and found that the path to the system file was wrong, so I placed the correct path to the file. and the error was gone.

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Sunday, February 26, 2012

Architecting your application for the cloud

Recently I have given a speech on 'Architecting your application for the cloud' on Basis Softexpo 2012. I have uploaded my slides on slideshare. You can get the slides from here.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Friday, February 17, 2012

Logrotate for virtual hosts

First create a file named 'virtualhosts' under /etc/logrotate.d/ folder. Then we set the path of the log files for our virtual hosts into the file. Suppose we have two virtual hosts for domain1.com and domain2.com. Then our file will be as the below:
/path_to_domain1.com_log/*log /path_to_domain2com_log/*log {
        rotate 14
        daily
        compress
        delaycompress
        sharedscripts
        postrotate
                /usr/sbin/apache2ctl graceful > /dev/null
        endscript
}

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

minimize attack with iptables

You can minimized DDOS attack with some basic actions with the iptables.
Syn-flood protection:

In this attack system is floods with a series of SYN packets. Each packets causes system to issue a SYN-ACK responses. Then system waits for ACK that follows the SYN+ACK (3 way handshake). Since attack never sends back ACK again entire system resources get fulled aka backlog queue. Once the queue is full system will ignored incoming request from legitimate users for services (http/mail etc). Hence it is necessary to stop this attack with iptables.

Force SYN packets check:
Make sure NEW incoming tcp connections are SYN packets; otherwise we need to drop them:
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
Force Fragments packets check
Packets with incoming fragments drop them. This attack result into Linux server panic such data loss.
iptables -A INPUT -f -j DROP
XMAS packets
Incoming malformed XMAS packets drop them:
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
Drop all NULL packets
Incoming malformed NULL packets:
iptables -A INPIT -p tcp --tcp-flags ALL NONE -j DROP

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to prevent DDOS attack

Different people are sitting there in the world to make DDOS attacks. This kind of attack main done by web hosting company to crush other hosting servers. You can prevent DDOS attack with the following steps:
  • 1. use iptables
  • 2. Use log rotator
  • see access log and block the attacker's IP address,
Let me know what I missed... :)
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to block an IP address

You can block a malicious IP address with the iptables. you can stop all incoming request from that specific address with the following command:
sudo /sbin/iptables -I INPUT -s 173.242.125.206 -j DROP

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to configure logrotate

you can find the main logrotate configuration file in
/etc/logrotate.conf
This shows the default rules for log rotation. we will get the application specific configuration on
ls /etc/logrotate.d
Set the rotation count with
rotate 4
So, we will get four log file. We can specify the interval also with
weekly
daily
monthly
yearly
We limit the log file size with
size 100k
size 100M
size 100G
Here we limit the size to 100 kilobytes or 100 megabytes or 100 gigabytes, use the one that you needs. We compress our log file
compress
delaycompress
nocompress
with delaycomress we delay the compresssion. delaycomress only works if you define compress. You can directly apply the changes with the below command:
/usr/sbin/logrotate /etc/logrotate.conf

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

how to empty a file in linux

You can empty a file using the following command without deleting it in unix environment:
cat /dev/null > largefile
it's empty now. :)
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Friday, February 10, 2012

Joomla! Mobile Development Beginner’s Guide is out now

Hey everyone, want to develop websites for mobile devices with Joomla, 'Joomla! Mobile Development Beginner’s Guide' is out there. go get your copy and start developing. In the coming days, I will also discuss about different feature of the book. Thanks. You can order from here.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

How to create a git repository

To create a git repository, create a folder of the project name, like 'test'.
mkdir test
Then go into the folder with:
cd test
And run the below command
git --bare init
Now, go to your local machine, and run the below commands:
mkdir project
cd project
git init
And create your project files here.
git add .
git commit -am 'message'
git remote add origin ssh:user@ipaddress:/path_to_project
git push origin master
Then you can make a clone of your repository on your server machine now:
git clone user@ipaddress:/path_to_project

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, February 8, 2012

Create init page for nginx

In this article, we will create an init page for nginx server. Open the file with nano.
sudo nano /etc/init.d/nginx
Then write the following code in the bash file:
#! /bin/sh

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/nginx
NAME=nginx
DESC=nginx

test -x $DAEMON || exit 0

# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
        . /etc/default/nginx
fi

set -e

case "$1" in
  start)
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
                --exec $DAEMON -- $DAEMON_OPTS
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
                --exec $DAEMON
        echo "$NAME."
        ;;

  restart|force-reload)
        echo -n "Restarting $DESC: "
        start-stop-daemon --stop --quiet --pidfile \
                /usr/local/nginx/logs/$NAME.pid --exec $DAEMON
        sleep 1
        start-stop-daemon --start --quiet --pidfile \
                /usr/local/nginx/logs/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
        echo "$NAME."
        ;;
  reload)
      echo -n "Reloading $DESC configuration: "
      start-stop-daemon --stop --signal HUP --quiet --pidfile /usr/local/nginx/logs/$NAME.pid \
          --exec $DAEMON
      echo "$NAME."
      ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
        exit 1
        ;;
esac

exit 0
We change the permission on the file.
sudo chmod +x /etc/init.d/nginx
And then added it to run on the boot time of the server.
sudo /usr/sbin/update-rc.d -f nginx defaults

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

bind() to 0.0.0.0:80 failed (98: Address already in use)

I have installed nginx server on ubuntu 11.04(Natty Narwhal). After installation while I start the nginx server, I got the error:
bind() to 0.0.0.0:80 failed (98: Address already in use)
I found the apache server is running on the same port on 80. So, I stop the Apache server and The error gone.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

jQuery Mobile jumpy and blinky issue

I have used jQuery mobile and implemented transition effect into my site. Then some pages jump to previous and next page. This issue is known as 'Jumpy and blink issue'. I have removed the the page transition effect and set the following:
defaultPageTransition: none.
Then the problem solved. :)
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

svn: Error converting entry in directory '/' to UTF-8

I have got an error describing that some filenames can't be converted to UTF-8 format while committing to svn. Later I found that there was some space in the filename like 'tahsin hasan'. It's a valid name in windows, but it's not a valid in unix environment. I have changed the names, then the error was resolved.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Saturday, January 28, 2012

Fully qualified domain name error

While restarting the apache server, we may get 'Your server does not have a fully qualified domain name.' To solve this problem, we go to httpd.conf file.
/etc/apache2/httpd.conf
Add the domain name that is pointed to this IP address.
ServerName localhost
Then restart the apache web server.
sudo /etc/init.d/apache2 restart

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

perl warning setting locale failed

In Ubuntu, we get the locale setting failed error. Your system locale is not configured properly. Then we set the default language in our system with the following commands.
sudo /usr/bin/localedef -i en_US -f UTF-8 en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Infinite loop detected in JError

You may sometime come up with this error message in Joomla. Don't get scared. This means some thing have misconfigured your configuration file in joomla. So, check your configuration.php file for errors. Thanks.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Friday, January 27, 2012

Sample Virtual Host File

We use virtual hosts for our web sites. I have added a sample virtual hosts here. I have removed indexes option, so none can't browse folders if there is no index file. Also disabled MultiViews option. I have renamed the .htaccess file name to myobscurefilename and controlled limited access to it.


  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin test@domain.com
  ServerName  www.domain.com
  ServerAlias domain.com


  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.php index.html
  DocumentRoot /home/test/public_html/domain.com/public

  
   Options FollowSymLinks -Indexes -MultiViews
   AllowOverride All
  
  
  AccessFileName .myobscurefilename
  
    Order allow,deny
    Deny from all
    Satisfy All
  

  # Custom log file locations
  LogLevel warn
  ErrorLog  /home/test/public_html/domain.com/logs/error.log
  CustomLog /home/test/public_html/domain.com/logs/access.log combined



See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Wednesday, January 25, 2012

why use virtual hosts?

We use virtual hosts for our websites. Why we use them? Let's discuss it here with bullet points(I don't like theoritical talking).
1. Virtual hosts enables us to use same machine, same resources for multiple applications. Each application acts like its running on its own hosting server.
2. The sessions and cookies are stored against their own domain name set on the virtual hosts.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

Tuesday, January 17, 2012

Enable Tab to pre-populate file name in vim

If you create a new user account in linux, then pressing Tab won't bring a filename with it's initials. To enable Tab you need to edit the passed file. Let's see how we can do it. 1. Create a user with:
useradd -d /home/testuser -m testuser
Here -d takes the user directory path and -m creates the user directory. you can use -p to set a password in the command. 2. To set a password use:
passed testuser
Then enter your password and retype it. 3. Now if you go to /home/testuser directory you will see .bashrc and .profile files. .bashrc file is used whenever a new tab opened in the console and .profile is used only for the first time while an authentication is done. Now we will change the /etc/passwd file. open the file and you will see your newly created user is listed there. There is sh beside his name. Change it to bash, like the following:
testuser:x:1003:1004::/home/testuser:/bin/bash
Now you will see that Tab is working in your console under your new user.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide