Simply save this file and put it in Opera's preferences folder. (It is described in the file, but it is allthought visible when you type "opera:about" in the address-bar and then, find "opera folder" in that page.)
Using an Add-On (Opera 11)
As from Opera 11, the browser support the use of add-ons. Obviously, there are also a plugin to block ads.