How to provide per user configuration in vsftpd – ubuntu

This powerful option allows the override of any config option
specified in the manual page, on a per-user basis. Usage is
simple, and is best illustrated with an example. If you set
user_config_dir to be /etc/vsftpd_user_conf and then log on as
the user “chris”, then vsftpd will apply the settings in the
file /etc/vsftpd_user_conf/chris for the duration of the
session. The format of this file is as detailed in this manual
page! PLEASE NOTE that not all settings are effective on a per-
user basis. For example, many settings only prior to the user’s
session being started. Examples of settings which will not
affect any behviour on a per-user basis include listen_address,
banner_file, max_per_ip, max_clients, xferlog_file, etc.

Default: (none)

How to restrict user to home directory with VSFTPD

There are options in /etc/vsftpd.conf to help make vsftpd more secure. For example users can be limited to their home directories by uncommenting:


You can also limit a specific list of users to just their home directories:


After uncommenting the above options, create a /etc/vsftpd.chroot_list containing a list of users one per line. Then restart vsftpd:

sudo /etc/init.d/vsftpd restart

How to Enable CURL in WAMP?

How to Enable CURL in WAMP?

CURL is not enabled by default in WAMP. Every php programmer have to use CURL to make remote connection.

The steps are as follows :

1) Close WAMP (if running)
2) Navigate to WAMPbinphp(your version of php)
3) edit php.ini
4) Search for curl, uncomment extension=php_curl.dll
5) Navigate to WAMPbinApache(your version of apache)bin
6) edit php.ini
7) Search for curl, uncomment extension=php_curl.dll
8 ) Save both
9) Restart WAMP
10) Click the wamp icon in the system tray and goto php > php extensions and check php curl.

Install and configure Sphinx search on Ubuntu

Sphinx Installation and Configuration

