This commit is contained in:
USER
2024-08-23 23:19:35 +01:00
parent 8302f5f82c
commit ba3b1d0d5b

View File

@ -1,5 +1,6 @@
# Source .bashrc for non-interactive Bash shells # Source .bashrc for non-interactive Bash shells
export BASH_ENV=~/.bashrc export BASH_ENV=~/.bashrc
echo "shared "
if [[ $- != *i* ]] ; then if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now! # Shell is non-interactive. Be done now!
@ -9,14 +10,53 @@ fi
THISOS=$(uname | awk '{print tolower($1)}') THISOS=$(uname | awk '{print tolower($1)}')
THISHOST=$(uname -n) THISHOST=$(uname -n)
_setaliases() {
case "$THISOS" in
darwin)
# Use MacVim's terminal vim for awesomeness support
hash rvim 2>/dev/null && alias vim=rvim
local FIND_EGREP="-E .";
local LS_COLORFLAG='-G'
;;
linux)
alias ls='ls -G'
local FIND_EGREP=". -regextype posix-egrep";
local LS_COLORFLAG='--color=auto'
;;
esac
alias ls="ls $LS_COLORFLAG"
alias ll='ls -hl'
alias l.='ls -d .* --color=auto'
alias tree='tree -C'
alias cruft="find $FIND_EGREP -regex '.*swo|.*swp|.*pyc|.*pyo|.*~' -exec rm {} \;"
alias p="ps aux |grep "
alias grep="grep --color=auto"
alias facts="echo -ne '\033[36m'; curl -s randomfunfacts.com | grep '<i>' | sed 's/.*<i>\(.*\)<\/i>.*/\1/'; echo -ne '\033[0m'; tput sgr0"
# show numeric permissions
local FORMATFLAG="-c"
if ( uname -a | grep Darwin >/dev/null); then
FORMATFLAG="-f"
fi
alias perms="stat $FORMATFLAG '%A %a %n' *"
alias .bashrc='source ~/.bashrc'
alias sha256='shasum -a 256'
alias path='echo -e ${PATH//:/\\n}'
alias GitPull='/zz/zShared/sbin/GitPull'
ZANSIBLE=registry.nopenso.com/upload/zansible
alias zansible-playbook='docker run -it --rm -v $(pwd):/ansible ${ZANSIBLE}:latest ansible-playbook'
alias zansible-lint='docker run -it --rm -v $(pwd):/ansible ${ZANSIBLE}:latest ansible-lint'
}
# History control
# don't use duplicate lines or lines starting with space
HISTCONTROL=ignoreboth
HISTSIZE=1000
HISTFILESIZE=2000
# append to the history file instead of overwrite
shopt -s histappend
_setpath() { _setpath() {
local paths=( local paths=(
@ -134,9 +174,9 @@ _setprompt() {
export PS1="$PS1${NEWLINE}${White}\342\224\224\342\224\200>${Color_Off} " export PS1="$PS1${NEWLINE}${White}\342\224\224\342\224\200>${Color_Off} "
;; ;;
esac esac
} }
_sethistory() { _sethistory() {
export HISTFILE=~/.bash_history export HISTFILE=~/.bash_history
export HISTSIZE=10000 export HISTSIZE=10000
@ -163,10 +203,11 @@ _manpagecolor() {
export LESS_TERMCAP_us=$'\E[01;32m' export LESS_TERMCAP_us=$'\E[01;32m'
} }
_setpath _setpath
_setldpath _setldpath
_setldrunpath _setldrunpath
_setaliases
_setlocalaliases
_setprompt 2line _setprompt 2line
_sethistory _sethistory
_manpagecolor _manpagecolor
@ -185,8 +226,8 @@ export TERM=xterm-256color
export GOPATH=${HOME}/dev/go export GOPATH=${HOME}/dev/go
export ANSIBLE_STDOUT_CALLBACK=yaml export ANSIBLE_STDOUT_CALLBACK=yaml
export GPODDER_HOME=~/DocumentsPodcasts/config export GPODDER_HOME=
export GPODDER_DOWNLOAD_DIR=~/DocumentsPodcasts/downloads export GPODDER_DOWNLOAD_DIR=
PATH=${PATH}:.local/bin ; export PATH PATH=${PATH}:.local/bin ; export PATH
export SIGNAL_PHONE_NUMBER= export SIGNAL_PHONE_NUMBER=