Section 11. Whoever is convicted of a crime, punishable by fine and imprisonment either in the jail or house of correction, except a person convicted under section thirty G of chapter one hundred and thirty-eight, may at the discretion of the court, be sentenced to be punished by imprisonment only, or by a fine only, if he shows to the satisfaction of the court that he has not before been convicted of a similar crime.