Scanning tunneling spectroscopy study on graphite and 2H–NbSe2