The mod 2 cohomology rings of extra-special 2-groups and the spinor groups