A:- Install
1- Extract the tar ball (download from
2- ./configure –prefix /usr/local/sphinx
3- make
4- make install

B:- Configure
1- The initial sphinx.conf in etc in the above dir is ok, just change the db connection.

2- To remove the commented lines from the above conf file use ubuntu command grep as:
cat sphinx.conf | grep -v “[#]” > sphinx.conf.min
the v is used to inverse the match.

2.5 Import the sample DB by
mysql -uroot -proot test < /path_extracted_tar/example.sql

3- Install the service as:
searchd  –config sphinx.conf

4- Check status as
searchd –status

5- Start indexer
indexer –rotate –all

6- test by using search in bin/
search test

7- Test using SphinxQL
mysql –host= –port=9306
select * from test1 where match(‘test’);

8- Test with php API ( in extracted tar dir/api)

php test.php test

Difference between GET and POST

One important difference between GET and POST requests is that GET will enable you refresh the page without prompting the resend dialog box whereas the POST will show prompt each time you refresh the page to which you have previously posted some data.;)

Magento Login with Facebook

Step 1:

Get the extension key from

Now in Magento admin goto Configuration->Magento Connect -> Magento connect manager to install the extension.


Step 2:

Get the facebook API id and secret the proceed as follows.

Once you obtain two keys navigate to Magento Administration, copy/paste them to appropriate fields under Configuration->Customer->Facebook Connect, set Enabled to Yes and you’re good to go. If you’re updating from previous releases, you also need to Enable it to work.

Default template files (frontend/default/default/template/facebook/*) and layout (layout/facebook.xml) makes Facebook Connect work out of the box with default theme, but we tried to make customizations as easy as possible so all you need to do is add button or link with “facebook-connect” rel attribute set anywhere in the theme, static block or cms page, for example:

<button rel=”facebook-connect” class=”form-button” type=”submit”><span>Connect with Facebook</span></button>
<a rel=”facebook-connect”>Connect with Facebook</a>

Manually Adding Meta Tags in Magento

If you want to add a custom meta tag to your Magento store, you need to edit the head.phtml file of your template. The location of the file is inside your Magento Installation directory.


You should replace in the path above with the actual folder for your template.

Then you need to edit the file and add your custom meta tag to it.

Finally,  you should flush the Magento cache and reload your website in your browser. You can check the source code of the page (Ctrl + U for most browsers) to make sure your meta tag is included properly.

Adding languages to Magento

Locate your version of the languages.phtml file (C:xampphtdocsjew_storeappdesignfrontenddefaultjewelry-storetemplatepageswitch) and make a backup copy i.e. languages.phtml.old. Copy and paste the following code into languages.phtml replacing the existing code.

<div class="form-language">
    <label for="select-language"><?php echo $this->__('Your Language:') ?> </label>
<!-- Google Element Translator Styling-->
            .goog-te-combo{width: px !important;}
            .goog-te-balloon-frame{display: none !important;}
            font{background: transparent !important;}
            a font:hover{ color:  !important;}
            #google_translate_element{height: 26px !important;overflow: hidden !important;}
            .goog-te-banner-frame{display: none !important;}
            body{top: 0px !important;}
<!-- Google Element Translator -->
    <div id="google_language_drop">
        <div id="google_translate_element" class="-blank"></div>
                function googleTranslateElementInit() {
                    new google.translate.TranslateElement({
                        includedLanguages: 'en,de,af,sq,ar,hy,az,eu,be,bg,ca,zh-CN,zh-TW,hr,cs,da,nl,et,tl,fi,fr,gl,ka,el,ht,iw,hi,hu,is,id,ga,it,ja,ko,la,lv,lt,mk,ms,mt,no,fa,pl,pt,ro,ru,sr,sk,sl,es,sw,sv,th,tr,uk,ur,vi,cy,yi',
                        pageLanguage: '<?php echo $this->__('en') ?>',
                        gaTrack: true,
                        gaId: 'UA-12345678-1'
                    }, 'google_translate_element');
        <script src=""></script>
You may need to change the css here (http://localhost/jew_store/skin/frontend/default/jewelry-store/css/styles.css)


How to setup PHP debugging in Eclipse – xDebug

The following video tutorial shows how to configure Xdebug delivered with XAMPP and how to use Eclipse PDT for debugging a sample php
project. The video is covered by the written instructions below, see them as addition, the video should be enough. One note to the end of the
video: The debugging is started twice, in the first debug pass you will see, that the website is not redirected to the php script receiving the
form data. That sometimes just happens, seems to be some kind of bug. On the second attempt everything works.

The tutorial uses XAMPP 1.7.3, Xdebug 2.0.6-dev, Eclipse PDT 2.2.0 All In Ones and Windows 7. It however should work the same on future
versions of the mentioned software. The written instructions assume that you install XAMPP to C: (the default suggested by the installer). Note
that the installer then creates C:xampp automatically.

1) Get XAMPP (the basic package, only this package includes Xdebug) from Install it to C:,
the installer will then automatically create C:xampp

2) After XAMPP has
been installed, open C:xamppphpphp.ini and perform the following

;zend_extension = “C:xamppphpextphp_xdebug.dll”
zend_extension = “C:xamppphpextphp_xdebug.dll”

;xdebug.remote_enable = 0
xdebug.remote_enable = 1

3) (Re)start the apache webserver using the XAMPP Control Panel.

4) Get Eclipse PDT All In Ones from and extract it to a folder of your choice. Start Eclipse and make sure to select C:xampphtdocs as workspace, else your files won’t be available to the apache webserver and therefore you can’t execute them. In the Eclipse menu choose Window
– Preferences, then PHP – Debug. Change the PHP Debugger from Zend Debugger to XDebug and uncheck “Break at First Line”. Click Apply and
then OK. The debugger is now set up. Time to use it! IMPORTANT: If you already had any debug configuration for a PHP project, make sure to
delete it, so that a new configuration with the new settings is created the next time you debug a php script! Debug configurations you’ve
created before changing the settings in this step won’t be automatically updated! This is a common source of errors!

5) (For this step I recommend you have a look at the video, it is easy but complex to describe).
If you haven’t already done it, choose the most right symbol with the arrow (Workbench) in the Eclipse welcome screen. In the Eclipse menu choose File – New – PHP Project. Enter a name for your project e.g. WebDebugTest and click Finish. Now download
, it includes a sample project (not done by me, it is from [1]) called “webDebugExample”. Select the three files from this folder and add them to your Eclipse project by using e.g. Drag&Drop (maybe have a look at the video if you don’t know how to do that). The file one should start from when using this sample is “enterGreeting.php”. This script then sends the data you input to its form to “results.php”. Set a breakpoint in the “results.php” on line 8, then make sure to select “enterGreeting.php” in eclipse and debug the project as PHP Web Page. After you have entered something in the form and choosen submit, the debugger should start. The debugger is used like the other typical debuggers you may know. If you want to see the output of the script, you have to continue it using the arrow symbol in the debugger. Note, that in some cases the displayed website won’t change from the input form to the output. This is why the debugging process is run twice in the video. This seems to be a bug using Eclipse PDT and XDebug.

How to enable autocomplete for CodeIgniter in Eclipse

To enable auto-complete for a project say Project1, these two steps need to be done.

1. Step 1:- Make a code base folder

Download CodeIgniter and rename its folder to BASE.  Add the following in two files (Controller.php and Model.php) in the sytem->core right after the open brackets of the respective class:

  * @var CI_Config
 var $config;
  * @var CI_DB_active_record
 var $db;
  * @var CI_Email
 var $email;
  * @var CI_Form_validation
 var $form_validation;
  * @var CI_Input
 var $input;
  * @var CI_Loader
 var $load;
  * @var CI_Router
 var $router;
  * @var CI_Session
 var $session;
  * @var CI_Table
 var $table;
  * @var CI_Unit_test
 var $unit;
  * @var CI_URI
 var $uri;
  * @var CI_Pagination
 var $pagination;

2. Step 2:- Copy two folders to a single folder


Now create a new folder (say ci ) and copy this folder BASE and your code files Project1 to it.
Open your new folder (ci) in Eclipse and right click Project1, click Include Path -> Projects -> Add and check BASE -> OK.

Now you should be able to see auto complete in action, if necessary restart Eclipse.



Reference :

How to setup VisualSVN Server and TortoiseSVN Client

1. Install TortoiseSVN Client

Install the above client from which is a straight forward installation.

2. Install VisualSVN Server

Install this server from

Now open the server by clicking the icon from desktop etc and create a repository. After the repository is created right click its name in the right panel and click ‘Copy url to clipboard’. Right Click on the folder that you want to upload to this repository from your computer and from the context menu choose TortoiseSVN -> import and paste the url in the repository box. Click Ok to upload your code to the repository.

Now clicking on the same folder you can update, commit your changes.

How to setup Virtual Host on XAMP for CodeIgniter

Virtual Hosts

Virtual Hosts give you the ability to “host” more than one Web site and domain on your computer. With a virtual host you can have separate local domain names for each of your Web sites: for example, http://clientA/ for one site and http://clientB/ for another. When you type the URL for the Virtual Host in your Web browser, the browser doesn’t go out onto the internet to find the site, but instead asks for the proper file from the Web server running on your computer. Not only does a Virtual Host let you run multiple Web sites on your computer, but it also lets you store the files for those sites anywhere on your computer and not just in the C:/XAMPP/htdocs folder.

Adding a Virtual Host is a 2-step process:

1. Add a new entry to your computer’s hosts file.

open the hosts file located at C:/windows/system32/drivers/etc/hosts. At the end of this file add:      clientA.local

Where clientA.local is the name that you would use to access your site and can be anything but personally I like this convention:
websitename.local, so if you want to browse the site on internet you have to only change .local by .com or .se etc and looking at the same page.

2. Edit the Apache configuration file

In Notepad open the Apache configuration file located at C:/xampp/apache/conf/extra/httpd-vhosts.conf
At the bottom of that file add:

NameVirtualHost *
<VirtualHost *>
   DocumentRoot "C:/xampp/htdocs"
   ServerName localhost
<VirtualHost *>
   DocumentRoot "C:/Documents and Settings/MyclientAwebsite"
   ServerName clientA.local
   <Directory "C:/Documents and Settings/MyclientAwebsite">
      Order allow,deny
      Allow from all

The first 5 lines are mandatory as you will be accessing phpmyadmin. The next lines between <VirtualHost *> and </VirtualHost> adds one virtual host and you can add as many as you need.

The DocumentRoot points to the directory of your website files. While ServerName is again the name that you would write in the address bar of your browser. The rest is just access control list and should remain intact.

For CodeIgniter I recommend this clientA.local* instead of clientA.local. The star (*) enable you to prevent any object not found errors later.

Restart Apache.