Ibn ʿUmar used to kill all kinds of snakes until Abu Lubaba Al-Badri told him that the Prophet ﷺ had forbidden the killing of harmless snakes living in houses and called Jinan. So Ibn ʿUmar gave up killing them.
أَنَّ النَّبِيَّ ﷺ نَهَى عَنْ قَتْلِ جِنَّانِ الْبُيُوتِ فَأَمْسَكَ عَنْهَا