Variable 0-10V from 0-5V

For a 2N2222, or any older transistor when used as a switch, the base current should be about 1/10th of the collector current.

You'll find it on the datasheets.