Custom/universal clamp/attachment for light on rear rack A long time ago i bought one of these lights from china 
 

It is pure chinese crap. bought 2. one dead in a few days. Then i broke the two trays that i slide it to attach to the bike making them useless paperweight since they have a uncommon attachment tray that i can't find alternatives. Not to mention the included attachments are only good for seat-post installation, which is idiot, since the laser will be blocked by your legs! this thing has to be installed behind the bike.

Now i'm wanting to add that light to the bike again. And in the process, find/design a generic attachment for lights on racks. The back of the light is flat and has plenty of space. Also there is lot of space inside for me to use with fasteners and what not.

The rack i have is similar to this one:


It has a flat pane. With 3 holes.

Is there anything ready made that came with both parts? I can only find things for specific formats. I was wishing for something that I can just screw in a male plug in the back of the light and then secure the other female part on the bike or so.

I am dreaming with something like this, but that would also include the other part, also with screws.
Some hackish ideas I have:

Why not just use zip ties? If your rack doesn't have 3 posts, you can make 2 or so loops (one or two horizontal, and 1 or 2 vertical) to make a makeshift mount. Then, attach something like a binder clip or two to the light. Alternatively, you could cut a bit of the light's plastic and use something like a velcro loop on the back. _v_v___v_v_ where the _ denotes the back of the light and v denotes entry &amp; exit points of velcro (if it doesn't need to be removable, you can even use zip ties instead, and seal the light a bit with a little bit of caulk). 

If you want to be fancy, you can always take the mount of some manufacturer (e.g. Planet Bike), and then get a piece of plastic / other stiff material, and rabbet the appropriate thickness ridge to fit into the mount (or glue a thin piece of material to a thicker piece material) to get the rabbet-ing effect. So, the thin part would be thin enough to slide through the mount, and the thick part would be attached securely to the light (through some adhesive, or screws). Then, you'd make the top a bit too wide for it to slide straight down through the mount. If you have an arts and crafts store nearby, you can pick up some thin but rigid plastic, screw in / glue a block of some other material narrower than the ridge of the mount and then put a screw through the light into the block. Then, on top of the block, put a lip so the light doesn't jump out. If you cut the block so that it conforms to the notch in the light mount, that would help too. Alternatively, you can cut a slot in the light mount and thread some velcro through it. 

You can also cannibalize another light with matching mount by simply cutting off a bit of area around where the mount is, and then adjoining it to a new light (screws/adhesive). 

As for the general problem:

Typically, mounts are isolated between manufacturers (certainly, on front lights. on rear lights, it seems to primarily be a width thing). So a universal solution is going to be hard to find / doesn't exist. For cheap lights, I'd be inclined to just get a new light.