Turn the rug over, so the back is facing you.
Align thin architects' rulers near the edge of the carpet. Make sure the cork side is facing up. If your rug is only mildly slippery, you can just use rulers near the corners of the carpet.
Cut a piece of fishing line. Thread the line through the eye of the needle. Pull both threads to an even length. Tie a knot at the end.
Make a stitch on the carpet backing, next to one end of the ruler. Push the needle through the thick surface with a thimble. Make sure that the knot holds. Draw the needle over the ruler and make a stitch on the other side, tacking the end of the ruler in place. Securely knot the line. Cut the line with scissors.
Tack both ends of each ruler in place.
Arrange a rug pad where you plan to place your rug. Put the rug down on the pad, taking care to make sure that it is properly aligned, so the rulers do not scratch your floor.