The professors that I've gotten close to I've always been able to have peer-to-peer conversations with them. We'll joke about administrative issues, talk more in-depth about certain topics (covered in class or not), I'll stop by to talk to them even if I don't have a class with them that semester, always say hi to them in the hallways, etc. I can't pinpoint exactly how each of these relationships started, but I can tell you that it wasn't through sucking up to them or coming up with fake conversation pieces. I was genuinely interested in what they had to say, and otherwise thought they were cool people. One common way I'll start talking to professors is to come to their office hours with a question relating to the material but somewhat more advanced our outside the scope of the actual course work. They were always questions I was really interested in, but it does make for good conversation because professors usually love to have students that are interested in learning more than whats required.
Professors generally don't want suckups. They can usually spot them a mile away. I don't buy into the advice of sitting in the front row, answering all the questions stuff at all. I think the not sleeping thing is just a general common courtesy thing. Professors do like to see hard work, and they like to see people who actually use their heads and apply what they know to more complicated situations. Think about what you want them to say in the letters, and try to be the person you want them to describe. You can't be fake about it, but you can actually try to be that person. Do you want them to write about how hard working you are? Then work your ass off. Do you want them to write about how down to earth you are? Talk about every day things, especially those not related to the course work. Look around their offices, they usually have quite a few conversation pieces around. Professors are people, and usually pretty interesting ones too. The best you can do is to let a professor really get to know you. That will give you the best letter of recommendation (unless, of course, you're just a bad person... then... well 🙄 )