#!/usr/bin/env python # coding: utf-8 # ## linux command demo # This file is a demo on how many terminal commands can be conducted in jupyter notebook of joinquant and how much info you can acquire on the backend. # IMHO, the permission is somewhat loose here and may potentially increase the risk. # As a quant finace platform, they shouldn't expose so much command to their users. # In[1]: get_ipython().system('cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c') # In[2]: get_ipython().system('pip list|grep echarts') # In[3]: get_ipython().system('cat /etc/hosts') # In[4]: get_ipython().system('cat /etc/issue') # In[6]: get_ipython().system('ping -c 2 google.com') # In[11]: get_ipython().system('cat /proc/meminfo |grep MemTotal') # In[12]: get_ipython().system('df -h') # In[41]: get_ipython().system('ls .config') # In[16]: get_ipython().system('apt -h') # In[17]: get_ipython().system('python3 -V') # In[24]: get_ipython().system('which python') # In[21]: get_ipython().system('ip addr') # In[22]: get_ipython().system('apt install hping3') # In[29]: get_ipython().system('wget baidu.com') # In[32]: get_ipython().system('ls /') # In[37]: get_ipython().system('service --status-all') # In[38]: get_ipython().system('whoami') # In[39]: get_ipython().system('pwd') # In[43]: get_ipython().system('ps -aux|grep jupyter') # In[61]: get_ipython().system('type awk sed tee perl head gcc as bash rm sudo mkdir mount')