Preheat the slow cooker on a high setting.
Pat the shanks dry with kitchen paper and season with the salt and pepper on both sides.
Put the oil in the frying pan over a medium to high heat then add the shanks and sear on all sides for 5 minutes to get a good colour on the meat. Transfer the shanks to the slow cooker.
Peel the garlic and onions. Mince the garlic and slice the onions.
Add the butter to the remaining oil in the frying pan over a medium heat and add the onions.
Fry for about 5 minutes, stirring occasionally until the onions are softened then add the garlic for a minute. Transfer the onion mix to the slow cooker with a slotted spoon.
Using the same pan over a medium heat, add the lardons and fry for a few minutes until golden.
Sprinkle the flour over the lardons and cook for a minute.
Use the red wine to deglaze the pan and make sure that any stuck on bits are incorporated into the sauce.
Add the stock and juniper berries and bring to a boil, stirring.
Pour the sauce over the shanks and add the thyme sprig whole so that you can remove it at the end.
Cook on high for 4 to 6 hours or on low for 8 to 10 hours.