This example gives you another very usable Standard Riff shape.
It sits in the 4th Blues Position, with the tonic (in this case A) on the 3rd string.
Play it with your ring finger.
Play the hammer-on on string 2 with middle- and ring finger.
This particular Standard Riff shape ends on the flatted 7th of the scale.
You could also move out of position a little, by ensing it on the 17th fret of string 1: the tonic A.