How to Configure Network Connection After Centos Minimal Install

After I install Centos 6.8 on my virtual machine, I don’t have a network connection ready for use. Following is the steps that I did to configure my network connection.

  1. Configure DHCP client on the default network interface eth0
    dhclient eth0
  2. Make sure that the networking is enabled
    # cat /etc/sysconfig/network
    NETWORKING=yes
    HOSTNAME=xxx.sd.dev
  3. Edit the network config file for the default network interface eth0
    vi /etc/sysconfig/network-scripts/ifcfg-eth0

    with the following value

    ONBOOT=yes
  4. Restart the network service
    service network restart
  5. Make sure that the
    ifconfig

Favorite Git Config

Having used to type git commands won’t make us able to remember those long line commands. I always relies on git alias. I would like to share with you my favorites git aliases.

You can either type the following command to add the alias into your git config.

git config --global alias.lol "log --pretty=format:'%C(green)%h %C(red)%ad %C(cyan)%an%C(green)%d %Creset%s' --date=short --graph"
git config --global alias.recent "for-each-ref --sort=-committerdate refs/heads --format='%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)'" git config --global alias.lg-tag "log --no-walk --tags --pretty='%h %d %s' --decorate=full" git config --global alias.st status
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit

Or, you can also add new line to~/.gitconfig

Finally, to double check you can try the alias directly, or simply list them down.

$ git config --list | grep alias

alias.lg=!git lg1

alias.lg1=!git lg1-specific --all

alias.lg2=!git lg2-specific --all

alias.lg3=!git lg3-specific --all

alias.lg1-specific=log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'

alias.lg2-specific=log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'

alias.lg3-specific=log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'

alias.lg-tag=log --no-walk --tags --pretty='%h %d %s' --decorate=full

alias.lol=log --pretty=format:'%C(green)%h %C(red)%ad %C(cyan)%an%C(green)%d %Creset%s' --date=short --graph

alias.recent=for-each-ref --sort=-committerdate refs/heads --format='%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)'