Skip to content
Several bash scripts to make life easier
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Welcome to send me feedback in github or @huandu on twitter.

List of tools

  • remote
  • colorize
  • platform

The remote script runner: remote

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 remote tail -f your-log

With remote, you can safely stop this ssh connection any time.

Simple command line output highlighter: colorize

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:'

Simple platform detection script: platform

Platform script is to detect and print platform information in bash.

Sample usage.


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
Something went wrong with that request. Please try again.