Monday, July 21, 2014

Associating a Local Git Repository To A Remote Github Repository

One of the things that gets me really frustrated while trying to learn something new and wanting to save my practice code in Github so as to:

  • Not lose them and have them for reference whenever I need it.
  • So as to be able to access them anytime I needed them
is that I have to mess around with Github + Egit + Eclipse for much longer than actually learning/writing something new.

In any case, here's a common mistake that I've been doing and see lot of my peers do when starting to work with Git and Git hub and that is when wanting to associate a remote Github repository with a local git repository created using  
  • Egit plugin for eclipse
  • Using the git init command from the terminal 
it is incorrect to execute the git remote add command from any other place other than the local git repo directory [the one containing .git folder]

Here's the steps that I normally take:
  1. Create a remote Github repository such as Messing-With-Python
  2. Create a local git repository on my computer FirstPythonProject
  3. Execute the following in the terminal from the FirstPythonProject [This directory should have a .git hidden directory]
git remote add origin https://github.com/<username>/Messing-With-Python.git


Monday, September 23, 2013

Given a singly-linked-list,  a program to reverse the list and return the new head-node


I was given this question in an interview recently and I did something that nobody likes to do in an interview - quit thinking !!! The problem looks fairly simple superficially, but is a little trickier than one would think. It might've been fairly easier if I had previously encountered this question and had given a try. But in any case, after messing up and providing a horrendously inefficient and possibly incorrect implementation I got back home, relaxed and thought :) [That's right, only if I did this earlier] about it and came up with a few implementation which I decided to post:

Sunday, March 25, 2012

Unable to view site created using Joomla

For Joomla newbies like me, if you are unable to open your site and all you can see is this wretched piece of error trace in your browser, just CHILL !!!
You are most likely facing this problem while installing a copy of Joomla on your computer with sample data (http://docs.joomla.org/Use_Joomla!_on_your_own_computer)

Warning: require_once(/Applications/XAMPP/xamppfiles/htdocs/joomla25/configuration.php) [function.require-once]: failed to open stream: Permission denied in/Applications/XAMPP/xamppfiles/htdocs/joomla25/includes/framework.php on line 52
Fatal error: require_once() [function.require]: Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/joomla25/configuration.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/Applications/XAMPP/xamppfiles/lib/php/pear') in /Applications/XAMPP/xamppfiles/htdocs/joomla25/includes/framework.php on line 52

The problem isn't as ugly as it appears. Read the details a little carefully and you notice a sentence saying "Failed opening required ..... configuration.php"

So, that's the problem ! Joomla could not open/read the configuration.php file.
Once you know the problem, it is easier to find the solution. And the solution obviously is:
1. Check if the file exists.
2. If it does NOT exist, create one under the root Joomla directory and give it necessary permissions.
    In my case the root Joomla directory on my Mac is /Applications/XAMPP/htdocs/joomla25
3. If it does exist, check if the READ permissions are available to all the users (i.e. you, group and others)
    If you happened to follow an earlier post that was related to another problem (the solution to which happened to be creating the configuration.php file with only write parameters), you definitely want to give permissions to the file using the following
chmod o+r configuration.php
Once the configuration.php file exists and is readable to all users, refresh your site page and your problem should be solved. If not, please let me know and I can update this blog so that other wanderers like you and I find a problem to the solution.


My Joomla setup has:
  • OS: Mac OSX SnowLeopard 10.6.8
  • Server: XAMPP 1.7.3
  • Joomla Version: 2.5
  • Joomla installation directory name under htdocs: joomla25

P.S: And if this article was an eye-opener, don't be shy :) . Just go ahead and +1 or Like this - so that people experimenting with Joomla are not put off by little problems !!!  Joomla!  !!!

Joomla Pre-Installation Check - JSON Support: NO


Like most newbies trying their hands at Joomla, I was clueless when I found the pre-installation check shouting out in RED that the environment didn't support JSON.

First of all, this is what I'm using:

  • OS: Mac OSX SnowLeopard 10.6.8
  • Server: XAMPP 1.7.3
  • Joomla Version: 2.5
  • Joomla installation directory name under htdocs: joomla25

So the first thing I did to check what was going wrong was to check if the my server or the application environment really didn't support JSON. And how did I do this ?

Opened up the browser and typed in http://localhost/joomla25. This opens up a page with details of the server environment and I found that the JSON libraries were present.

Surprisingly, I didn't find any useful information to solve this in the Joomla forum. Although there were was one that talked about it but I could hardly say if there was a solution mentioned out there. But a little blog (http://desveladisimo.com/blog/solved-joomla-json-support-no/)told me that the solution to this problem is:

Create a file called as configuration.php in the root Joomla installation directory, which in my case is /Applications/XAMPP/htdocs/joomla25 and give all users write permissions on it using
chmod 622 configuration.phpor
chmod a+w configuration.php

Thanks to the author to take the trouble to blog it and help some of us.
Now I clicked the "Check Again" button in the preinstallation check page and voila !!!

Wow, problem solved !! But C'mon, something here just didn't make sense ! WTF is the connection between JSON support and a dumb empty configuration.php file in the root folder ??????

A little thinking and that's when it occurred to me that , after the  JSON-support check was a check to see if the configuration.php file was Writeable !!!!! And that the actual problem was that there was no configuration.php file that gets created by default and therefore is not writeable. But the vertical clearance between the two is so less that it appears as though the NO status is for the JSON Support !!!
The attached image explains it a little more clearly.

So, at then end of this exercise I reckon that I was trying to solve the wrong problem !! But thanks to the clues that I got from the author of the blog I mentioned earlier, I was able to figure out both the problem and the solution.

P.S: And if this article was an eye-opener, don't be shy :). Just go ahead and +1 or Like this - so that people experimenting with Joomla are not put off by little problems and also so that they don't have to take the trouble of finding answers to problems they don't know :) !!!  Joomla!  !!!