Friday 26 June 2015

Linux Help

1. Using Extra Monitor but closing the Lid of Laptop make the other monitor sleep too.

Best solution to make the extra monitor alive even though Lid is closed.

$ sudo vim /etc/UPower/UPower.conf
Edit the line at the end : ignoreLid=false as below:
# <snip> ...

ignoreLid=true

# <snip> ...

Friday 12 June 2015

Git Commands

As a wireless engineer you have to use Linux and Git for your software development work.Here i have tried to give a basic Idea of Git with some useful commands.Git is one of the most used Version control system for software development. It is quire powerful but looks ugly when you start using it for the first time.

Here I have tried to put all the useful basic Git commands at one place.
Helpful to any one who wants to learn.

Git v/s GitHub : Most people who start using Git gets confused between Git and GitHub , In a simple line Git is a version control that works on your local machine. GitHub is something like cloud based solution where you can sync and share your local repository. GitHub helps you develop the software when you are collaboration with other developers/colleagues.
  • ~ $ git init : initialize a new repository in current directory.
  • ~ $ git status: shows the current status of files changed.
  • ~ $ git log : Displays the current commit history in your repository. As stated above don't get confused, git gives you information about your local repository which will be same as the one you clones/pulled from GitHub.
  • ~ $ git log --graph: shows the commit log in graphical flow.
  • ~ $ git show Commit-ID : Shows the changes that where made in the commit represent by the Commit-ID.
  • ~ $ git log -n 1 : shows the log for top most commit.
  • ~ $ git diff : git diff without any argument shows the difference between your working directory and staging area.
  • ~ $ git diff --staged : shows the difference between the staging area and your local repository.


  • ~ $ git config --global color.ui auto : make color scheme of the shell auto for git.
  • ~ $ git config --global core.editor "subl -n -w" : make current/default editor as sublime for git.you can chose any editor you want.
  • ~ $ git clone url : clone git from GitHub Url into your current local directory.
  • ~ $ git checkout branch : makes current working head as branch.
  • ~ $ git branch : git branch without any argument tells you the current branch where you are.
  • ~ $ git branch branch-name : create a new branch with name as branch-name.
  • ~ $ git add filename : Add the file to staging area.
  • ~ $ git commit : commit changes from staging area to repository. Don't get confused that commit will push your changes to GitHub. Commit writes/update your changes to the local repository.
  • ~ $ git merge branch-1 branch-2 : merge branch-1 and branch-2
  • ~ $ git remote : create a remote repository in local that will get synced to GitHub.
  • ~ $ git remote -v : more details about remote repositories.
  • ~ $ git remote add remote-name linlurl : create a remote repository in your local for the link directed by url.
  • ~ $ git push remote-name branch-name : Push current remote with all changes to branch in GitHub specified by branch-name.
  • ~ git fetch branch-name : Updates the local copy of the branch with that on GitHub without pushing changes.




*I would keep on updating with more useful commands and concepts for git.