Ex-convict pleads guilty to murder, attempted rape