Farkas type theorems for generalized convexities