handy snippets of various scripts