Karl Quinn, from Luton, was sentenced on Friday at Luton Crown Court to six years in prison for possession of a firearm and seven months in prison for possession of a bladed article, to run consecutively.
He was found guilty at an earlier trial of both counts.
He was also sentenced to 12 weeks imprisonment in relation to a previous suspended sentence, which will run concurrently.
At around 9.40pm on 5 April, shots were fired in Portland Road, Luton, following an earlier altercation where a man and a woman were threatened.
One man was shot in the arm, and although he was taken to hospital for treatment his injuries were not deemed to be life threatening.
The second shot hit a different man, a passer-by, who was taken to hospital and was found to have shotgun pellets in his forehead and his eye.
Quinn was later identified as the man who threatened a man and woman earlier in the day, prior to the shots being fired.
After extensive enquiries by the force’s Boson team, dedicated to tackling gun and gang criminality, Quinn was arrested in May.
Detective Inspector Aaron Kiff, from the Bedfordshire Police Boson team, said: “We will continue to work hard to take dangerous offenders off the streets.
“Boson is dedicated to tackling incidents like this to ensure those who use weapons are not free to instil fear into others.
“The detective working on this case was commended by The Honourable Mrs Justice Cockerill for her hard work.
“This was an excellent piece of investigative work, which will ensure Quinn is made to pay for his actions.”
During his trial, Quinn was found not guilty of conspiracy to murder.