Every magistrate shall have the power to require, from persons not of good fame, security for their good behavior and to keep the peace, for a term not exceeding one year. A person who violates a court order to keep the peace may be fined not more than $250.