The works of Ādi Śaṅkarācārya

Viṣṇusahasranāmastotram

Verse 187

श्रूयतां धर्मसर्वस्वं श्रुत्वा चैवावधार्यताम् ।आत्मनः प्रतिकूलानि परेषां न समाचरेत् ॥आत्मौपम्येन सर्वत्र समं पश्यति योऽर्जुन ।सुखं वा यदि वा दुःखं स योगी परमो मतः ॥निर्गुणः परमात्मात्र देहे व्याप्य व्यवस्थितः ।तमहं ज्ञानविज्ञेयं नावमन्ये न लङ्घये ॥

In plain words

Hear the whole of dharma, and once you have heard it, hold on to it: what you would not want done to you, do not do to others. Whoever takes himself as the measure and sees everyone alike — pleasure or pain, Arjuna, it makes no difference — he is counted the highest yogin. The Supreme Self, free of every attribute, is here, pervading this body, and it stays. That Self, the one to be known by knowledge — I do not slight it, and I do not trespass against it.

Close to the Sanskrit

Let the whole essence of dharma be heard, and having heard, let it indeed be held firm: what is contrary to oneself, one should not do to others. He who by the likeness of himself sees everywhere the same — whether pleasure or whether pain, O Arjuna — he is held to be the highest yogin. The attributeless Supreme Self, here, in this body, having pervaded it, stands established. Him, who is to be known through knowledge, I do not disdain, I do not transgress.