Application of non-equilibrium physics to materials, avalanche dynamics and precursors of failure