A 29-year-old man pleaded guilty to federal charges Tuesday for firing a shotgun outside an upstate New York synagogue during the early months of the Israel-Hamas war.