Single and double acting cylinder