Mar
11

How to reset your ubuntu panel

So many times it happened that we mess up things with our installation of ubuntu(genome) and think that now how to get those things back. Well getting your things back is very difficult but you can always go to your default setting with all the default panel and links. To do that run the following commands one by one

  1. gconftool –recursive-unset /apps/panel
  2. rm -rf ~/.gconf/apps/panel
  3. pkill gnome-panel

And that’s it . You can always have these commands in one single script and run this command again and again.

Feb
05

The story of being corrupt — Solution

As I have said in my previous article that there is only one way out to eliminate corruption. Remove this paper money out of our lives and start transacting in a electronically.  We could make it as easy as the currency notes way if we wish to. To give you a fair idea how we could do this I am detailing it below.

In this system we would have a central authority like RBI at present time who would control the whole system. This central authority will keep the final transaction records of all the citizens or outsource its work for some of its citizens if they wish to do so to some financial institution like banks to handle for it. Banks will also co-own the money of its customers like they do at the present time to lend it further to other people. All the banks and the central authority will issue a e-wallet to its users like they do issue a debit card today to spend and receive money. The main difference between the debit card and an e-wallet would be that debit card is only designed to give money to other but the e-wallet would be designed to receive money too from anyone.

When ever somebody needs to give some money to anybody body the giving person will touch the receiver person ewallet with his own ewallet, chose the amount of money that he want to give and press the button and bingo the money will be transferred from the giver person account to the receiver person account at the blink of an eye. Isn’t it cool. Now see what will happen underneath.

  1. The giver person e-wallet while being in contact with the receiver’s person ewallet takes his identification credentials by RFID identification. This is the same technology that is being used in Delhi metro for travelling tokens or in superstores as security tags for their items.
  2. After receiving the identification credentials the donor ewallet will send this information along with his own identification credential and the amount to be paid to his bank through cellular network.
  3. The bank will debit the amount from the donor’s account and send this information to the central authority.
  4. The central authority will record this transaction in its database and send this information to the receiver’s bank.
  5. The receiver bank will credit this amount to the receiver account and send this information to the receiver’s ewallet.
  6. Receiver will see on his ewallet that the amount the donor has sent has came to his account.
  7. The whole transaction would be handled by supercomputers and travel on high-speed 3G type data network so it will be done in the fraction of seconds.

Now you could ask me few question. Some of which I would like to answer by myself.

Q1. Is this technology credible and safe enough to handle this kind of transactions.
Ans1. If you see this whole system, it work in three parts. 1) Data gathering by RFID technology 2) Sending data over mobile networks 3) Handling the transaction by banks and central authority. Let’s come one by one.

  1. Data gathering by RFID: This technology is around for quite a long time now and it has revolutionized many fields. Some of them are transport industry, Tracking of shipments and animals and many more. In fact American express launched its blue credit card sometime ago which bags the award for its innovative design uses the same technology. Please go to this link to read more about its areas of applications right now.
  2. Sending data over mobile networks: Mobile network is every where. In recent report of COAI over 525,888,822 (Almost Half the population of India) had a mobile phone in Nov, 2010 and around 85% of the Indian territory is in network coverage. All the mobile networks are now high speed internet enabled and can send and receive data over internet.
  3. Transaction between the banks and the central authority: This is also become a old thing now. Almost everybody who has a internet banking account which is being provided by almost every bank in India could send and receive money from the users of other’s bank on internet. So we have now enough expertise to handle this kind of transactions. If you are still doubtful I should give you an example. To show a single page on a social networking site like Facebook it takes 1000 times more complex calculations than sending money from one bank to another but still Facebook is doing it for 500 millions user each day with blazing fast speed. Do you still have doubt about it.

Feb
05

The story of being corrupt — Fight back

