On a side note, both Gentoo's official documentation and
http://www.gentoo-wiki.com have quite a selection of scripts broken into documents... for example, the lid switch was misbehaving on my Dell laptop, and I found a script to rectify it on Gentoo-wiki.
Gentoo being a source distribution, most of the scripts are adaptable to any distribution as long as you have a good idea of what you're actually doing (or trying to do).