David Collins pleaded guilty to repeatedly shouting and swearing and uttering threats during a bust-up in the town's North Street on December 6.
An allegation that he brandished a knife during that incident was deleted from the charge, however.
Procurator fiscal Fraser Matheson said Collins shouted abuse at two men walking along North Street.
Defence lawyer Mat Patrick said the offence was very much towards the lower end of the scale and added that, according to Collins, one of the men he shouted at had been causing him difficulties.
Mr Patrick said: “He was unable to control himself. He is a vulnerable individual.”
Sheriff Peter Paterson imposed a £10 victim surcharge on top of the fine he handed out to Collins.