Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example bash script using the QuickHist API.
#!/usr/bin/env bash
# Below is a one-liner that'll fetch you a histogram
# for the available filesystem spaces in your computer.
# You can run the command directly from your unix terminal.
curl $(echo "http://quickhist.onloop.net/Percentage=100,"$(df -h | awk '{print $1,$5}' | tail -n +2 | sed 's/%//g;s/G//g;H;${x;s/\n/,/g;s/^,//;p;};d;' | sed 's/\s\+/=/g;s/\//-/g;')) --silent | sed '1,2d;$d'
# The sed '1,2d;$d' is to remove HTML markup (first two lines and the last).
# You can ignore it; the histogram is
# distinctly visible amidst the markup anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.