A former soldier who took drunken pot shots at his neighbours' homes in east London has been jailed for four years.
Carl Wright, 37, said he was aiming for the roofs of homes in Hackney, but instead bullets whizzed through windows, terrifying his neighbours.
As police searched his home, they found a rifle, silencer and telescopic sight - and a cannabis farm in the cellar.
Wright, of Chelmer Avenue, Hackney, had trouble adjusting to civilian life, Southwark Crown was told.
Crack cocaine habit
The former Lance Bombardier had served in Northern Ireland, Yugoslavia and the Gulf and had been an exemplary member of the Queen's Regiment, the court heard.
But since leaving the army he had developed considerable problems, including a crack cocaine habit, which he paid for by selling cannabis.
On the night of the shooting, he took a rifle he had bought a year earlier and started firing at rooftops. But his aim, perhaps influenced by the drink, was off, the court heard.
One of the bullets smashed through a living room window, bounced off a television stand and hit a wall.
Another shattered the upstairs bedroom window of another home and embedded itself in the floor. No-one was hurt.
Wright initially denied any wrongdoing, but was arrested after a study of the bullets' trajectory.
In his home, police found the gun and, hidden beneath a trap door, 81 cannabis plants and associated equipment powered by stolen electricity.
Wright admitted six counts relating to possessing the rifle and ammunition, cultivating cannabis and stealing electricity.
Passing sentence, Judge Christopher Elwen told him although he only intended to cause damage, not endanger life, he had caused "considerable fear" to his neighbours.
He added: "The possession of firearms, particularly real ones - and the situation is aggravated by the silencer and telescopic sight - is a matter of grave concern to the public at large."
Tim Forster, defending, said his client deeply regretted his actions.