How old are you? I mean really, I'm fifteen and in all my years I have never thought it was funny to rip one in a class. And as for annoying people for your own entertainment, that's just obnoxious, it doesn't show that you're smarter than anyone else it just makes people hate you.
As for fun in class, I can suggest a few things.
Talk to people (Do it sneakily as to not get in trouble), and don't pretend that you're better than others, it will only make them dislike you more.
Do exactly what the teacher says, but do it satirically (Sort of like what Bauglir said). For instance in English, I write what my teacher wants, I write it well, but I do it WAY over the top. When we wrote about an older sibling, I made up a story about a brother who saved me from a burning building, died protecting a village while in the peace corp, and said such overly dramatic quotes they changed my life (And caused me to get my mom to adopt a poor homeless boy). I only recently turned it in and am hoping my teacher believes it.
Space out, draw, write, or learn. Trust me time will pass and the class will eventually end.
Subtly troll your teachers. Example: When my teacher asked me what I thought the moral of the story was I said, "By giving into peer pressure the main character became a stronger person". Because that was not the moral, but totally happened in the story (Involved diving into the ocean, and swimming under a rock because the big kids did it).