Tonight I want to throw an idea to you people. This idea is so huge to hit the life of people that actually I am scared to even speak about it. I thought about it days and night and came to this conclusion that the idea which I am going to propose is the only solution to almost all the problems we have these days.Please bear with me but I am not joking. In my previous two articles in the series I have given evidences that all the problems that we have these days right from a small corruption in the government offices to the large scandal at national level or the huge poverty , illiteracy are all related to covert nature of paper money. Corruption at any level is also not a localized event. It gradually creeps into every body life and make everybody lives hell. When something become a regular thing in society, it only grows further until to a point when everything get destroyed and people who get left start everything fresh. This is nature’s way of cleaning things up. Its harsh but it’s true and in some case necessary. But are we really in position to throw everything up and get ready to start everything from stone age.

Before I propose my idea I would like to make you think about a situation where we are living in a world or atleast in a country where there is no existence of paper money or currency notes. Please think about it. what that situation would be? You will ask me a simple yet important question that then how we all would get paid for our work at the end of the month :) ? How we will pay our bills? And lot more questions like this. Well, found interesting? Think more about it.

I am not saying to eliminate the existence of money at all. Well that’s not possible. I am only saying to remove the way of transacting in the form of currency notes. What’s the other way? We need some way which is as easy as to transact by currency notes otherwise the life could be very tough. But why we would ever want to remove currency notes at all? What’s the advantage we could ever get by throwing them all? I know its not as easy as it could be but if you look on the things that are on stake you could probably agree with me.

The other alternative forms of transaction like credit cards, debit cards, net banking are all around the corner for quite a few times now and they have proved their worth and ability as a successful transaction medium. They are more secure and brought lot of other conveniences. Who could ever thought 20 years ago that you would be able to pay your bill or purchase train or plane tickets right from sitting in your home. No one, but now we are doing it on daily basis and rather than being a fancy stuff today they have become a necessary part of our lives. The only thing where the currency notes beat all other alternative medium is the great convenience by which we can transact with it. How we could buy our tickets in the bus or buy a burger from a subway shop or give some money to roadside beggar without having currency notes or coins? We cannot give them a credit card or transfer them money through wire transfer. We need to get these things done instantly and at any place. If you would ask me that if these problems could ever be solved!! then I would say that these problems are very much solvable and technology have solved many more complex problems that this earlier. If you still have doubts I will come on that in large detail in the next article but for the time being I would like you to assume that these problems get solved and you are living in this kind of paper money free society. Now feel it.

In this society, all the transaction you are doing it is getting done electronically. Electronic transactions has a very great advantage over paper money which has not got its fame till now that every record of each transaction could be kept for a very long time and with no effort. The route to money to a specific person could be traced by some very simplest softwares you could ever imagine and on the blink of the eye. Now think what its implication could be? Unlike electronic transactions, the route of money to a specific person through paper money is almost impossible to trace. If I have a 1 lakh worth of paper money I could give it to any person and no body could trace it that where it’s gone. I could give this money to a government official as a bribe or give this money to a criminal to shoot somebody or any other nasty thing I ever want to wish and the great part is that no body could effectively trace that from where I could get this money and where its gone. No body could ever know that a government official has taken a bribe from me or anybody else or even taken at all. Why these politicians are always successful in doing these scandals and no body could ever get a clue about them. Its just because of this paper money. Its not a rocket science to understand this thing. 99.9% of the crimes and 100% of corruption happens due to money and its keeps on getting undetected because we are not been able to find from where the money is coming and to where its gone. If you could ever be able to trace the path of the money you would always get your criminal.

To elaborate the things further let’s consider a situation where there is no existence of paper money and every transaction is getting done electronically. Now we have a government official about which we know that he should have only one source of money, that is his monthly salary. If he is a corrupt one he must be getting lot of money entries regularly in his account. To tackle these situations even a college guy could write a program to trigger an alert to the concerned officials that his income source entry is exceeding from a permissible level and there is something wrong about it. That guy could be immediately interrogated by the officials with all the solid proofs in their hand and that guy could be nabbed in no time.

