I've enabled long-polling and all my miners instantly went booo, couldn't submit not even a share

And then switched back off again.
But thanks for sharing the script, I'll see where I can fit it in.
This pool software is just not behaving very well under the load..
The script is for miners to use - its a workaround for the pool bug (the pool bug hits even if long-polling is turned off), which means you can just ignore minerd and leave it to do its thing without worrying that its going "booooo" all the time instead of "yay!!!"
Otherwise, the only stable mining is using the daemon, or simpleminer (from the MRO source), and the latest AES-NI optimised version of cpuminer-multi performs better than both of them on cpu's which support AES-NI.