Yes, e-book sales or online courses would generate income, but I would not exactly call it "passive" since you have to tie up time in either writing the books or holding the courses. In that sense its more like another form of job.
That said, and semantics aside, I have always wanted to write books and self-publishing on-line seems an increasingly beneficial way to go about it. There are some good communities on G+ that help new on-line authors - these are still available until the platform closes. "Self Publishing Your Book" has c. 60k members and the main contributors seem very capable and able to help.