Why do you think that corruption is getting increased day by day in our country or any where else around the globe. Because its easy to be corrupt and no body could get a hand on you if you are clever enough. These people are making corruption as todays fashion. When other people watch these guys successfully doing corruption they feel left behind and to catchup they also get corrupt. Paper money is playing a huge role in protecting these guys and increasing this race further. Just think of a situation when everybody get corrupt then what will happen? It scares a hell lot of me to even think of a situation like this. In this situation there would be no certainty of anything, there would be no rule of law and it would be a complete jungle. The situation now is also not better and its deteriorating fast . If you don’t believe me just try visiting some government office.

What we have right now is the opportunity that we could possibly revert this race. Imagine a situation where nobody is allowed to be corrupt. A huge software keep inspecting the accounts of everybody and alerting officials about the possible corruption scenarios so that it could be examined and checked. When no body would be allowed to be corrupt the human race would try to find an other way for life. Let me remind you that humans not live their lives just for food and reproduce. They always wanted to be in fashion what others are following or always want an addiction to live with. When corruption would not be the choice what could possibly be. I see a huge possibility for good things to happen because I feel that good things are equally addictive as bad things and they are also numerous in numbers. When good things will come in fashion and people start following it, it would be the golden period for the human kind and we would have all our problems fixed easily and will get a better lives than never before.

In the next article I would be writing solely about the way and architecture through which the electronic payment system could be made as easy as the paper money or even better for transaction in day to day lives. In fact I am devoting a full website which I just registered and started working on it. The address of the website would be www.nopapermoney.com.

What I am trying to do is to stimulate your brain cells to think about this option, discuss among yourselves and If possible help us with your knowledge and expertise. Whatever your work or expertise are, we need everybody. We want writers, actors, filmmakers, economists, scientists, doctors, engineers, journalists, a simple ordinary man on the street, everybody. Because this thing is going to affect the lives of everybody. We want opinion of all. May be, we would not be here to see the fruits of our labour in our lifetime but is this really matters? More to simple technical and usability barriers there is one more very big barrier which this option has to face would be the resistance of corrupt people. They are very powerful people right now and they would never allow this thing to happen in anyway.  What we are trying to do, is to do a steady awareness about our views and try to innovate different ways to pave the path of paper money thorough our different expertise. This is going to be a very long process and demands very huge patience but I am hopeful because human race had done this charisma lot of time in the past and could do lot of times in the future too.

Feb
05

The story of being corrupt — History

The methods and purpose of getting corrupt has also been changed over the period of time. In the primitive age it was primarily for sex. Primitive humans used to fake their strength and capability by showing different tricks to seduce their potential mates. After that when societies formed and mates getting given by institutionalized marriages in which the mates where given to a person through society rules and not through individual tricks, this form of corruption get reduced. I don’t know who started it but it was the remarkable milestone in the history of human kind. After that all went well in human lives for quite a long time and humans attained huge physical and spiritual development. We also know this period as Vedic Age in Hindu Scriptures.

After that time the serpent in the Adam-Eve story found a new way to corrupt humans. It keeps motivating humans to acquired as much land as he could so that he could do what ever he want and with who ever. So after that, the race of being corrupt started with getting as much land and as much humans in your control. This trend also continued for quite a long time in the history of human kind and this earth saw bloodshed of millions of her sons and daughters for the greed of few power greedy people. Countless people either got killed for the wars with which they don’t have to do anything and another countless people being made slaves to make the few people feel like gods. This trend also ended with the huge direct efforts of few great people who made them realized or reprogrammed the whole mankind that this path is wrong and you are not going to get anything out of it except destruction. If I have to name a few then I would name Buddha, Jesus Christ, Gandhi, Martin L. King, Vivekananda and many more others.

