http://www.seamlesstexturegenerator.com/ It almost does everything for you, it saves my hours of work.
Even, if it doesn't work perfectly at any picture, at least the most players won't notice it.
An additional hint from the HL levels: use textures that covers at least a wall from it's ground to it's top. In most cases, the dirt at the bottom and the rims or whatever at it's top makes it more realistic. Even if its more blury than a texture which tiles three times at the same hight.