I think boredom is maybe the wrong thing. I can't be too engaged in something. That seems to sabotage the process. I can't play video games or watch some exciting movie (or scroll HN ;-)
Physical work can help. Or just doing something that's not too engaging.
It's the same for me: the eureka moment happens when I'm not consciously thinking of the problem at all, and often I'm fully engaged in an unrelated activity.
Some places I've experienced sudden insight for a technical problem:
* playing a video game on Saturday evening
* briefly awake at 3am to use the bathroom
* shopping for tea kettles on Amazon
* reading aloud in a writer's group
The idea just pops into my head, sometimes throwing me off the task I'm actually focused on. I assume there's a subconscious portion of my brain still calculating the problem even when I don't realize it, but I can see why some people believe their insights come from a higher power.