Firing a machinegun up at something, from a planetary surface seems like a possible * way to to keep it from falling down (i.e. to push against gravity) but not so simply as a way to keep it from flying apart - the stresses on a ring rotating fast in zero G space, are Centrifugal. You would have to shoot inwards at it, from nowhere.
* Possible, not necessarily practical.