I always thought this great quote came from Francis of Assisi. Turns out that it is the Serenity Prayer by a 20th-century American theologian and is widely known because it was used in AA’s Twelve-step program. But there was indeed a similar earlier version in Śāntideva’s Bodhisattvacaryāvatāra. Aren’t Wikipedia and Bibliotheca Polyglotta just great?

God, grant me the serenity to accept the things I cannot change,
Courage to change the things I can,
And wisdom to know the difference.

yady asty eva pratikāro daurmanasyena tatra kim |
atha nāsti pratikāro daurmanasyena tatra kim || (BCA 10.6)

| gal te bcos su yod na ni | | de la mi dgar ci źig yod |
| gal te bcos su med na ni | | de la mi dga’ byas ci phan |

Not so satisfactory was the Song translation by 天息災…
忍心常若此 令瞋不得起
住忍無時節 瞋冤自不生