Friday, May 24, 2013

Free Source Code Hosting for Personal/Business Use

Even as student or  in life time of Engineer we do many things, many great things (hehe), tonnes of projects, seminars etc. and we never know when we might need to re-touch or re-collect the project codes, presentations, latex reports, documents and so and so ... yes storing them on the optical disk or in some back-up drive is good idea but not the great one... we never know when this stuff stop working, after all we built it... isn't it? So you need to put them in place where they never get lost....on SOURCE CODE HOSTING SITES.

So there are many free source code hosting sites out there. Some of them can be used for small businesses for sharing and development, most of them comes with version control tools like mercurial (on of the best and easy). Here I am going to introduce you to some of them.


  1. Bitbucket:
    This is the one of the best source code hosting site suited for small business and of course for personal use too, its closed source site, no one can peek into your repository. For business purpose you can share any repository between FIVE users for free. You need to pay for more than five users. It comes with mercurial and git version control tools. Only disadvantage is that, if you are going to develop some open source tool/project you cant put good wiki pages related to your project.



    Advantage: Closed source code, no one can peek into your code, professional tool
    Disadvantage: No good wiki support
    Version Control: Mercurial, Git
  2. CodePlex:
    This is Microsoft's code hosting site. This is having most elegant interface and awesome wiki support. It also has best code sharing, discussion forum support. It has all facilities that person/group need for open source project development.
     

    AdvantageBest suited for open source projects. It has wiki, forum, sharing support, elegant design.
    DisadvantageYour code might not be closed.
    Version Control: Mercurial, Git
  3. Google Code:
    As can be seen from name itself, its service provided by Google. It also has good facilities, but interfaces are not that good. CodePlex is better than this, which provides same (more) services in elegant way. But one advantage is that, its linked to your Google mail account.


    AdvantageGives all basic tools with simple interface. Linked to your Google account, wiki support.
    Disadvantage: Interface is simple, your code might not be closed.
    Version Control: Mercurial, Git


So, in short if you are looking for personal, closed source backup tool or small business source sharing tool BitBucket it best suited for you. If you are open source enthusiast CodePlex is best suited. Google Code is just an alternative if you are looking for...

Cheers !!! 

Thursday, May 23, 2013

Create your own Linux (custom) commands

Hi,
Most of the time we need to use some commands repeatedly while working. It's just annoying to type them again and again, of course we can use reverse search [ctrl+r] for reverse command search but I am lazier than that ;)

Here are couple of ways to customize (or get more lazy) Linux commands,

  • Use Aliases to Customize Linux Commands:

This is actually for small commands (can be used for large ones also). You can set it in terminal as bellow,
 $alias ll='ls -l'  

Now onward whenever you execute 'll' command it will work as 'ls -l', so simple.

Another way is to add aliases in .bashrc file in your home directory so it will become permanent.
e.g. put following at end of ~/.bashrc

 # Aliases:   
 alias ll='ls -l'   
 alias la='ls -a'   

  • Write shell scripts for your commands:
This is when you need some larger scripts as your shorten command. In this case you can write script and put them under bin directory in your home directory. You also need to give exe permission to the script.

e.g  I want to make following script as my Linux command. This script initializes the current directory as root for  cscope and also creates cscope database for recursive directory structure,

 #!/bin/bash    
 # cscope_init script   
 # Creating cscope database for large project    
 # with recursive deirectory structure    
 # First go to root dir of the source code    
 # Run this script - cscope_init $PWD   
 if test $# -ne 1; then    
  echo "usage - $0 <PROJ_ROOT>"    
  exit 1    
 fi    
 echo "PROJ_ROOT - $1"    
 cd /    
 find $1 -name "*.[ch]" -o -name "*.asm" > $1/cscope.files    
 cd $1    
 cscope -b -q -k    
 echo "Done!   
write this script to cscope_init file, and add permission to execute it.

 $chmod +x cscope_init   

Now copy this file to ~/bin/cscope_init. Now onward you can run following command in any directory to create recursive cscope database for that directory,

 $cd /path/to/project/root/directory
 $cscope_init $PWD  

Result,
 PROJ_ROOT - /path/to/project/root/directory   
  Done!   

Done!!!!!!