"He who has a why to live for can bear almost any how." What I learned that keeps me motivated is figuring out how to dangle a carrot in front of myself, some goal that depends on me figuring out something so that I can reach that goal. It helped me asking myself, "if I could have anything in the world, no matter what, what would it be and why?" and then going about bridging the gap between A (where you are now) and B, that future where you have that state you really want, even if it isn't very realistic. Might not work if this end state doesn't relate to tech but in my case it has and is proving to be sustainable thus far.