Merged bash_aliases, bash_functions, and bashrc into bashrc
This commit is contained in:
parent
f0061064a4
commit
5606a68a58
40
bash_aliases
40
bash_aliases
@ -1,40 +0,0 @@
|
|||||||
#Colors!
|
|
||||||
alias ls='ls --color=always -F'
|
|
||||||
alias less='less -r'
|
|
||||||
alias tree='tree -C'
|
|
||||||
alias grep="grep --color=auto"
|
|
||||||
|
|
||||||
alias skim="(head -5; tail -5) <"
|
|
||||||
|
|
||||||
# Show where you copy
|
|
||||||
alias cp="cp -v"
|
|
||||||
|
|
||||||
alias la='ls -lah $LS_COLOR'
|
|
||||||
function cl(){ cd "$@" && ls; }
|
|
||||||
|
|
||||||
alias dt='date "+%F %T"'
|
|
||||||
#HISTCONTROL=ignoredups
|
|
||||||
#PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo `dt` `pwd` $$ $USER "$(history 1)" >> ~/.bash_eternal_history && sed -i \'$ d\' ~/.bash_eternal_history'
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$BASH" ]; then
|
|
||||||
export HISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S "
|
|
||||||
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo "`date +'%y.%m.%d-%H:%M:%S:'`" $USER "$(pwd)" "$(history 1 | cut -c8-)" >> ~/.bash_eternal_history'
|
|
||||||
alias ehistory='cat ~/.bash_eternal_history|grep $@'
|
|
||||||
#readonly PROMPT_COMMAND
|
|
||||||
readonly HISTSIZE
|
|
||||||
readonly HISTFILE
|
|
||||||
readonly HOME
|
|
||||||
readonly HISTIGNORE
|
|
||||||
readonly HISTCONTROL
|
|
||||||
fi
|
|
||||||
|
|
||||||
alias install='sudo apt-get install'
|
|
||||||
alias remove='sudo apt-get remove'
|
|
||||||
alias update='sudo apt-get update'
|
|
||||||
alias upgrade='sudo apt-get upgrade'
|
|
||||||
alias autoremove='sudo apt-get autoremove'
|
|
||||||
alias ..='cl ..'
|
|
||||||
alias ytdl="youtube-dl $@ -x --audio-format mp3 --audio-quality 0 -c -o '%(title)s.%(ext)s'"
|
|
||||||
alias tux="tmux a||tmux"
|
|
||||||
alias rmgit="git remote rm origin;git remote rm https"
|
|
@ -1,31 +0,0 @@
|
|||||||
extract () {
|
|
||||||
if [ -f $1 ] ; then
|
|
||||||
case $1 in
|
|
||||||
*.tar.bz2) tar xvjf $1 ;;
|
|
||||||
*.tar.gz) tar xvzf $1 ;;
|
|
||||||
*.bz2) bunzip2 $1 ;;
|
|
||||||
*.rar) rar x $1 ;;
|
|
||||||
*.gz) gunzip $1 ;;
|
|
||||||
*.tar) tar xvf $1 ;;
|
|
||||||
*.tbz2) tar xvjf $1 ;;
|
|
||||||
*.tgz) tar xvzf $1 ;;
|
|
||||||
*.zip) unzip $1 ;;
|
|
||||||
*.Z) uncompress $1 ;;
|
|
||||||
*.7z) 7z x $1 ;;
|
|
||||||
*) echo "don't know how to extract '$1'..." ;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
echo "'$1' is not a valid file!"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
export -f extract
|
|
||||||
function initify(){
|
|
||||||
git init
|
|
||||||
git remote add origin git@98.26.78.121:$1/$2.git
|
|
||||||
git remote add https https://98.26.78.121/gitlab/$1/$2.git
|
|
||||||
#Offline mode
|
|
||||||
git remote add oOrigin git@10.0.1.200:$1/$2.git
|
|
||||||
git remote add oHttps https://10.0.1.200/gitlab/$1/$2.git
|
|
||||||
git remote -v
|
|
||||||
}
|
|
||||||
export -f initify
|
|
99
bashrc
99
bashrc
@ -93,22 +93,6 @@ alias l='ls -CF'
|
|||||||
# sleep 10; alert
|
# sleep 10; alert
|
||||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||||
|
|
||||||
# Alias definitions.
|
|
||||||
# You may want to put all your additions into a separate file like
|
|
||||||
# ~/.bash_aliases, instead of adding them here directly.
|
|
||||||
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
|
||||||
|
|
||||||
if [ -f ~/.bash_aliases ]; then
|
|
||||||
. ~/.bash_aliases
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f ~/.bash_functions ]; then
|
|
||||||
. ~/.bash_functions
|
|
||||||
fi
|
|
||||||
|
|
||||||
# enable programmable completion features (you don't need to enable
|
|
||||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
|
||||||
# sources /etc/bash.bashrc).
|
|
||||||
if ! shopt -oq posix; then
|
if ! shopt -oq posix; then
|
||||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||||
. /usr/share/bash-completion/bash_completion
|
. /usr/share/bash-completion/bash_completion
|
||||||
@ -124,3 +108,86 @@ function tsh(){
|
|||||||
[[ -s /home/stonewareslord/.autojump/etc/profile.d/autojump.sh ]] && source /home/stonewareslord/.autojump/etc/profile.d/autojump.sh
|
[[ -s /home/stonewareslord/.autojump/etc/profile.d/autojump.sh ]] && source /home/stonewareslord/.autojump/etc/profile.d/autojump.sh
|
||||||
export PATH=/home/stonewareslord/.autojump/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/stonewareslord/tmp/ucpp/ucpp/:/home/stonewareslord/tmp/ucpp/ucpp/:/home/stonewareslord/hitchhikers/bin/ucpp/ucpp:/home/stonewareslord/hitchhikers/bin/ucpp/ucpp
|
export PATH=/home/stonewareslord/.autojump/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/stonewareslord/tmp/ucpp/ucpp/:/home/stonewareslord/tmp/ucpp/ucpp/:/home/stonewareslord/hitchhikers/bin/ucpp/ucpp:/home/stonewareslord/hitchhikers/bin/ucpp/ucpp
|
||||||
alias frcbot='python build'
|
alias frcbot='python build'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Alias definitions.
|
||||||
|
#Colors!
|
||||||
|
alias ls='ls --color=always -F'
|
||||||
|
alias less='less -r'
|
||||||
|
alias tree='tree -C'
|
||||||
|
alias grep="grep --color=auto"
|
||||||
|
|
||||||
|
alias skim="(head -5; tail -5) <"
|
||||||
|
|
||||||
|
# Show where you copy
|
||||||
|
alias cp="cp -v"
|
||||||
|
|
||||||
|
alias la='ls -lah $LS_COLOR'
|
||||||
|
function cl(){ cd "$@" && ls; }
|
||||||
|
|
||||||
|
alias dt='date "+%F %T"'
|
||||||
|
#HISTCONTROL=ignoredups
|
||||||
|
#PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo `dt` `pwd` $$ $USER "$(history 1)" >> ~/.bash_eternal_history && sed -i \'$ d\' ~/.bash_eternal_history'
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$BASH" ]; then
|
||||||
|
export HISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S "
|
||||||
|
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo "`date +'%y.%m.%d-%H:%M:%S:'`" $USER "$(pwd)" "$(history 1 | cut -c8-)" >> ~/.bash_eternal_history'
|
||||||
|
alias ehistory='cat ~/.bash_eternal_history|grep $@'
|
||||||
|
#readonly PROMPT_COMMAND
|
||||||
|
readonly HISTSIZE
|
||||||
|
readonly HISTFILE
|
||||||
|
readonly HOME
|
||||||
|
readonly HISTIGNORE
|
||||||
|
readonly HISTCONTROL
|
||||||
|
fi
|
||||||
|
|
||||||
|
alias install='sudo apt-get install'
|
||||||
|
alias remove='sudo apt-get remove'
|
||||||
|
alias update='sudo apt-get update'
|
||||||
|
alias upgrade='sudo apt-get upgrade'
|
||||||
|
alias autoremove='sudo apt-get autoremove'
|
||||||
|
alias ..='cl ..'
|
||||||
|
alias ytdl="youtube-dl $@ -x --audio-format mp3 --audio-quality 0 -c -o '%(title)s.%(ext)s'"
|
||||||
|
alias tux="tmux a||tmux"
|
||||||
|
alias rmgit="git remote rm origin;git remote rm https"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Functios
|
||||||
|
extract () {
|
||||||
|
if [ -f $1 ] ; then
|
||||||
|
case $1 in
|
||||||
|
*.tar.bz2) tar xvjf $1 ;;
|
||||||
|
*.tar.gz) tar xvzf $1 ;;
|
||||||
|
*.bz2) bunzip2 $1 ;;
|
||||||
|
*.rar) rar x $1 ;;
|
||||||
|
*.gz) gunzip $1 ;;
|
||||||
|
*.tar) tar xvf $1 ;;
|
||||||
|
*.tbz2) tar xvjf $1 ;;
|
||||||
|
*.tgz) tar xvzf $1 ;;
|
||||||
|
*.zip) unzip $1 ;;
|
||||||
|
*.Z) uncompress $1 ;;
|
||||||
|
*.7z) 7z x $1 ;;
|
||||||
|
*) echo "don't know how to extract '$1'..." ;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
echo "'$1' is not a valid file!"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
export -f extract
|
||||||
|
function initify(){
|
||||||
|
git init
|
||||||
|
git remote add origin git@98.26.78.121:$1/$2.git
|
||||||
|
git remote add https https://98.26.78.121/gitlab/$1/$2.git
|
||||||
|
#Offline mode
|
||||||
|
git remote add oOrigin git@10.0.1.200:$1/$2.git
|
||||||
|
git remote add oHttps https://10.0.1.200/gitlab/$1/$2.git
|
||||||
|
git remote -v
|
||||||
|
}
|
||||||
|
export -f initify
|
||||||
|
4
sync.sh
4
sync.sh
@ -39,14 +39,12 @@ do
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
rm ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.gitignore_global ~/.bashrc ~/.bash_aliases ~/.bash_functions
|
rm ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.gitignore_global ~/.bashrc
|
||||||
ln -s ${PWD}/gitignore_global ~/.gitignore_global
|
ln -s ${PWD}/gitignore_global ~/.gitignore_global
|
||||||
ln -s ${PWD}/vimrc ~/.vimrc
|
ln -s ${PWD}/vimrc ~/.vimrc
|
||||||
ln -s ${PWD}/vimperatorrc ~/.vimperatorrc
|
ln -s ${PWD}/vimperatorrc ~/.vimperatorrc
|
||||||
ln -s ${PWD}/gitconfig ~/.gitconfig
|
ln -s ${PWD}/gitconfig ~/.gitconfig
|
||||||
ln -s ${PWD}/bashrc ~/.bashrc
|
ln -s ${PWD}/bashrc ~/.bashrc
|
||||||
ln -s ${PWD}/bash_aliases ~/.bash_aliases
|
|
||||||
ln -s ${PWD}/bash_functions ~/.bash_functions
|
|
||||||
if [ -f ~/.vim/plugin/ ]
|
if [ -f ~/.vim/plugin/ ]
|
||||||
then
|
then
|
||||||
echo "Installing plugin folder in ~/.vim/"
|
echo "Installing plugin folder in ~/.vim/"
|
||||||
|
Loading…
Reference in New Issue
Block a user