Sources of X-rays from galaxies