But the peace that would have came due to the effort of the above great people never actually came. The serpent became more wise this time and before the fall of its great trick of physical power it invented a newer one and its new weapon was this time was money. It showed human kind that to control other’s territory and people you need not to actually acquire it by power all the time and even if you have to do that it could be legitimate. The great invention of humankind to share the outcome of their efforts and excel in one particular thing and still able to enjoy all the benefit of other things suddenly become the favorite weapon of the serpent.

Let’s see what makes this weapon so deadly. Initially it was thought that this money would be given to a person in equal proportion to their effort but there was a inherent flaw in the design of the whole process. There was no process to actually validate that its actually being distributed in accordance to their efforts or not. This thing placed enough room for the humankind to acquire this money illegally and corrupt those person also who tried to question them by giving the same money. So it become the chain reaction. Now the serpent don’t have to waste its efforts to corrupt all the humankind. It have to corrupt only few and give him the weapon of money to corrupt others too. Isn’t it brilliant.

If you see in the present times everybody has the feeling that acquiring money by what so ever meaning is not bad. What else if it gives you the great skill to fake yourself as strongest person and act like god. As the great thinkers of all time Chanakya told long back ago that when some huge pillars of corruption appears in the society and remain their for long time all the other people too tries to mimic them and fuel this race. After trends like this appears in the society it became very difficult for the defenders to uproot it.

Feb
05

The story of being corrupt..

Lets talk something else other than coding, algorithm and all these stuffs today. Life is much more than that. Today I wanna gather my thoughts to think about the meaning of being corrupt. And why something became corrupt. If you ask me as a software professional I would say that a program become corrupt when it start to behave someway differently than what is intended and more in a destructive way. If I think of we humans I feel that this definition apply to us also. We became corrupt when we started behaving in a destructive way for ourselves and for the society. Hmm.. that’s interesting why we would ever do that. Why a person would try to harm himself or to the society when it gives him only pain. Believe me even a butcher feels pain when he try to slaughter his chickens but still he do that. He do that to feed his family and himself. Think of a drug-addict person even if he know that this drug is gonna kill him very soon but he still takes this drug to free himself from the present addictive pain. So you can also conclude that being corrupt is like an addiction. Even if he know that this is bad he cannot stop it because it gives him different types of momentary ‘happiness’ that he could not get it in a simple way. Lets face it, being truthfully happy is a tough job so people take a shortcut by being corrupt.

Human kind knew it from the very beginning that happiness is just a hormone game and you can make your body secrete this happiness hormone through other shortcuts also. Remember the Adam, Eve and the serpent story. Its a wonderful story and one of my bedtime favorites in my childhood and I guess today’s too. If anybody still interested to read that story to get more clarity, here is the link. This story is a beautiful illustration of what we are made for, how we may become corrupt and finally what happens when we become corrupt. But the story never ends here. That serpent was always present around us, which will keep making us corrupt in the times to come and the human kind will keep getting cursed by the god to keep living in our own hells.

Feb
05

How to install LAMP from source code

It has been seen that people who has taken entry into the world of PHP programming faces lot of issues in installing their development platform. They always have to dependent upon the ready made packages like XAMPP or ubuntu apt-get packages. There is no harm in using these packages but there are some limitations in using them. The most irritating limitation of using them that they are not easily customizable.

As a standard practice our development environment should be exactly identical that of our production environment and our production environment could not afford to have lot of baggages that these readymade packages shipped with. So to make our development environment exactly identical with the production environment we have no choice left rather than to build our dev environment with source code. Building our dev environment with source code has two immediate benefit.

  1. You could install only what is needed to make your dev system exactly similar to your production system. This will save your life from those extra bugs which could arise from the inequality of both the systems.
  2. You can scale your system very easily when ever there is a need of something else in comparison of these ready made packages.

Before doing this we will ensure that everything is fine in our system and we are ready to go. Before doing anything we have to update our whole system. Well that’s easy. You just have to run a single command to do this.

sudo apt-get update

