GithubHelp home page GithubHelp logo

flash_shell's Introduction

flash_shell

用 Flask 实现的在 Web 页面执行 shell 命令的小 Demo

使用方法如下

运行在 Python 2.7.x 环境下,依赖 ansible,flask

# python -V
Python 2.7.5

# git clone https://github.com/ackfin/flash_shell.git

# cd flash_shell

# pip install -r requirements.txt

下面的IP根据你的情况配置,但要配置好ssh免密认证

# cat host.cfg 
192.168.1.254
192.168.1.125

测试 ansible 是否能使用 host.cfg 的 ip 正常运行

# ansible -i host.cfg all -m ping
192.168.1.254 | success >> {
    "changed": false, 
    "ping": "pong"
}

192.168.1.125 | success >> {
    "changed": false, 
    "ping": "pong"
}

启动项目

# python main.py 
 * Serving Flask app "main" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on

比如运行在 192.168.1.254 这台机器上, 就用浏览器打开 http://192.168.1.254:8888 flask_shell_result.png

flash_shell's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.