How to create a remote branch and fetch the code in Git

Type the command below to see, what all branches are there in remote.

$ git branch -r
  origin/HEAD -> origin/master
  origin/master
  origin/optimize-cities
  origin/optimize-merchants
  origin/release-dec-30
  origin/sso
  origin/staging

Create the remote Staging branch in local and fetch code:

 $ git checkout --track origin/staging

Install timedoctor in ubuntu 12.04

Sign Up from http://www.timedoctor.com/

Install timedoctor from here:
http://www.timedoctor.com/download.html

Install dependancies:

$ sudo apt-get install libxss1
$ sudo apt-get install libxmu

Go to the downloaded folder and do

$ chmod a+x setup-timedoctor-2.3.5-linux.run
$ ./setup-timedoctor-2.3.5-linux.run

How to know your machine is 32 or 64 bit?

Here is an easy way to find this, in command line type

$ getconf LONG_BIT

Synopsis:

getconf [-v specification] system_var

the getconf utility shall write to the standard output the value of the variable specified by the system_var operand.

So it prints the value of ‘LONG_BIT’.

Read linux manual for getconf: http://linux.die.net/man/1/getconf

 

Shell command for killing all the processes together, that we found using grep command

Sometime when we found a lot of process associates with a software or something that may hurt our memory or CPU, and it would be nice to kill that all process and be our system in a fine position. But when there is so many process we can’t kill all the process by hand using the command

 $ kill -9 PID

where ‘PID’ is the process id.

Shell commands will help us to do this. See below

First you create a .sh file file named ‘killAllProcess.sh’.

#!/bin/bash
echo "Usage : ./killAllProcess.sh "
for i in `ps ax | grep $1 | grep -v grep | sed 's/ *//' | sed 's/[^0-9].*//'`
do
  kill -9 $i
done
echo "Killed All the process which has name with $1"

And make this file executable

$ chmod +x killAllProcess.sh 

Then run it

 $ ./killAllProcess.sh 

And see any process with that name is there

$ ps aux | grep PROCESS_NAME

All vanishes..!!