Then you have to download all source codes and their dependencies from their respective sites. Believe me its a daunting task. To make it easy for you I have collected all the source codes here only so that you can get started right away. Its has following packages.

  1. MySql 5.0.45
  2. Apache 2.2.15
  3. PHP 5.3.3
  4. GD library 2.0.35 (For image manipulations in PHP)
  5. Subversion 1.6.9
  6. Sqlite amalgation 3.6.13 (required dependency for svn 1.6.9)

After doing it we will install everything one by one. We will start it with MySql

Installing Mysql:

  1. First of all make yourself root so that you can do things more easily. To be root, use this command => sudo su
  2. After that enter your password. You are now the owner of this computer. You can now even destroy it also so be careful with that.
  3. Install the dependencies for Mysql by this command => apt-get install bison libncurses5-dev libtool g++ gcc make
  4. Download mysql from here. Click Here.
  5. untar it by the command => tar xvfz <path to downloaded mysql> -C /usr/local/src . This will extract and copy the source code at location /usr/local/src. I prefer to put all my extracted source codes at one standard place and this place in linux is /usr/local/src.
  6. Now go to extracted source code location by => cd /usr/local/src/mysql-5.0.45/
  7. Run this command to configure your mysql installation. =>  ./configure –prefix=/usr/local/mysql
  8. This will take lot of time so go and plan for a coffee.
  9. After the configure command finishes run this command to compile the source code => make clean install
  10. This will again should take lot of time so you can finish up your coffee in peace.
  11. After the compilation get completed, Its time for post compilation configuration so let’s do it. Please follow the instruction very carefully because missing one step can ruin your installation and you have to repeat all steps again. So please be very careful.
  12. It’s a very good idea to run your mysql with separate user, so create a new mysql user and group => groupadd mysql; useradd -g mysql mysql
  13. Now being in the same source directory copy the mysql conf file to /etc directory => cp support-files/my-medium.cnf /etc/my.cnf
  14. Now go to your newly installed mysql root directory => cd /usr/local/mysql
  15. Now make your newly created ‘mysql’ user the owner of this new mysql installation => chown -R mysql . ; chgrp -R mysql .
  16. Don’t miss the dot in the end of command. Its the part of it.
  17. Now install the necessary databases for the working of mysql => ./bin/mysql_install_db –user=mysql
  18. Now revert the ownership of mysql installation to root except the newly created var directory while keeping the group ownership as mysql only for the whole mysql directory => chown -R root . ; chown -R mysql var
  19. var directory is the one in which all your datafiles are there.
  20. Now create the link for all the executables in the bin directory to /usr/bin directory so that you can use all the commands without giving the overall path. For ex you could execute the command like #mysql -u<username> -p<password> and not #/usr/local/mysql/bin/mysql -u<username> -p<password>. To create all the links at once use this command => cd /usr/local/mysql/bin/ ; for file in *; do rm /usr/bin/$file; ln -s /usr/local/mysql/bin/$file /usr/bin/$file; done ;
  21. Ignore any errors printed in the console. To check the effect of links created in the /usr/bin dirctory type just ‘my’ in the console and press two times tab. you can see lot of mysql commands to chose .
  22. Congratulations !! you are now ready to start your newly installed MySql server. To start it just enter => mysqld_safe –user=mysql &
  23. You should see that your mysql server is now started. To return to command-line press two times enter.
  24. To check whether your server is running or not do => ps aux | grep mysql . If you see more than one entry then your mysql server is up and running fine
  25. To secure your installation and set the root password => mysql_secure_installation
  26. After that follow the instructions and your installation is complete.
  27. Right now to start the Mysql server you have to do it manually by running the above command in line 22. Now how to start the server at system start and to shutdown the server at system shown automatically, I will show you in the end of this article.
  28. Now after installing mysql we will install Apache.

