Skip to content

Instantly share code, notes, and snippets.

@erincerys
Last active August 27, 2017 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erincerys/0756ce3b7b38c5129397e0ab40354e07 to your computer and use it in GitHub Desktop.
Save erincerys/0756ce3b7b38c5129397e0ab40354e07 to your computer and use it in GitHub Desktop.
Bash configuration
# maintenance
alias sysupgrade='yaourt -S -y -u --aur'
# operations
function gpkill () {
if [ $1 ] ; then
TargetPid=`pgrep $1`
echo 'Sending sigterm'
kill -15 $TargetPid
sleep 2
if [ "`pgrep $1`" ] ; then
echo 'Sending sighup'
pkill -9 $TargetPid
if [ "`pgrep $1`" ] ; then
echo 'Either multiple processes are running or pid is defunct!'
fi
else
echo 'Process gracefully exited.'
fi
fi
}
export gpkill
#
# ~/.bash_profile
#
[[ -f ~/.bashrc || -h ~/.bashrc ]] && . ~/.bashrc
[[ -f ~/.bash_aliases || -h ~/.bash_aliases ]] && . ~/.bash_aliases
PS1='\n\D{%Y-%m-%d %H:%M:%S} \n\u@\h ($?) \W\$ '
export HISTCONTROL=ignoreboth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment