a template bash script with useful functions