Skip to content

Instantly share code, notes, and snippets.

@rangalo
Created February 13, 2015 14:13
Show Gist options
  • Save rangalo/5043c2ceac3c62f21957 to your computer and use it in GitHub Desktop.
Save rangalo/5043c2ceac3c62f21957 to your computer and use it in GitHub Desktop.
# tomcat alias and functions
alias tstart="${CATALINA_HOME}/bin/startup.sh"
alias tstop="${CATALINA_HOME}/bin/shutdown.sh"
function tkill () {
ps -eaf | grep 'java' | grep 'catalina' | grep -v 'grep' | grep -v 'tail' | awk '{ print $2; }' | xargs kill -9
}
function logf ()
{
tail -100f $1 | perl -ple 's/^.*SEVERE.*$/\e[1;37;45m$&\e[0m/ || s/^.*ERROR.*$/\e[1;37;41m$&\e[0m/ || s/^.*WARN.*$/\e[1;33;40m$&\e[0m/'
}
function catalog ()
{
logf $CATALINA_HOME/logs/catalina.out
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment