The first, from an emotional, Buddhist perspective, and the second, from the productive academic's perspective. Both emphasize being mindful of when you're in the state of boredom and how to use that as a cue to put the mind in a more curious, awake state.
I like Jonathan's summation of the problem:
Boredom is like pain, it tells us that something is wrong and requires a change.