Tuesday 15 March 2016

Getting Started with Github

Github is a code hosting platform for version control and collaboration. It lets you and other work together on projects from anywhwere. It manage changes to a project without overwriting any part of that project and keeps a snapshot of every change ever made.
Having an overview of github I set up my username and email address, as every Git commit uses this information using the following commands
  $ git config --global username
  $ git config --global user.email

Before moving ahead I went through some words that are used in Git repeatedly like Repository, Version Control, Commit, Branch,etc.
As a beginner without going into too deep, I started with the basic commands for getting started with Git.

To create new git Repository I used "git init" command.
Local repository consists of three trees maintained by git.
Then I learned to add and commit using commands: 
       git add <filename>
       git commit -m "Commit message"
To push changes from HEAD to remote repository, I executed
     git push origin master
After getting started I find it interesting, then i jumped to other commands
like:
    git status
    git log
    git branch
    git branch <filename>
    git checkout <filename>
    git merge <filename>
    git  branch -d <filename>
    git log
    git push
    and many more.....

Practising these commands I am moving forward to get know more about Github through various tutorials and guides.
                                                             

                                                             

Tuesday 8 March 2016

Experiment with Vim

A week ago, I switched to vim. Vim is the most popular editor. It is famous for been faster than other editor and helped me to improve my speed because now my hands rarely need to leave keyboard to perform different tasks.

Vim is a modal editor, its has different modes for inserting, editing, movement, commands, etc. Its three modes are:

- Command Mode
- Insert Mode
- Last Line Mode

Vim can be started by typing to terminal.
- $ vim

For inserting text, type i to enter insert mode and enter text. Type o to enter
insert mode and open line below cursor and O to open line above cursor.

Then I learnt about how to move around a file, when you are in command mode.
 -h moves the cursor one character left.
 -j moves the cursor down the line.
 -k moves the cursor up one line.
 -l moves the cursor one character to the right.
 -0 moves the cursor to the beginning of the line.
 -$ moves the cursor to the end of the line.
 -w move forward one word.
 -b move backward one word.
 -G move to the end of the file.
 -gg move to the beginning of the file.

Next I stepped to cut, copy, paste commands, practiced them and believe me they were easy.
  -e   edit some text at current cursor position
  -r   replace to with some new character
  -x,d delete a character
  -dw  delete a word
  -y   copy
  -p   paste
and many more......

  see line number-       :set nu
  go to particular line- :<line number>
  turn off line number-  :set nu!

Then I learnt about how to move around the files
 -ctrl+F -> Forward one screen
 -ctrl+B -> Scroll backward
 -ctrl+D -> Forward halfscreen
 -ctrl+U -> Backward halfscreen

Also I came through file splitting in vim
 :split -for horizontal split
 :vsplit-for vertical split

Now I'm stepping towards python which will help me to get started with programming.

Sunday 6 March 2016

First baby step toward Linux

Past around 2 years I was working at iQor as a electronics engineer and wanted to give a chance to software industry and I heard about Linux (an open source operating system) which is a perfect platform if you want to start your career in software industry.

I wanted to switch to linux as its a commercial quality software to work with business documents, internet, networking, graphics etc. Also there are hundreds of free, high quality application which can be easily downloaded. So I moved ahead learning the basic commands used in Linux from hard way to learn shell.

The first command I learnt was pwd(print working directory) which is very helpful as it tells in which directory we are. It rescued me many times when I got lost amidst of directories in CLI(Command Line Interfece) while navigating.

Then I went through lot of commands as
- `mkdir`( Make A Directory) used to make directories
- `cd`( Change Directories) a way to navigate to a directory to check log, execute a program/application/script and for every other task.
- `ls` one of the most frequently used command in Linux to list files and directories (along with different options like -l, -a ... etc.).
- `rmdir` to delete directories but it fails if the directory contains files or subdirectories. So we use -p and -r options.
- `pushd` and `popd`, allow to manipulate the directory stack. It is used to change directories and return to the directory from which we came.
- `touch` command used to create empty files.
- `cp` to copy directories and cp - r for copying directories recursively.
- `mv` used to move or rename files.
- `cat` command used to create single or multiple files, view contain of file.
- `rm` to remove files, it doesn't remove directory with files in it, for this we have to recursively delete all of its content(rmdir -r)
- `find` command used to search and locate list of files and directories based on condition we specify for files that match the arguments.

Also learnt about Wildcards which commands can use to perform actions on more than one file at a time, or to find part of a phrase in a text file.

Next step will be learn more about CLI and vim (text editor) to get more exposure in Linux world.