Making a bone rig for piston I'm trying to make a bone rig for a piston which will be a part of active aerodynamics of a vehicle.

I did find a video but it was on older version of Blender and confused me halfway. 

How to make an armature which does the following:

(a) has a sliding movement for piston

(b) has a angular movement on which causes the piston to operate, or vice versa.

Considering that, one part of piston is a fixed to a body and the other part is what does the sliding movement. This sliding movement is connected to an upright bone which rotates on the other free end's axis.

To put it simply the upright bone is being rotated to a certain angle by the piston. The upright bone is 90°, the default angle, pointing upwards."
When working with 3D models, we often work the opposite way to reality, that is we would animate the aerofoil rotating and have the attached parts move to follow its movement. For what you are after you may not need any more than rotating the aerofoil, the interconnecting pieces of a cars rear spoiler may not even be visible.

There are a collection of constraints available that can simplify automated interactions of multiple components.

A piston is composed of two parts, one fitting inside the other and both pieces pointing toward the fixture point of the other. The TrackTo constraint is the easiest way to keep the two piston pieces in place as both ends are moved. You can find a simple example in this answer.

It is possible to build more complex rigs, in this answer a front-end loader rig is setup to move one bone that rotates the scoop as well as the attached parts that would control the movement on a real tractor.