first commit
This commit is contained in:
80
roles/base/files/users/super_user/bash/bash_aliases
Normal file
80
roles/base/files/users/super_user/bash/bash_aliases
Normal file
@@ -0,0 +1,80 @@
|
||||
# aliases
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../../../'
|
||||
alias ....='cd ../../../../'
|
||||
alias back='cd $OLDPWD'
|
||||
alias c='clear'
|
||||
alias cd..='cd ..'
|
||||
alias cp='cp -iv'
|
||||
alias chmod="chmod -c"
|
||||
alias chmod="chmod -c"
|
||||
alias df='df -h -x squashfs -x tmpfs -x devtmpfs'
|
||||
alias diff='colordiff'
|
||||
alias egrep='egrep --colour=auto'
|
||||
alias e="vim -O "
|
||||
alias E="vim -o "
|
||||
alias extip='curl icanhazip.com'
|
||||
alias grep='grep --color=auto'
|
||||
alias l.=' ls -lhFa --time-style=long-iso --color=auto'
|
||||
alias ll=' ls -al'
|
||||
alias ls=' ls -lhF --time-style=long-iso --color=auto'
|
||||
alias lsmount='mount |column -t'
|
||||
alias mkdir='mkdir -pv'
|
||||
alias ports='netstat -tulanp'
|
||||
alias h='history'
|
||||
alias j='jobs -l'
|
||||
alias mv='mv -iv'
|
||||
alias speedtest='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -'
|
||||
alias sproxy='ssh -p 2099 -D 9090 -q -C -N -f super_user
|
||||
@vpn.home-network.io'
|
||||
alias ssha='eval $(ssh-agent) && ssh-add'
|
||||
alias svim='sudo vim'
|
||||
alias tn=' tmux new -s'
|
||||
alias vdestroy='vagrant destroy'
|
||||
alias vssh='vagrant ssh'
|
||||
alias vup='vagrant up'
|
||||
alias watch='watch -d'
|
||||
alias weather='curl wttr.in'
|
||||
alias wget='wget -c'
|
||||
|
||||
## get top process eating memory
|
||||
alias mem5='ps auxf | sort -nr -k 4 | head -5'
|
||||
alias mem10='ps auxf | sort -nr -k 4 | head -10'
|
||||
|
||||
## get top process eating cpu ##
|
||||
alias cpu5='ps auxf | sort -nr -k 3 | head -5'
|
||||
alias cpu10='ps auxf | sort -nr -k 3 | head -10'
|
||||
|
||||
## List largest directories (aka "ducks")
|
||||
alias dir5='du -cksh * | sort -hr | head -n 5'
|
||||
alias dir10='du -cksh * | sort -hr | head -n 10'
|
||||
|
||||
# Safetynets
|
||||
# do not delete / or prompt if deleting more than 3 files at a time #
|
||||
alias rm='rm -I --preserve-root'
|
||||
|
||||
# confirmation #
|
||||
alias mv='mv -i'
|
||||
alias cp='cp -i'
|
||||
alias ln='ln -i'
|
||||
|
||||
# Parenting changing perms on / #
|
||||
alias chown='chown --preserve-root'
|
||||
alias chmod='chmod --preserve-root'
|
||||
alias chgrp='chgrp --preserve-root'
|
||||
|
||||
# reload bash config
|
||||
alias reload="source ~/.bashrc"
|
||||
|
||||
# Manage packages easier
|
||||
if [ -f /usr/bin/apt ]; then
|
||||
alias update='sudo apt update'
|
||||
alias upgrade='sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt clean'
|
||||
alias install='sudo apt install'
|
||||
fi
|
||||
|
||||
if [ -f /usr/bin/pacman ]; then
|
||||
alias update='sudo pacman -Syyy'
|
||||
alias upgrade='sudo pacman -Syu'
|
||||
alias install='sudo pacman -S'
|
||||
fi
|
||||
33
roles/base/files/users/super_user/bash/bash_functions
Normal file
33
roles/base/files/users/super_user/bash/bash_functions
Normal file
@@ -0,0 +1,33 @@
|
||||
## Functions
|
||||
# "path" shows current path, one element per line.
|
||||
# If an argument is supplied, grep for it.
|
||||
path() {
|
||||
test -n "$1" && {
|
||||
echo $PATH | perl -p -e "s/:/\n/g;" | grep -i "$1"
|
||||
} || {
|
||||
echo $PATH | perl -p -e "s/:/\n/g;"
|
||||
}
|
||||
}
|
||||
|
||||
extract () {
|
||||
if [ -f $1 ] ; then
|
||||
case $1 in
|
||||
*.tar.bz2) tar xjvf $1 ;;
|
||||
*.tar.gz) tar xzvf $1 ;;
|
||||
*.tar.xz) tar xvf $1 ;;
|
||||
*.bz2) bzip2 -d $1 ;;
|
||||
*.rar) unrar2dir $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.tar) tar xf $1 ;;
|
||||
*.tbz2) tar xjf $1 ;;
|
||||
*.tgz) tar xzf $1 ;;
|
||||
*.zip) unzip2dir $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7z x $1 ;;
|
||||
*.ace) unace x $1 ;;
|
||||
*) echo "'$1' cannot be extracted via extract()" ;;
|
||||
esac
|
||||
else
|
||||
echo "'$1' is not a valid file"
|
||||
fi
|
||||
}
|
||||
3
roles/base/files/users/super_user/bash/bash_profile
Normal file
3
roles/base/files/users/super_user/bash/bash_profile
Normal file
@@ -0,0 +1,3 @@
|
||||
if [ -f ~/.bashrc ]; then
|
||||
source ~/.bashrc
|
||||
fi
|
||||
2
roles/base/files/users/super_user/bash/bash_prompt
Normal file
2
roles/base/files/users/super_user/bash/bash_prompt
Normal file
@@ -0,0 +1,2 @@
|
||||
# PS1 Prompt
|
||||
tty -s && export PS1="\[\033[38;5;35m\]\t [\[\033[38;5;33m\]\j\[\033[38;5;35m\]] [\h:\[$(tput sgr0)\]\[\033[38;5;33m\]\w\[$(tput setaf 3)\]\[\033[38;5;35m\]]\n\\[\033[38;5;35m\]🦄 \[$(tput sgr0)\]"
|
||||
56
roles/base/files/users/super_user/bash/bashrc
Normal file
56
roles/base/files/users/super_user/bash/bashrc
Normal file
@@ -0,0 +1,56 @@
|
||||
# source bash prompt
|
||||
source ~/.bash/bash_prompt
|
||||
|
||||
# Source bash aliases
|
||||
source ~/.bash/bash_aliases
|
||||
|
||||
# Source bash functions
|
||||
source ~/.bash/bash_functions
|
||||
|
||||
# Env
|
||||
export TERM=xterm-256color
|
||||
export EDITOR=vim
|
||||
|
||||
# Don't add duplicate lines or lines beginning with a space to the history
|
||||
HISTCONTROL=ignoreboth
|
||||
|
||||
# Set history format to include timestamps
|
||||
HISTTIMEFORMAT="%Y-%m-%d %T "
|
||||
|
||||
# Correct simple errors while using cd
|
||||
shopt -s cdspell
|
||||
|
||||
# Add /home/$USER/bin to $PATH
|
||||
case :$PATH: in
|
||||
*:/home/$USER/bin:*) ;;
|
||||
*) PATH=/home/$USER/bin:$PATH ;;
|
||||
esac
|
||||
|
||||
# Add /home/$USER/.local/bin to $PATH
|
||||
case :$PATH: in
|
||||
*:/home/$USER/.local/bin:*) ;;
|
||||
*) PATH=/home/$USER/.local/bin:$PATH ;;
|
||||
esac
|
||||
|
||||
# Add /home/$USER/.tmux/tmuxifier to $PATH
|
||||
case :$PATH: in
|
||||
*:/home/$USER/.tmux/tmuxifier/bin:*) ;;
|
||||
*) PATH=/home/$USER/.tmux/tmuxifier/bin:$PATH ;;
|
||||
esac
|
||||
|
||||
# Safetynets
|
||||
# do not delete / or prompt if deleting more than 3 files at a time #
|
||||
alias rm='rm -I --preserve-root'
|
||||
|
||||
# confirmation #
|
||||
alias mv='mv -i'
|
||||
alias cp='cp -i'
|
||||
alias ln='ln -i'
|
||||
|
||||
# Parenting changing perms on / #
|
||||
alias chown='chown --preserve-root'
|
||||
alias chmod='chmod --preserve-root'
|
||||
alias chgrp='chgrp --preserve-root'
|
||||
|
||||
# reload bash config
|
||||
alias reload="source ~/.bashrc"
|
||||
3
roles/base/files/users/super_user/bash/profile
Normal file
3
roles/base/files/users/super_user/bash/profile
Normal file
@@ -0,0 +1,3 @@
|
||||
if [ -f ~/.bashrc ]; then
|
||||
source ~/.bashrc
|
||||
fi
|
||||
Reference in New Issue
Block a user