Fabrication of porous carbons and mesoporous silica materials for energy storage and environmental applications