- I wouldn't bother with the advance. It was a pitiful amount of money and was paid in instalments that I constantly had to chase. Instead see if you can negotiate a better royalty rate (as your first book, I don't know if this will happen). Supposedly I was lucky to get advance at all, not sure how true that is.
- Another commentor mentioned the free books they give you; I think this is an area you can likely easily negotiate up a bit.
- As I wrote on a popular topic, I did make some money, but nowhere near what I would have made consulting. However, it has opened a lot of doors for me. I have given a lot of talks in a lot of countries and people come to me for advice, which is a nice place to be. In terms of my career, it's certainly been a big help.
- I wouldn't write for one of the publishers that push out lots of low quality titles. It demeans your work and you'd probably be far better off self-publishing.
- O'Reilly have a reasonably good infra set-up; I wrote the book in asciidoc using Vim and pushed to a git repo. There was an on-line app that would then build PDF/ebook versions of the book on demand.
Good luck!