Posts

How to create a virtual host in ubuntu?

When you are used to running your websites in windows envirnment, it can be a bit of pain to suddenly switch in to linux. This post will guide you towards setting up a virtual host in ubuntu. 1. Enable the virual host module and restart apache.       sudo a2enmod vhost_alias       sudo /etc/init.d/apache2 restart 2.  Goto to /etc/apache2/sites-available directory and create a copy of the default file with the name of  the virtual host you would like to create. In this case the virutal host is "my-first-host.com".       cd /etc/apache2/sites-available/       sudo cp default my-first-host.com

How to enable mod_rewrite in ubuntu?

Simply run the following command in the command line to enable mod_rewrite. sudo a2enmod rewrite The command simply adds the rewrite module to the apache configuration file as mod_rewrite is a part of apache. Now we need to restart apache to make the command take effect. sudo /etc/init.d/apache2 restart The command automatically adds file rewrite.load to the folder /etc/apache2/mods-enabled/

How to enable curl in PHP ubuntu?

To enable curl in PHP in ubuntu we simply need to install it. The following command can be used to install curl in ubuntu. sudo apt-get install php5-curl Now the next step would be restart apache using the following command sudo /etc/init.d/apache2 restart Enjoy!

Getting latitude, longitude, timezone using ip address.

This is a post to find the latitude, longitude, timezone, country, city and so on using the web services/api by ipinfodb. The ipinfodb provides api in both xml and json format. We can use either of them. I will show you how to use it for both formats. Using XML format: You can either register for api key from ipinfodb. I am using mine in this example.

How to parse a XML file using SimpleXML in PHP5?

SimpleXML is a very simple function introduced in PHP5 to parse a XML file. It is very simple to use and implement as compared to other bulky codes to parse a XML file. The steps are pretty simple. Let us use a simple XML file as below naming it as xmltest.xml.

Changing file permissions of a folder and all of its subfolders and files in Ubuntu.

Changing file permissions in Ubuntu is a very essential thing. If proper file permissions are not set to folders or files, it is not possible to execute any PHP or HTML files from the browser using localhost. The following command can be used to set file permission for any file or folder. sudo chmod 755 /var/www/myfolder In the above example

How to fix "url /phpmyadmin was not found in this server" problem in Ubuntu (linux)?

Sometimes after installing LAMP, when you try to open the phpmyadmin in your browser you might get the error like this: "Not Found The requested URL /phpMyAdmin was not found on this server. Apache/2.2.12 (Ubuntu) Server at localhost Port 80" This is likely to be caused by not checking apache2 during installation. To reinstall you can use the following command:

How to install LAMP in Ubuntu (linux)

LAMP stands for Linux, Apache, MySQL and PHP/Python. Installing and configuring LAMP is not a very complicated thing in Ubuntu, its just a matter of few lines of commands via the command line. This post will show you how to install PHP5, Apache2, MySQL and phpMyAdmin in Ubuntu. Installing Apache 1. Open the terminal and type the following command.

Adding facebook comment box to your blogger

Few days ago I wrote about adding facebook comment box to your website. To add similar comment box to your blogger a few more steps are required. Adding this box helps users to comment to your posts easily in one click without having the blogger account. Let us see how we can embed it.

Adding facebook comment box to your website

Image
Adding Facebook comment box to your website is not as difficult as it used to be about an year ago. When I first used Facebook comment in one of my website about an year ago, I first had to use facebook connect and then write a lot of complicated fbml codes. It was a hell full of complications. But now it has become very easy all because of the Facebook Social Plugins. It just copy paste of some html codes and you are done. The following steps will guide you through using it.

SQL Injection and its prevention in PHP

What is SQL injection? SQL injection is one of the common attacks in web industry which uses SQL statements in the web form to execute a query in the wrong way and make attacks like making an unauthorised login or making wrong access to the data in the database. SQL injection usually occurs when users are asked for inputs through the HTML forms. Let us see a common example of SQL injection. Suppose we have a user login form that asks for their username and password. We use select statement for validating the username  which is stored in the database.

How to jailbreak and unlock iPhone 4 IOS 4.3.3

Image
To unlock iPhone running on IOS 4.3.3, it should be first jailbroken using redsnow 0.9.6rc15 which was developed by the Dev team in May 2011 and then unlocked by installing UltraSnow 1.2.3 via cydia. Below are the detail steps for jailbreaking and unlocking iPhone IOS 4.3.3:

Getting city name using real IP address

Image
Getting the name of the city using IP address is quite simple. This tutorial shows how we can get real IP address of the server and find the city name using the IP address with the help of API from GEOBYTES. Following are the steps to do this:

LightBox for displaying contents and image using a common jquery plugin

Image
Displaying contents using a sexy lightBox has become a kind of fashion in the web industry. I have seen many scripts to do this but most of them are complex and bulky. I have come up with a very simple way to do this. Following are the steps to do this.   

Experience an Ajax based ecommerce solution with PrestaShop

Image
Last week I was asked by my client to develop an ecommerce site using prestashop. When I used it I found it amazing. The best thing I liked about it is its smooth AJAX based functionality in both backend and frontend. PrestaShop can be downloaded from the following link:

My MSc Research

Image
Research Question: Why do programmers avoid frameworks in favor of ad hoc program development and how can they be motivated towards using frameworks to minimize the risks of projects?

What is ITIL?

Image
Information in organisations is critical and always has been.  However, due to the increase in scale of organisations; managing and organising information has become far more complex.  To handle the increase in volume and complexity of this information and the systems that manage it, standards and frameworks have been developed.  The aim of these frameworks is to provide consistency in an attempt to simplify processes and establish and share methods of ‘best practice’.  This topic will focus on the current dominant framework that exists in the domain of IT service management.