To make the curry powder, grind all of the ingredients with a spice grinder.
For the coconut sambol, put 1/2 the garlic, onion, ginger and turmeric, plus all of the black pepper, green chili and grated coconut, into a food processor and whizz until fine.
Heat the vegetable oil in a frying pan
Add the remaining 1/2 onion, garlic and ginger, and the curry leaves, and stir. (Substituting lime zest for the curry leaves)
Add 2 tbsp of the curry powder.
Stir in the beans, season and cook for 3-4 minutes or until just cooked.
Stir in the sambol, chili flakes and lime juice, and serve.