If we cannot get what we like, we have to like what we can get.
随遇而安。
I even went out at midnight with a torch and noted with satisfaction (and surprise) that the ants were still swarming around the sticky tape without being able to do anything about it.