Generation of few-cycle and attosecond pulses and their use in probing ultrafast dynamics in gases and surfaces