Attaching 2x4 to Cinder Block

I was wondering if anyone had any suggestions. I am doing this to affix some outlets and switches in my unfinished basement. Thanks.