2019-06-09 00:11:06 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-06-24 12:55:52 -04:00
|
|
|
# PVC hypervisor bashrc file
|
2019-06-09 00:11:06 -04:00
|
|
|
# {{ ansible_managed }}
|
|
|
|
|
|
|
|
#
|
|
|
|
# GENERAL SETTINGS
|
|
|
|
#
|
|
|
|
|
|
|
|
# Before anything, see if we're running interactively. If not, skip everything here.
|
|
|
|
[[ $- == *i* ]] || return
|
|
|
|
|
|
|
|
# Ensure bash completion is enabled if installed
|
|
|
|
if ! shopt -oq posix; then
|
|
|
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
|
|
|
. /usr/share/bash-completion/bash_completion
|
|
|
|
elif [ -f /etc/bash_completion ]; then
|
|
|
|
. /etc/bash_completion
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Some other tweaks
|
|
|
|
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
|
|
|
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
|
|
|
debian_chroot=$(cat /etc/debian_chroot)
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set history limits and values
|
|
|
|
shopt -s cdspell
|
|
|
|
shopt -s dirspell
|
|
|
|
shopt -s dotglob
|
|
|
|
shopt -s histreedit
|
|
|
|
shopt -s histverify
|
|
|
|
shopt -s histappend
|
|
|
|
PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
|
|
|
|
HISTCONTROL=ignoreboth
|
|
|
|
HISTSIZE=25000
|
|
|
|
HISTFILESIZE=25000
|
|
|
|
|
|
|
|
#
|
|
|
|
# BASH SETTINGS
|
|
|
|
#
|
|
|
|
|
|
|
|
# Set a shiny Linux Mint-style PS1 with spaces for easy double-click-select
|
|
|
|
git_branch() {
|
|
|
|
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/git:\1 /'
|
|
|
|
}
|
|
|
|
export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\[\033[01;32m\]\H\[\033[01;34m\] \[\e[35m\]$(git_branch)\[\033[01;34m\]\w \$\[\033[00m\] '
|
|
|
|
|
|
|
|
# Sensible PATH (find things in *sbin* as non-root user)
|
|
|
|
export PATH="/usr/lib/check_mk_agent/plugins:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
|
|
|
|
|
|
|
|
# Set PATH to include ~/Scripts if it exists
|
|
|
|
if [ -d ~/Scripts ]; then
|
|
|
|
export PATH=~/Scripts:$PATH
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set editor to vim
|
2019-06-24 12:55:52 -04:00
|
|
|
export EDITOR=$( which vim )
|
2019-06-09 00:11:06 -04:00
|
|
|
|
|
|
|
# Force SCREEN to xterm due to Debian weirdness
|
|
|
|
export SCREEN="xterm"
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# ALIASES
|
|
|
|
#
|
|
|
|
|
|
|
|
# Coloured command aliases
|
|
|
|
alias ls='ls --color=always'
|
|
|
|
alias dir='dir --color=always'
|
|
|
|
alias vdir='vdir --color=always'
|
|
|
|
alias grep='grep --color=always'
|
|
|
|
alias fgrep='fgrep --color=always'
|
|
|
|
alias egrep='egrep --color=always'
|
|
|
|
alias xzgrep='xzgrep --color=always'
|
|
|
|
alias less='less -r'
|
|
|
|
|
|
|
|
# Convenient ls aliases
|
|
|
|
alias ll='ls -alh'
|
|
|
|
alias la='ls -A'
|
|
|
|
alias l='ls -lh'
|
|
|
|
|
2019-06-24 12:55:52 -04:00
|
|
|
# Always-sudo commands
|
|
|
|
# Some people may call these lazy; I call them convenient.
|
2019-06-09 00:11:06 -04:00
|
|
|
alias service='sudo service'
|
|
|
|
alias systemctl='sudo systemctl'
|
|
|
|
alias journalctl='sudo journalctl'
|
|
|
|
alias dmesg='sudo dmesg'
|
|
|
|
alias apt='sudo apt'
|
|
|
|
alias dpkg='sudo dpkg'
|
|
|
|
alias find='sudo find'
|
|
|
|
alias htop='sudo htop'
|
|
|
|
alias jnettop='sudo jnettop'
|
|
|
|
alias parted='sudo parted'
|
|
|
|
alias fdisk='sudo fdisk'
|
|
|
|
alias gdisk='sudo gdisk'
|
|
|
|
alias chroot='sudo chroot'
|
|
|
|
alias mount='sudo mount'
|
|
|
|
alias umount='sudo umount'
|
|
|
|
alias virsh='sudo virsh -c qemu:///system'
|
|
|
|
alias ceph='sudo ceph'
|
|
|
|
alias rbd='sudo rbd'
|
|
|
|
|
|
|
|
# Cool aliases
|
|
|
|
alias cccp='sudo rsync -auv --progress'
|
|
|
|
alias zkcli='sudo /usr/share/zookeeper/bin/zkCli.sh'
|
2021-06-22 03:28:36 -04:00
|
|
|
alias patronictl='sudo -E patronictl -c /etc/patroni/config.yml'
|
2019-06-09 00:11:06 -04:00
|
|
|
|
|
|
|
#
|
|
|
|
# SOURCE OTHER SCRIPTS
|
|
|
|
#
|
|
|
|
|
|
|
|
test -f ~/.bashrc.d/* && . ~/.bashrc.d/*
|
|
|
|
|
|
|
|
#
|
|
|
|
# NICE AND CLEAN
|
|
|
|
#
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
#
|
|
|
|
# END OF FILE
|
|
|
|
#
|