How can I rotate a cylinder in such way that one of its faces would be perfectly aligned along one of the global axis? For example if I have a cylinder: 
 
and I want to rotate that cylinder in such way that one of its face would be perfectly aligned along one of the global axis; how can I do it?
 Currently I just rotated it by eye to roughly match the global axes. Something like in the image below (you can see that its normals are roughly aligned along the X and Z 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.