mysql scripts, minor template stuff