Statistical physics of fracture and earthquakes