Skip to content

Instantly share code, notes, and snippets.

@staslev
staslev / mvn-color-bashrc.sh
Last active January 3, 2016 00:29 — forked from wadouk/bashrc.sh
Make your maven output colorful to easily identify FAILURES and look a bit easier on the eye.
PURPLE=$(echo -en "\033[35m")
GREEN=$(echo -en "\033[32m")
RED=$(echo -en "\033[31m")
BLUE=$(echo -e "\033[1;34m")
NORMAL=$(echo -e "\033[0m")
mvn2() {
mvn $* | sed \
-e "
s/^\(Failed tests:.*\)$/$RED\1$NORMAL/; # contains 'Failed tests:'
kafka-console-consumer.sh --group YOU_CONSUMER_GROUP_ID --topic YOUR_TOPIC_NAME --zookeeper YOUR_ZOOKEEPER_ADDRESS | ./text_line_filterForId 1234 > filtered_input.txt
q -t "select c6,c17,c26,c11,cast(c2 /15000 as integer) * 15000, count(*) from filtered_output.txt where c2 >=TIME_STAMP_A and c2 <= TIME_STAMP_B group by c6,c17,c26,c11,cast(c2 /15000 as integer) * 15000"
# mvn-color based on https://gist.github.com/1027800 and https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/mvn
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`
export TEXT_BLUE=`tput setaf 4`
export TEXT_MAGENTA=`tput setaf 5`