Installing Apache

  1. First install the dependencies => apt-get install libssl-dev libexpat1-dev zlib1g-dev
  2. Then download the source code from here. Click here
  3. Again untar it and copy the extracted source code to /usr/local/src directory by the command => tar xvfz <path to downloaded apache> -C /usr/local/src
  4. Now go to extracted source code location by => cd /usr/local/src/httpd-2.2.15/
  5. Run this command to configure your apache installation. => ./configure –enable-mime-magic –enable-expires –enable-headers –enable-ssl –enable-http –enable-info –enable-dir –enable-so –prefix=/usr/local/apache –enable-rewrite –enable-proxy –enable-proxy-http –enable-deflate –with-included-apr
  6. This command actually tells the installation script to include the following functionality in your new apache
    1. To be able set mime headers
    2. To be able to set expire headers
    3. To gzip the output for those browsers who can accept gzip encoding.
    4. To use url rewrite.
    5. To do reverse proxy (If you don’t want it, you can remove it by removing ‘–enable-proxy –enable-proxy-http’ flags but its a very good utility to play with ).
    6. To enable https (or secure connection).
    7. To bind other extensions as .so modules. (We will bind php with apache as .so module so its mandatory here).
    8. You can add or remove the functionality by just adding or removing the flags in the configure command and installing the required dependencies by apt-get. Isn’t it powerful. You cannot have this flexibility with pre-compiled packages.
    9. Explore the new options by => ./configure –help . This is a standard command in configure script, so you can search for new options with this in any source package.
  7. After that run our final make command => make clean install
  8. Now create the links of all the executables in /usr/bin directory as we did in case of mysql by running the command => cd /usr/local/apache/bin/ ; for file in *; do rm /usr/bin/$file; ln -s /usr/local/apache/bin/$file /usr/bin/$file; done ;
  9. Ignore any error msgs.
  10. Now create a user and group ‘apache’ to run your new server. Run the following command to do this => groupadd apache; useradd -g apache apache
  11. Now open the conf file of your new apache installation by => vim /usr/local/apache/conf/httpd.conf
  12. Search for string ‘User daemon’ and then change it to ‘User apache’ and also change the line below it ‘Group daemon’ to ‘Group apache’.
  13. This will run the apache server by user ‘apache’ . So now where ever you think that your apache server needs a write permission to some directory (in case of cache,logs or uploads). Make the owner of that directory as ‘apache’ and give apache user only write permission to these directories. This will make your apache installations super secure.
  14. To start with give your apache user write permission to the its own log directory of apache => chown -R apache:apache /usr/local/apache/logs; chmod -R u+w /usr/local/apache/logs
  15. Now its time to start your apache server => apachectl start
  16. Check this by command => ps aux | grep apache . If more than one line is there then the apache is running fine.

Installing GD library and PHP

  1. We will again start by installing dependencies => apt-get install flex libpng-dev libjpeg-dev libxml2-dev libcurl4-openssl-dev libmcrypt-dev libmhash-dev libxslt-dev
  2. First we will install GD library because this is also a dependency for PHP. You can also install gd library by apt-get but apt-get install lot of unwanted things also which spoils the whole effort, that’s why we are installing this dependency also from source.
  3. Download GD library from here . Click here
  4. Untar it and copy the extracted source to /usr/local/src directory => tar xvfz <path to gd tar file> -C /usr/local/src
  5. Go to source library => cd /usr/local/src/gd-2.0.35/
  6. Configure it => ./configure –prefix=/usr/local/gd
  7. Compile and install it => make clean install
  8. After this download PHP. If want to install php 5.3.3 click here and if want to download php 5.2.2 click here
  9. Untar it and copy it to /usr/local/src folder => tar xvfz < path to php tar file> -C /usr/local/src
  10. Move to extracted source folder
    1. If downloaded php 5.3.3 then => cd /usr/local/src/php-5.3.3/
    2. If downloaded php 5.2.2 then => cd /usr/local/src/php-5.2.2/
  11. Run configure command => ./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache/bin/apxs –with-openssl –enable-bcmath –with-curl –enable-ftp –with-gd=/usr/local/gd –with-jpeg-dir –with-png-dir –with-zlib-dir –enable-gd-native-ttf –with-mhash –with-mysql=/usr/local/mysql –enable-zip –with-config-file-path=/etc –with-mcrypt –enable-mbstring –with-xsl –with-pdo-mysql
  12. Then compile it => make clean install
  13. Then copy the php.ini file to /etc folder
    1. if you have installed php 5.3.3 => cp php.ini-production /etc/php.ini
    2. If you have installed php 5.2.2 => cp php.ini-recommended /etc/php.in
  14. If you have installed php 5.3.3 you also have to set ‘date.timezone’ parameter in the php.ini. To do this open /etc/php.ini file and the search for ‘date.timezone’ parameter and set it equal to ‘Asia/Calcutta’. If you don’t do this it will keep giving you warning messages.
  15. Now restart apache again to take the new changes in place and complete the PHP installation => apachectl start
  16. Finally create the links of the executables to the /usr/bin dir => cd /usr/local/php/bin; for file in *; do rm /usr/bin/$file; ln -s /usr/local/php/bin/$file /usr/bin/$file; done
  17. Check your php installation by => php -v

Installing SVN

  1. All dependencies of SVN has been installed till now in upper installations so their is no one left now.
  2. Download the source and dependencies from here. Subversion 1.6.9 and its dependency Sqlite amalgation 3.6.13
  3. Untar both the sources and copy it to /usr/local/src folder by following commands
  4. tar xvfz <path to Subversion 1.6.9> -C /usr/local/src
  5. tar xvfz <path to Sqlite amalgation 3.6.13 > -C /usr/local/src
  6. Now go to src folder => cd /usr/local/src/subversion-1.6.9/
  7. Now we will install the sqlite dependency into svn. But the way is a bit different here. To do this run the following command
    1. Create a sqlite-amalgamation folder => mkdir /usr/local/src/subversion-1.6.9/sqlite-amalgamation/
    2. Copy the /usr/local/src/sqlite-3.6.13/sqlite3.c file into above folder => cp /usr/local/src/sqlite-3.6.13/sqlite3.c  /usr/local/src/subversion-1.6.9/sqlite-amalgamation/
  8. Now run the configure command of svn => ./configure –prefix=/usr/local/svn –with-apr=/usr/local/apache –with-apr-util=/usr/local/apache
  9. Run install command. => make clean install
  10. Finish it by creating the links of its executables in /usr/bin folder => cd /usr/local/svn/bin ; for file in *; do rm /usr/bin/$file; ln -s /usr/local/svn/bin/$file /usr/bin/$file; done

So after this you are a proud owner of a development environment which you have compiled from its source code and you can now enjoy the flexibility of the customization that will offer.

Feb
03

Importance and effects of good coding practices — Part I

“Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skilful execution; it represents the wise choice of many alternatives.”

– William A. Foster

What I want to say is not new. The only difference is that I myself start seeing things more clearly now, so I decided to share it with other people also. Good practices of coding have been applied by lot of teams across the world to achieve success in their fields and tranquillity in their lives. It’s a very small price to pay in comparison to what is on the stake.

Let’s discuss first what is the objective of all the code we write and what makes it good or bad. In my opinion the whole objective of writing the code is to lead a product.

  1. Which does what its intended to do.
  2. Which could be easily maintainable over a long period of time?
  3. Which could be easily extendable or alterable with in a predictable amount of time?
  4. New development members could very easily gain the mastery over the product without much help from others.

If the code written by a team is able to fulfil all the above objectives for making a product then no doubt its a good quality code otherwise it’s not. Good coding practices help a development team achieving all the above prerequisites of a good product through their codes.

We usually avoid these good practices on the name of quick development because it takes some time to build the foundation in the initial phases. But it’s a myth. Once the stage is set, it reduces all the subsequent development time over a huge margin and too with the peace of mind. In the opposite side if we don’t apply the good practices, all the cowboy code which we write become very hard to maintain and start becoming a extra baggage in terms of extra development time in all subsequent releases.

