Spark: Shell script for converting any list of numbers into a sparkline (a small chart with no axes or coordinates)

Sparklines logo

http://zachholman.com/spark/


Example 1:

spark 0 30 55 80 33 150
▁▂▃▅▂▇

Example 2:

› curl http://earthquake.usgs.gov/earthquakes/catalogs/eqs1day-M1.txt --silent | 
  sed '1d' |
  cut -d, -f9 |
  spark
  ▅▆▂▃▂▂▂▅▂▂▅▇▂▂▂▃▆▆▆▅▃▂▂▂▁▂▂▆▁▃▂▂▂▂▃▂▆▂▂▂▁▂▂▃▂▂▃▂▂

Link: Command-line tools can be 235x faster than your Hadoop cluster

Bash symbol

http://aadrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html


What I find funny is how he goes from this intermediate step:

cat *.pgn | grep "Result" | sort | uniq -c

To this intermediate step in one shot.

cat *.pgn | grep "Result" | awk '{ split($0, a, "-"); res = substr(a[1], length(a[1]), 1); \
if (res == 1) white++; if (res == 0) black++; if (res == 2) draw++;} \
END { print white+black+draw, white, black, draw }'

This is what I refer to as “knowing your business”.

Node Version Manager: Manage multiple active node.js versions

Node.js logo

https://github.com/creationix/nvm


Commands

$ nvm [tab][tab]
alias        deactivate  install      ls                  run        unload
clear-cache  exec        list         ls-remote           unalias    use
current      help        list-remote  reinstall-packages  uninstall  version

Two Microsoft Windows alternatives:

  • nvmw – Requires Python and Git
  • nvm-windows – Written in Go. Installer available.

Pipe Viewer: Unix terminal-based tool for monitoring the progress of data through a pipeline

Pipe Viewer screenshot

http://www.ivarch.com/programs/pv.shtml


From the Pipe Viewer website:

pv – Pipe Viewer – is a terminal-based tool for monitoring the progress of data through a pipeline.
It can be inserted into any normal pipeline between two processes to give a visual indication of
how quickly data is passing through, how long it has taken, how near to completion it is, and an
estimate of how long it will be until completion.

Example from this blog post:

$ pv access.log | gzip > access.log.gz
611MB 0:00:11 [58.3MB/s] [=>      ] 15% ETA 0:00:59

icdiff (improved colored diff): Side-by-side highlighted command line diffs

icdiff screenshot

http://www.jefftk.com/icdiff

On Github: https://github.com/jeffkaufman/icdiff


From the icdiff web page:

Your terminal can display color, but most diff tools don’t make good use of it. By highlighting changes, icdiff can show you the differences between similar files without getting in the way. This is especially helpful for identifying and understanding small changes within existing lines.

Instead of trying to be a diff replacement for all circumstances, the goal of icdiff is to be a tool you can reach for to get a better picture of what changed when it’s not immediately obvious from diff.

Installation

curl -s https://raw.githubusercontent.com/jeffkaufman/icdiff/release-1.6.0/icdiff \
  | sudo tee /usr/local/bin/icdiff > /dev/null \
  && sudo chmod ugo+rx /usr/local/bin/icdiff

# The install-with-curl command should also work on other unixes.

# Or (mac only, depends on homebrew):
brew update && brew install icdiff