initial commit

ruby port of diag.sh