Last active
December 16, 2015 23:49
-
-
Save pranavrc/5516045 to your computer and use it in GitHub Desktop.
Example bash script using the QuickHist API.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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