Welcome one and all to said gathering. I hope you've all had fun or been sad at an appropriate level. I remember the first time I met the person who we're celebrating and/or mourning the loss of. It was at a place where something interesting was happening, and I, being foolish in the circumstance, was aided by the person. Those were the days!
The person was a good one. They were kind, generous, always there for you when you needed them, a good friend and husband/father/lone wolf. I often would go to the person for advice and receive advice.
For those who didn't know him, you should feel bad that you didn't or if they're alive, here he is, you probably know him if you were invited.
There will be cake and/or booze, dinner and/or dancing. Feel free to enter the raffle/sign the guest book/bet on the jelly beans/go into the photo booth/record your message/leave your presents or condolences on the table we set up in the corner.
And of course we wouldn't all be here without the help of public transit, so thanks.
Short Answer: Speeches are easy. Just make a terrible joke, then say something sincere, then say, "A toast" to the person and one last sincere hope for their future, then something about getting drunk. Ex: "Funny that they asked me to do this after I so recently slept with the bride. No but seriously, I wish I'd had a chance with Carol. Any one of us would be better for having her in our life. She's a fantastic lady and I couldn't be happier that she and Greg found each other. A toast, to Carol and Greg. I wish you all the best. Now let's get drunk!" Then, if it does happen to be a funeral, it sounds like this: "Funny that they asked me to do this after I so recently slept with the recently deceased. No but seriously, I wish I'd fucked this dead body before they wheeled her out today. Any one of us would be lucky to fuck Carol, even if she is dead and lifeless now. She was a fantastic lay and I couldn't be sadder that Greg found her dead on the kitchen floor. A toast, to Greg, who lost another one. Tough year, Greg. Now let's get drunk!"