Let’s see more closely that what happens when we don’t follow good practises. Generally managers feel that work could only be made done effectively by giving pressures because their role are limited to distribution of work and they usually get no opportunity to look into the difficulty of code. To avoid these pressures and delivering the code on time, developers often choose to ‘just’ finish his work and complete the functional requirements in any way. This happens when there is no clear-cut guideline of development is laid and enforced. In the start of the project they both become very happy to see that their individual strategies towards their works are actually working in getting the work out. Due to this they start believing in their own strategies and keep obeying them. But they don’t know that the low quality code that they are producing is like a time bomb which is destined to explode after some time. After few releases when things start getting tougher both the managers and the developers land on confusion. Because of their previous believe and prejudices managers start giving more pressures to the team and team members due do this increased pressure and increasingly difficult to maintain code start producing more inferior code. This cycle goes on and on and the consequences of this small, unimportant looking thing become far reaching and devastating. Some of the main consequences are

  1. Missed Deadlines : When someone else start coding on someone else’s code or the original author seeing his own code after a long time he could not be able to derive the right amount of effort for the new work correctly and this often leads to not honoured timelines. Good coding practices like documentation and standardization with in the code help everybody to be on the same page and able to make more informed decision. Standardization of code helps developers to reduce silly mistakes in their codes and also helps understanding their own code and others better. Documentation helps more code reuse written by others and reduces more development time. But in the absence of these things go in wrong way.
  2. Increased QA cycles: Without good coding practises, development team often looses the foresight to see that what they are going to break with the new changes, they are going to make. Its justified also because developers are human and humans are not supercomputers. They are so occupied with dealing the existing code and the pressure to do it on time that they often used to break something on the exiting code which they are not intended to. This comes as a new bugs and in next bug cycle as reopened bugs. No need to say it stretches the planned QA cycles and delays the delivery date further.
  3. Failure of code on live: No need to say that QA people are also not supercomputers. They check the product in a much localized part in any given QA session. But what if some other part got broken due to current release. In a big project when thousands of lines of codes are written and all the different modules are interdependent on each others, it is a very common possibility to occur. In this case, the broken piece of code goes live and often left unnoticed for long time. Even if it gets discovered by chance, the damage had been done and there is no way left other than blaming each other.
  4. Downgraded user experience: All the above issues eventually make the user experience degraded and bring a bad name for the product. It eventually looses the faith of its regular users and due to this; users are forced to look for the alternative of your product. Whenever they find a better alternative they switch immediately and never comeback. This leads to loss of branding and revenue for the product.
  5. Low morale of the team: Who doesn’t want the appreciation for good work? Studies have shown that it’s not the money but the good work satisfaction which leads to a great team which eventually leads to great product and great company. But when the things start getting out of control and there is no way getting out of it, lot of things start happening with in the team too. These are
    1. Lower enthusiasm of developers and managers towards their work.
    2. Mistrust between the team members and the managers. They start blaming each other even for small reasons.
    3. Frequent late night works and working weekends.
    4. ‘Heated therapy sessions’ for and between developers and managers.
    5. Lower ratings in appraisal meetings for the team.
    6. No time for your own
    7. And could be many more…

Good coding practice and discipline has the power to avoid all the above events or able to reduce its effect to such an insignificant level that all the parties could go to sleep peacefully in the night after work. What to ask more from your life? We all have friends, families, hobbies in our lives and for a healthy state of mind we do need time and mental space for these things too. If good coding practices could bring all these things to your life, isn’t it a bad idea to give it a try?

In my next part of the article I would try to write about the different good coding practices and the interconnection between them. In the mean time you could read about the standardization of code, which is the first step towards good coding practices.

http://www.dagbladet.no/development/phpcodingstandard/