A man who ran drugs lines selling heroin and cocaine while on bail for stabbing a stranger has been jailed for 15 years.