Roast the grated coconut in a pan till golden brown.
Add the chilli powder, turmeric powder and coriander powder and roast till it turns reddish brown in colour.
Switch off heat and let cool.
Grind to a fine paste with a little water. Keep aside.
Dilute the tamarind paste in some water and keep aside.
Heat oil in a pan.
Saute the onion, green chillies and cabbage.
When the cabbage starts to wilt, add a pinch of turmeric powder and 1/2 teaspoon chilli powder and mix well.
Cook further on low heat till the cabbage is done.
Add the ground paste and salt and mix well.
Add the tamarind water and bring to a boil.
Switch off heat.
For tempering, heat oil in a pan.
Put the mustard seeds, when they start to splutter, add the curry leaves and shallots and saute till the shallots turns slightly brown.
Take off the heat and pour this over the curry.
Serve the hot Theeyal with Rice.