Psalm 78:40-72 (ESV)
40 How often they rebelled against him in the wilderness
and grieved him in the desert!
41 They tested God again and again
and provoked the Holy One of Israel.
42 They did not remember his power 
or the day when he redeemed them from the foe,
43 when he performed his signs in Egypt
and his marvels in the fields of Zoan.
44 He turned their rivers to blood,
so that they could not drink of their streams.
45 He sent among them swarms of flies, which devoured them,
and frogs, which destroyed them.
46 He gave their crops to the destroying locust
and the fruit of their labor to the locust.
47 He destroyed their vines with hail
and their sycamores with frost.
48 He gave over their cattle to the hail
and their flocks to thunderbolts.
49 He let loose on them his burning anger,
wrath, indignation, and distress,
a company of destroying angels.
50 He made a path for his anger;
he did not spare them from death,
but gave their lives over to the plague.
51 He struck down every firstborn in Egypt,
the firstfruits of their strength in the tents of Ham.
52 Then he led out his people like sheep
and guided them in the wilderness like a flock.
53 He led them in safety, so that they were not afraid,
but the sea overwhelmed their enemies.
54 And he brought them to his holy land,
to the mountain which his right hand had won.
55 He drove out nations before them;
he apportioned them for a possession
and settled the tribes of Israel in their tents.
56 Yet they tested and rebelled against the Most High God
and did not keep his testimonies,
57 but turned away and acted treacherously like their fathers;
they twisted like a deceitful bow.
58 For they provoked him to anger with their high places;
they moved him to jealousy with their idols.
59 When God heard, he was full of wrath,
and he utterly rejected Israel.
60 He forsook his dwelling at Shiloh,
the tent where he dwelt among mankind,
61 and delivered his power to captivity,
his glory to the hand of the foe.
62 He gave his people over to the sword
and vented his wrath on his heritage.
63 Fire devoured their young men,
and their young women had no marriage song.
64 Their priests fell by the sword,
and their widows made no lamentation.
65 Then the Lord awoke as from sleep,
like a strong man shouting because of wine.
66 And he put his adversaries to rout;
he put them to everlasting shame.
67 He rejected the tent of Joseph;
he did not choose the tribe of Ephraim,
68 but he chose the tribe of Judah,
Mount Zion, which he loves.
69 He built his sanctuary like the high heavens,
like the earth, which he has founded forever.
70 He chose David his servant
and took him from the sheepfolds;
71 from following the nursing ewes he brought him
to shepherd Jacob his people,
Israel his inheritance.
72 With upright heart he shepherded them
and guided them with his skillful hand.