If you have a Rancilio Rocky, chances are you have come across this problem before... The guide that your portafilter sits on during grinding (If you don't have a doser, obviously) slots into two studs that have one brass nut on the back of them, inside your grinder.
Sometimes, with all the vibrations that run through your grinder, those nuts can get loose... They fall off inside your grinder (which is mostly fine, they just sit in there and rattle about) ...but getting them back on can be quite the exercise. You either take the whole grinder apart OR you can try what I've recently adopted..
I got myself a long cable tie, cable tied it around the nut and slid it up inside the grinder so it was behind the hole where the stud slots through, I gently put the stud through and screwed it into the nut - voila! It works fine... I also left the cable tie on the nut inside the grinder - it's not going to short out on anything as it is plastic, it's not going to get caught in the motor AND with any luck, it will stop the nut coming off as it would have to vibrate the whole nut and cable tie around... Time will tell!
Have you had success with any other methods? Any other Rancilio tips?