Thanks for query,
You have a colicky pain in abdomen as it surges at intervals.
The first possibility is of indigestion
by eating nuts.
The other possibility includes any infection of intestine or hyperacidity
You should take pain killers like Dicyclomin tablet for a while & wait for stool to pass it may relieve after passing stool.If not consult your doctor.