Soft templating production of porous carbon adsorbents for CO2 and H2S capture