A magnitude 4.2 earthquake shook parts of the North Bay and other Northern California areas early Thursday morning.