Distro doesn’t matter much to be honest. The problem is that this question covers a wide number of fields.
The art of unix programming is a good book to get your bearings: http://catb.org/~esr/writings/taoup/html/
Then learn a shell like bash, zsh, or fish thoroughly. A scripting language like Python can’t hurt. Building a custom kernel and toolchain is a fun process as well.
That’s plenty to get started. Good luck. ;-)