Extragalactic and Galactic Cosmic Rays