Douglas Harper's Etymology Dictionary
n.g.
abbreviation of no good, attested from 1838; variant n.b.g. for no bloody good is first recorded 1903.