Skip to content

Instantly share code, notes, and snippets.

@jesinity
Last active March 28, 2018 13:11
Show Gist options
  • Save jesinity/9dcb11562510fb9af19efb3c62107e75 to your computer and use it in GitHub Desktop.
Save jesinity/9dcb11562510fb9af19efb3c62107e75 to your computer and use it in GitHub Desktop.
export PS1="\[\033[38;5;11m\]\u\[$(tput sgr0)\]\[\033[38;5;13m\]@\[$(tput sgr0)\]\[\033[38;5;10m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;13m\]{\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;14m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;13m\]=>\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"
export CLICOLOR=1
export LSCOLORS="Gxfxcxdxbxegedabaggdgd"
#maven and sbt
alias mvncleaninstall='mvn clean install -DskipTests=true'
alias sbttar='sbt clean package universal:packageZipTarball'
#navigation aliases
alias ..='cd ..'
alias ....='cd ../../'
alias ......='cd ../../..'
alias c='clear'
alias lsabs='function _lsabs(){ ls -d -1 $PWD/$1; }; _lsabs'
alias ll='ls -lartGFh'
# git aliases
alias gitgraph='git log --oneline --abbrev-commit --all --graph --decorate'
alias gitstatus='git status -s'
alias gitbranchdelete='function _gitbranchdelete(){ git branch -D $1; git push origin --delete $1 ;};_gitbranchdelete'
alias gitbranchbyauthor='git for-each-ref --format=" %(authorname) %09 %(refname)" --sort=authorname'
alias chmodsh='find . -name "*.sh" | xargs chmod +x $1'
alias dusort='du -hs * | sort -h'
alias findgrep='function _findgrep(){ find "$1" -name "$2" -type f -exec grep --color=auto -nir "$3" {} \; ; }; _findgrep'
alias findgrep_2='function _findgrep(){ grep --color=auto -nir "$3" $(find "$1" -name "$2" -type f) ; }; _findgrep'
alias taillatest='ls -atr | tail -1 | xargs tail -f $1'
alias findsed='function _findsed(){ find "$1" -name "$2" -type f -exec grep -l "$3" {} \; -exec sed -i "" "s/$3/$4/g" {} \; ; }; _findsed'
# kafka aliases
alias zkstart='function _zkstart(){ cd $KAFKA_HOME; bin/zookeeper-server-start.sh config/zookeeper.properties; }; _zkstart'
alias kafka_start='function _kafka_start(){ cd $KAFKA_HOME; bin/kafka-server-start.sh config/server.properties ;}; _kafka_start'
alias kafka_create_topic='function _kafka_create_topic(){ cd $KAFKA_HOME ; bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic $1 ;}; _kafka_create_topic'
alias kafka_delete_topic='function _kafka_delete_topic(){ cd $KAFKA_HOME ; bin/kafka-topics.sh --delete --zookeeper localhost:2181 --topic $1 ;}; _kafka_delete_topic'
alias kafka_console_producer='function _kafka_console_producer(){ cd $KAFKA_HOME ; bin/kafka-console-producer.sh --broker-list localhost:9092 --topic $1 ;}; _kafka_console_producer'
alias kafka_console_consumer='function _kafka_console_consumer(){ cd $KAFKA_HOME ; bin/kafka-console-consumer.sh --broker-list localhost:9092 --topic $1 ;}; _kafka_console_consumer'
alias df='df -H'
alias du='du -ch'
## pass options to free ##
alias meminfo='free -m -l -t'
## get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
## get top process eating cpu ##
alias pscpu='ps auxf | sort -nr -k 3'
alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
## Get server cpu info ##
alias cpuinfo='lscpu'
alias nowtime=now
alias nowdate='date +"%d-%m-%Y"'
# handy short cuts #
alias h='history'
alias j='jobs -l'
alias fastping='ping -c 100 -s.2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment