Skip to content

Instantly share code, notes, and snippets.

View danish-rehman's full-sized avatar

danish-rehman

View GitHub Profile
@danish-rehman
danish-rehman / git_cmd
Last active August 29, 2015 14:13
Git command
#Diff with master
>> git diff master — filename
# Checkout submodule
>> git submodule update
# Undo last commit
>> git reset —soft HEAD~1
# Add remote repo
@danish-rehman
danish-rehman / cmd_beautify
Created January 9, 2015 02:20
Command line beautification
YELLOW="\[\033[0;33m\]"
CLEAR="\[\033[0;0m\]"
PS1="\$(date +%H:%M) \w$YELLOW \$(parse_git_branch)$CLEAR \$ "
@danish-rehman
danish-rehman / git_config_advance
Created January 9, 2015 02:17
Git config advance
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
ref=${ref#refs/heads/}
unpushed=$(git log -- origin/$ref..$ref 2> /dev/null) || return
if [ "$unpushed" ]; then
@danish-rehman
danish-rehman / advance
Last active August 29, 2015 14:13
Git config
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
ref=${ref#refs/heads/}
unpushed=$(git log -- origin/$ref..$ref 2> /dev/null) || return
if [ "$unpushed" ]; then
@danish-rehman
danish-rehman / install_bundler
Created January 9, 2015 02:13
Install bundler
>> gem install bundler
@danish-rehman
danish-rehman / gist:1a4cbd75e7578c404bf6
Created January 9, 2015 02:12
Set a ruby version to be your global version
>> rbenv global 1.9.3-p484
@danish-rehman
danish-rehman / gist:ab0becee6c84b941f7e2
Created January 9, 2015 02:10
Install ruby versions
>> rbenv install -l
>> rbenv install 1.9.3-p484
# Load rbenv
>> eval "$(rbenv init -)"
@danish-rehman
danish-rehman / install_ruby
Created January 9, 2015 02:08
Initial Ruby installation
>> git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
>> git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
>> rbenv rehash
@danish-rehman
danish-rehman / change_txqueuelen
Created January 9, 2015 01:55
Command to change txqueuelen
# Temporarirly
>> ifconfig eth1 txqueuelen 10000
# Permament
# Append the following setting per interface
>> vi /etc/rc.local
/sbin/ifconfig eth1 txqueuelen 10000