A mirror of my blog that I host. Mirroring it here just to provide an additional backup. Check out the real deal at http://www.justinandrewfincher.com/

Sunday, July 17, 2016

The Postmortal by Drew Magary

The PostmortalThe Postmortal by Drew Magary
My rating: 4 of 5 stars

A pretty fun read. Written as a journal from a single protagonist explaining what goes on in his life (and the world) as a cure for aging is developed. Not a very uplifting story (lots of kinda terrible stuff happens), but it is an easy-to-read narrative that has some interesting explorations of possible outcomes were something like this to be developed.

It was a good book for me to start getting back into reading more consistently, and will hopefully provide a decent springboard for my next book, which will be a list book!

View all my reviews

Sunday, July 3, 2016

Colorizing Bash Command Line Output

Currently, a great majority of my professional development is in Perl.  Additionally, we have had a focus on building more robust unit test scripts for the code that is written.  Especially as the tests have started growing pretty large, I started looking for ways to make the test output a bit more readable.  Since these are built using existing perl packages like Test::More, I am somewhat limited in my customization choices.  When looking for possibilities, most of the answers that I found were code that you could add to your script to do the colorization.  Unless I wanted to build custom versions of the packages we use, that wasn't the best option. I also looked into multitail since I had used that for colorizing some log outputs, but it never seemed well suited for taking the output of a single-run script.  Not only is scrolling around a bit awkward, but it doesn't tend to like to leave the output available after the run. Multitail does ok if you first redirect the output to a file, then multitail that file, but that is a bit more difficult to swing if you don't want be switching between windows (plus it leaves a file that you'll need to clean up at some point). What I ended up going with was this script.  The nice thing about it is that it could be pretty easily tailored for whatever script for which you wanted to colorize the output. As it is currently written, it makes the output of Perl's Test::More .t files a lot clearer and nicer to look at!     To use it, I run something like perl test.t 2>&1 | ./colorize.sh which results in output like this. Screen Shot 2016-07-03 at 5.57.37 PM I'm sure that I could do some more customization, but I was pretty happy with how it turned out. It colorizes the different statements that we tend to have, and catches kill signals so your colors will reset to normal if you kill the run before it finishes. If I do make any updates, I'll add them to the gist (which happens to also be my very first gist!)