'Take a cold bath!' magistrate advises man sentenced for ass