Last active
December 4, 2017 03:41
-
-
Save lidgen/0890adf632b63c444d864a44db9d0c7f to your computer and use it in GitHub Desktop.
bashrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bashrc | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
export HISTTIMEFORMAT="%d.%m.%y %T " | |
# EXPORT | |
export SPARK_HOME=/opt/spark | |
export PATH="$PATH:$SPARK_HOME/bin:$SPARK_HOME/sbin" | |
# Anaconda2 | |
export PATH=~/anaconda2/bin:$PATH | |
# python environment | |
export PYTHONPATH="$SPARK_HOME/python/lib/py4j-0.10.1-src.zip:$SPARK_HOME/python:$SPARK_HOME/python/pyspark" | |
# .bash_history file changes | |
export HISTFILESIZE=400000000 | |
export HISTSIZE=10000 | |
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" | |
shopt -s histappend | |
alias rm='rm -i' | |
alias df='df -h' | |
alias la='ls -al' | |
# tmux | |
alias tls='tmux ls' | |
alias ta='tmux a -t' | |
# git alias | |
alias gs='git status' | |
alias gb='git branch' | |
alias gd='git diff' | |
alias gcm='git commit -am' | |
alias gco='git checkout' | |
alias pkl='pkill -9 python && ps -af' | |
alias psa='ps -af' | |
alias psj='ps -ef | grep $UID' | |
# Git cmd | |
function gt() | |
{ | |
whitespace="[[:space:]]" | |
digit="[[:digit:]]" | |
cmd_all="git" | |
push=false | |
commit=false | |
echo "The first option must be [a]dd/[c]heckout/[p]ush/p[u]ll/[c]o[m]mit." | |
for i in "$@" | |
do | |
if [[ $i =~ $whitespace ]]; then | |
i=\"$i\" | |
fi | |
if [[ $i = "u" ]]; then | |
i="pull origin" | |
elif [[ $i = "p" ]]; then | |
i="push origin" | |
push=true | |
elif [[ $i = "c" ]]; then | |
i="checkout" | |
elif [[ $i = "a" ]]; then | |
i="add" | |
elif [[ $i = "cm" ]]; then | |
i="commit -m" | |
commit=true | |
fi | |
if [[ $i = "dev" ]]; then | |
i="rtcma_develop" | |
elif [[ $i =~ $digit ]]; then | |
if [[ $commit = false ]]; then | |
i="rtcma_feature/AO-"$i | |
fi | |
fi | |
cmd_all=$cmd_all" "$i | |
done | |
if [[ $push = true ]]; then | |
read -p "You are going to do +++ $cmd_all +++. (y) for yes." pu | |
if [[ $pu != "y" ]]; then | |
echo "Cancelled" | |
return | |
fi | |
fi | |
echo $cmd_all | |
$cmd_all | |
echo " " | |
echo "==========" | |
echo "GIT BRANCH" | |
git branch | |
echo " " | |
echo "==========" | |
echo "GIT STATUS" | |
git status | |
echo " " | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment