Simple conditions for the convergence of the Gibbs sampler and Metropolis-Hastings algorithms