Wednesday, September 2, 2009

Good Ubuntu Terminal color scheme

After a lot of trial and error below are the color combinations for the Ubuntu Terminal that I found very pleasant to the eyes and having good visual cues.

STEP 1:
=====
Change the ubuntu prompt to

export PS1= ${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$

If you want to make this change permanent after trying it on a terminal, copy the line(without the export part :) into your .bashrc file located in your home folder. The changes will be retained next time you reboot your computer.

STEP 2:
=====
Open the Profile Preferences by going to Edit-->Profile Preferences and then click the Colors Tab. In that window, in the Foreground and Background color section choose Gray on Black from the Built-in Schemes dropdown. In the Palette section choose Tango from the Built-in Schemes dropdown.

This combined with the vim editor will make you prefer the terminal over any other IDE.

Sanjay.

Thursday, July 30, 2009

mysql sock error

If you are getting an error like below when you start your rails server, it means that the rails environment is not able to find the mysql.sock file required to initialize a connection to the database.

/!\ FAILSAFE /!\ Thu Jul 30 13:44:11 -0400 2009
Status: 500 Internal Server Error
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
/home/sanjaymk/projects/rails/chariot/july2009/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:576:in `real_connect'

This could be either fixed by removing the socket: line in your database.yml or by finding the mysql.sock file by issuing the command mysql_config --socket in your terminal prompt. This command(mysql_config) prints out the location of your mysql.sock file.

Thanks,
Sanjay

Wednesday, July 8, 2009

SVN issue using Ubuntu 9.04

Hello All,

I recently upgraded to Ubuntu Ver. 9.04(Jaunty Jackalope). After the upgrade, I was not able to run SVN on the command line or SVN using tools like Netbeans 6.5 Beta.

The error I was getting was

/usr/bin///usr/local/lib/libldap_r-2.4.so.2: no version information available (required by /usr/lib/libaprutil-1.so.0)

/usr/bin///usr/local/lib/libldap_r-2.4.so.2: no version information available (required by /usr/lib/libpq.so.5)


From the error, looks like the SVN client is looking for a library in a different location.

The sequence of steps that I did to fix it is

STEP 1:
=======
sudo nano /etc/ld.so.conf.d/libc.conf

Commented the existing line /usr/local/lib and added the line /usr/lib

exit out of the editor.

STEP 2
======
sudo /sbin/ldconfig -v

Restarted command terminal or Netbeans if it is already open and it started to work automagically.

From the output of STEP 2, I'm guessing that I've made the system/OS look for libraries in a different location.

Thanks,
Sanjay.

Tuesday, July 7, 2009

GMail Feature


One of the cool features that was added to GMail was the ability to add a + to your GMail id.

For instance, if your gmail id is myaccount@gmail.com, someone could send you emails by using myaccount+friends@gmail.com.

So, you could give your email id as myaccount+friends@gmail.com to all your friends, you could subscribe to bogleheads as myaccount+bogleheads@gmail.com, subscribe to kohls weekly promotions as myaccount+kohls@gmail.com etc.,

Advantages? You could easily search emails by the keyword(+friends,+bogleheads) and you could also find out who is selling out your emails to spammers!

You could also add any number of periods(.) to the part preceding the @ sign in your email id, so, my.account@gmail.com, m.y.a.c.c.o.u.n.t@gmail.com are all valid email ids of myaccount@gmail.com

Have fun.

Sanjay.

Friday, June 26, 2009

Agile Software Development

What is Agile Software Development? Is it a programming language? Is it an software architecture paradigm? Is it a new technology?

The answer is that Agile Software Development is much more important than those, it is a software development process. Just like there is a process for development of Cars / Medical products / Aeroplanes etc., Agile is a development process model for software. It is much different from the traditional models like Waterfall / Prototyping etc., The problems with the traditional processes was that it assumed that things didn't change during the development life-cycle of a software product, but in reality, software development was done in an highly volatile environment. Software development environment involved a lot of changes - change in resources, changes in technology, changes in requirements, changes in management's view of the software development, changes in the business problem for which the software was developed etc., A very good software development model should be able to adapt to any type of changes that happens in a life cycle and Agile Sofnaltware Development tries to exactly do that.

There are many different Agile Software Development methodologies some of the most widely used ones are

  • SCRUM
  • XP
  • RUP - Rational Unified Process

In my future posts, I plan to touch on the SCRUM methodology and its main concepts.

Wednesday, June 24, 2009

Merge from trunk to branch

Everytime I had to merge some changes from trunk to a branch I spend time on re-learning the commands, so here is my attemp to etching it on the "Internet" so that I don't forget.

Note: The below commands are run from the root working copy location.

STEP 1:
======
prompt>> svn log --stop-on-copy

The command svn log will give you a complete history of comments on a branch, --stop-on-copy would tell the command to stop at a point where the current trunk was made into this branch. For now, lets say note down that revision number or the revision number where the last merge from the trunk was done. Lets assume revision 100 was the revision when this branch was created from the trunk or when the last merge from trunk was done. So, technically we need to merge all the changes in the trunk from 100 upwards.

STEP 2:
======
prompt>>svn merge r:HEAD --dry-run
where
revision_no ==> is the starting revision number to start the merge from
HEAD ===> tells svn to show all the changes from revision_no till the HEAD(which is the last revision) of the branch.
--dry-run ==> tells svn merge command to just give you a list of changes that would be made and not actually make the changes
==> In our case the url to the trunk where we are merging from
==> the working copy location.

so, translating the above to it would be something like

svn merge -r100:HEAD --dry-run svn+ssh://office.mycompany.com/data/svn//project/current/trunk/ .

This would show you a list of files that would be changed and what would be the status. For instance, if there are two files A.java and pom.xml that would be merged, a third file C.java that has a conflict and two files D.java and E.jsp that were added to trunk, it would come up as

M A.java
M pom.xml
C C.java
A D.java
A E.jsp

Remember, you had run the svn merge command with the option of --dry-run, so the actual merge hasn't taken place yet. So, if you feel confident about the changes coming in, run the same command as shown above but this time without the --dry-run option. svn would merge the changes and show the same result as above.

The important step now is that when you commit the above changes do it with a comment of that is informative like "All changes were merged from Trunk". Why? Because lets say down the line after a month or so, and you are again ready to merge changes from the trunk, you can just start from this checked in revision and not do the merge from all the way back at the start of the branch.

It would be nice if svn merge command would be able to figure this out instead of us keeping track from the comments, but at this time that seems to be the only option.