It is forbidden to kill a living creature on Shabbat, even a fly or a mosquito. A venomous snake may be killed because of pikuach nefesh, and even a snake that is not venomous may be killed at once, as Rav Yosef Shalom Elyashiv, zt"l, wrote. A thorn may be removed with a needle. From the booklet of Rabbi David Shalom Naki, shlit"a.