13/06/14

AHA - Ansi HTML Adapter

Hi,


today i have make a little script in bash that output some colored json on console.
My requirements was to extract the colored output of my script in HTML format.
So, with a little search on Google I have found Ansi HTML Adapter (https://github.com/theZiz/aha)
And with my surprise it's available on official apt repository.
# apt-get install aha
If you want to test run command:
# ls --color=always | aha --black > ls-output.htm
Very useful. Salvo.

09/06/14

Percentage of memory that is free

Hi, if you want to get a percentage value of free memory on your linux box type this command:

# free | grep Mem | awk '{ printf("free: %.4f %%\n", $4/$2 * 100.0) }'

Repair a placement group in a Ceph cluster

Hi, today i have found an inconsistent placement group on my cluster ceph. For detect number of PG that was not "active+clean" I was run the command:
# ceph pg dump
and then for repair PG:
# ceph pg repair 
Bye.