This sounds pretty interesting, can you recommend any books on Japan about this particular period/topic?
It's the autobiography of Katsu Kokichi (Musui is another name he was known by), a samurai born in the early 19th century to a very low-ranking family. It's a firsthand account of life at the very lowest fringe of Shogunate society at the very end of that system, and is quite entertaining because Katsu is a lazy good-for-nothing who can't even get one of those pointless bureaucracy jobs and survives by doing "lowly" merchant work. I think it would make a pretty funny TV show because the protagonist is such a hapless loser.