Monday, December 12, 2011

Create intro flash / page in Joomla

Recently I am doing a website in joomla and I wanted to have an intro page for it. By default, there is no facility for it in joomla by default. Dont worry. Create an index.html file and put in the root directory. It will first take up that html file and you have successfully created an intro page. On this intro page provide a link to index.php file and you just entered into your joomla site. What if your hosting takes index.php as default? Then create .htaccess file and add following line in it:
       DirectoryIndex index.html index.php
This tells apache to load index.html as default page. replace index.html with your intro filename. Another option is to install joomla inside sub-directory and put intro file outside joomla directory and point index.php inside that sub directory.

Reset Apache2 on Ubuntu

Recently I was experimenting on apache2 and edited many config files. Soon I realised that PHP was not working properly on it. While installing joomla it was failing. So I removed apache2 using command:
     sudo apt-get purge apache2 
The problem was I didnt removed apache2 completely. Then I quicked googled and find out the correct way of getting it working back use following snippet.
APACHE_PKGS=`sudo dpkg --get-selections | grep apache | cut -f 1`
# Make sure things are sane:
echo $APACHE_PKGS
# Example output: apache2 apache2-mpm-prefork apache2-utils apache2.2-common \
# libapache2-mod-php5 libapache2-mod-python libapache2-svn
# Likely if you have a Python application:
# libapache2-mod-python libapache2-mod-python-doc libapache2-mod-wsgi
# Or if you roll with the PHP:
# libapache2-mod-php5
sudo apt-get remove --purge $APACHE_PKGS
# You might want to consider not re-installing the whole list;
# instead dump it out, audit, and install what you need:
sudo apt-get install $APACHE_PKGS
After this apache2 got resetted and working as it was freshly installed with all configurations replaced.
Reference : http://bit.ly/uBxq7L

Quote

"Never take decision when angry and Never make promise when happy."

Saturday, December 10, 2011

Data Structures: Stack

Data Structures can be defined as arrangement and storage or organization of data so that inserting, retrieving and modifying the data becomes efficient, faster and easier. There are different kinds of data structures available and can be used in our applications according to our requirement. Any application we develop is all about manipulating the data. So data structures are always required to write any application. Any data structure we consider can be implemented in any language of your choice. Hence data structures are independent of language. Data Structure consists of two parts:
  1. Data.
  2. Operations on that data.