I have started putting magnets on small things around my desk. A cable that was wandering around now stays where I need it, and a USB hub now sits on the top of my PC case instead of taking space on the desk.

Cables🔗
For cables, I use round magnets with a hole in the middle. A small tie goes through the hole and loops over the cable. The cable rests on top of the magnet, and the magnet holds the whole thing to a magnetic surface.

I can move the cable, pull it away when I need it, and put it back without fighting a fixed clip. The magnet stays with the cable, so I do not have another small part to lose.
The photo below also shows another version. I bolted a double-sided Velcro band through the central hole of a round magnet. It makes a reusable strap for a thicker cable or a small bundle.

USB hubs🔗
I glued square magnets (the leftlmost ones on the photo above) made for cabinet doors to the sides of the USB hub. I used MS polymer glue and waited for it to cure. The magnets now attach the hub to the steel side of my PC case.

The hub remains removable, but it stays put. The same trick should work with metallic desk legs, provided that the metal is magnetic.

One small detail matters: a metal surface is not necessarily magnetic. I test it with one of the magnets first. I also let the glue cure fully before hanging the hub and keep strong magnets away from cards and magnetic storage.
This is the kind of DIY I like: cheap parts, no drilling, and an arrangement I can change later.
Buzz was right. Magnets, magnets everywhere. :-)