Spectra of afterglows and discharges from nitrogen-oxygen mixtures