A couple of scripts I've written and may be useful to others