How can I rotate a cylinder in such way that one of its faces would be perfectly aligned along one of the global axis?
If the face you want to align is the top/bottom one, you can do so when you create the cylinder by pressing align to view (you have to align your view first, 7 for top view etc). For one of the side faces, you can compute the angel and type it in while rotating. For 8 faced cylinder, the angle from the center to the face is 360/8 -> 45 degrees to rotate by one face. The cylinder is perfectly aligned when you create it, so you can just press R and type in the angle. You can also compute the final rotation and type it in in the object menu.