Deviation inequalities for random walks