# This adds a time format of "YYYY-mm-dd hh:mm:ss command" to the bash history
exportHISTTIMEFORMAT="%F %T "
# Stops duplicate commands next to each other from being logged
# This totally screws up my terminal to the point where I can't even ssh, I get a strange network tcp network destination unreachable error
#export HISTCONTROL=ignoredups
HISTCONTROL=ignoredups:ignorespace
# Neat trick "[ \t]*" to exclude any command by just prefixing it with a space. Fast way of going stealth for pw entering on cli
# & here means any duplicate patterns, others are simple things like built-ins and ls and stuff you don't need history for
#export HISTIGNORE="[ \t]*:&:ls:[bf]g:exit"
# Make sure we append rather than overwrite history
shopt -s histappend
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
[ -n "${APPLE:-}"]|| setterm -blank 0
# Prevent core dumps which can leak sensitive information
ulimit -c 0
# Let's be stingey with permissions
# This causes problems where root installs libraries and my user account can't access them
if[$EUID=0];then
umask0022
else
# This causes no end of problems when doing sudo command which retains 0077 and breaks library access. If can get sudo to implicitly read .bashrc to reset this (and prompt colour would be nice) then re-enable this tighter 0077 umask
#umask 0077
umask0022
fi
# make less more friendly for non-text input files, see lesspipe(1)