Section 55. Whoever violates any provision of sections forty-two to fifty-one, inclusive, or any rule made thereunder, or prevents or attempts to prevent an inspector from entering on any premises in the discharge of his duty with respect to said sections, shall be punished by a fine of not less than ten nor more than three hundred dollars, or by imprisonment for not more than three months.