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:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

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:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

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:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

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:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

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:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

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:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

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:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

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:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

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:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

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:

Technical Support:

If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.


Wordpress Plugins:
  1. Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
  2. Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.

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