I'll often create a file of a particular size with a trick like
dd if=/dev/zero of=1gb.dd bs=1M count=1024
or perhaps even
dd if=/dev/urandom of=1gb.dd bs=1M count=1024
dd if=/dev/random of=1gb.dd bs=1M count=1024
But what if I want to get all 1's instead of 0's or random?