Welcome to send me feedback in github or @huandu on twitter.
remote
colorize
platform
If you usually run remote script with ssh or tools using ssh (e.g. pssh and onall), you will find it’s hard to stop remote script manually. It means, even if your ssh connection is down, the remote running script will keep going until it exits normally. If the remote script consumes lots of resource, this default behavior may cause unconscious bad effect.
This script is designed to resolve this issue. Basically, use it like ‘nice’.
Here is a sample.
ssh [email protected] remote tail -f your-log
With remote
, you can safely stop this ssh connection any time.
Colorize is similar to grep with --color
option, except that it’s a bit more user-friendly. For people like me who don’t want to remember XTerm color code, colorize can save you.
Here is how to use it.
tail -f your.log.file | colorize yellow '^FATAL:'
Platform script is to detect and print platform information in bash.
Sample usage.
platform
Above command will print following information on MacOSX.
type: darwin kernal_version: 12.4.0 dist: Darwin dist_version: 12.4.0
And following output is the result on Ubuntu server.
type: linux-gnu kernal_version: 3.5.0-23-generic dist: Ubuntu dist_version: 12.04