Re: Linux
There are plenty of apps that give you a terminal and the ability to 'run' a linux environment, try https://play.google.com/store/apps/details?id=com.termux, plenty more available, some require root and some do not. Not all linux tools are available, certainly not GUI ones, but some can then be run within Xvnc or similar, a reasonable smattering of command line tools are available, perl, python, vi etc. However there is limited access to storage, which does make some things more difficult.
Definitely worth a few hours of investigation/play