Amazon carries this simple and effective rubber coated magnetic mount for pistols. Easily place a pistol under a desk, closet shelf or locker. Each strip consists of two magnets. Strips can be cut in half to hold individual magazines.
They can also be mounted at different heights on the wall to hold up barrels of upright long barrel guns stood on the floor, or to secure other gear.