A catalogue of Mg2 indices of galaxies and globular clusters