Off-equilibrium generalization of the fluctuation dissipation theorem for Ising spins and measurement of the linear response function