예제 #1
0
def init():
    run_cmd("mkdir -vp /root/workspace")

    run_cmd("git clone [email protected]:notechats/notetool.git")
    run_cmd("git clone [email protected]:notechats/notekeras.git")
    run_cmd("git clone [email protected]:notechats/notedrive.git")
    run_cmd("git clone [email protected]:notechats/notecomputer.git")
예제 #2
0
def config_all():
    config_init()
    config_ssh()
    config_git()
    config_workspace()
    run_cmd("cp -rf '/content/gdrive/My Drive/core/configs/' '/root/'")
    logger.info("config all done")
예제 #3
0
def start_code_server(user_data_dir="/root/workspace"):
    run_cmd("mkdir -vp /root/logs/code-server/")
    cmd = " nohup code-server"
    if user_data_dir is not None:
        cmd += " --user-data-dir " + user_data_dir
    cmd += " --auth none"
    cmd += " --config {}code/code-server.yaml".format(config_dir)
    cmd += " >>/root/logs/code-server/code-server.log 2>&1 &"
    run_cmd(cmd)
예제 #4
0
def config_git():
    run_cmd(
        "cp -rf '/content/gdrive/My Drive/core/configs/ssh/id_rsa' '/root/.ssh/'"
    )
    run_cmd(
        "cp -rf '/content/gdrive/My Drive/core/configs/ssh/id_rsa.pub' '/root/.ssh/'"
    )

    run_cmd('git config --global user.email "*****@*****.**"')
    run_cmd('git config --global user.name "niuliangtao"')
    logger.info("config git done")
예제 #5
0
def config_workspace():
    run_cmd("mkdir -vp /root/workspace")
    run_cmd("mkdir -vp /root/workspace/.vscode")
    run_cmd(
        "cp -rf '/content/gdrive/My Drive/core/configs/core/settings.json' '/root/workspace/.vscode/'"
    )

    run_cmd([
        "cd /root/workspace",
        "git clone [email protected]:notechats/notetool.git",
        "git clone [email protected]:notechats/notekeras.git",
        "git clone [email protected]:notechats/notedrive.git",
        "git clone [email protected]:notechats/notecomputer.git"
    ])
    logger.info("config workspace done")
예제 #6
0
def config_ssh():
    # run_cmd("cp -r '/root/.ssh' '/content/gdrive/My Drive/core/configs/ssh'")
    run_cmd(
        "cp -rf '/content/gdrive/My Drive/core/configs/ssh/id_rsa' '/root/.ssh/'"
    )
    run_cmd(
        "cp -rf '/content/gdrive/My Drive/core/configs/ssh/id_rsa.pub' '/root/.ssh/'"
    )
    run_cmd(
        "cp -rf '/content/gdrive/My Drive/core/configs/root/.pypirc' '/root/.pypirc'"
    )
    logger.info("config ssh done")
예제 #7
0
def start_natapp(authtoken='65a40f94924dc275'):
    run_cmd("mkdir -vp /root/logs/natapp/")
    run_cmd(
        "nohup ./natapp -authtoken={authtoken}  >>/root/logs/natapp/natapp.log 2>&1 &"
        .format(authtoken=authtoken))
예제 #8
0
def install_natapp():
    run_cmd(
        "wget http://download.natapp.cn/assets/downloads/clients/2_3_9/natapp_linux_amd64/natapp -O natapp"
    )
    run_cmd("chmod a+x natapp")
예제 #9
0
def install_code_server():
    run_cmd("curl -fsSL https://code-server.dev/install.sh | sh")

    #run_cmd("code-server --config /root/configs/code/code-server.yaml --install-extension ")
    run_cmd(
        "code-server --config /root/configs/code/code-server.yaml --install-extension tushortz.python-extended-snippets"
    )
    run_cmd(
        "code-server --config /root/configs/code/code-server.yaml --install-extension ms-python.python"
    )
    run_cmd(
        "code-server --config /root/configs/code/code-server.yaml --install-extension rogalmic.bash-debug"
    )
    run_cmd(
        "code-server --config /root/configs/code/code-server.yaml --install-extension eamodio.gitlens"
    )
    run_cmd(
        "code-server --config /root/configs/code/code-server.yaml --install-extension formulahendry.code-runner"
    )
    run_cmd(
        "code-server --config /root/configs/code/code-server.yaml --install-extension spywhere.guides"
    )
    run_cmd(
        "code-server --config /root/configs/code/code-server.yaml --install-extension vscode-icons-team.vscode-icons"
    )
    run_cmd(
        "code-server --config /root/configs/code/code-server.yaml --install-extension yzhang.markdown-all-in-one"
    )
    run_cmd(
        "code-server --config /root/configs/code/code-server.yaml --install-extension akamud.vscode-theme-onedark"
    )
    run_cmd(
        "code-server --config /root/configs/code/code-server.yaml --install-extension coenraads.bracket-pair-colorizer"
    )
    run_cmd(
        "code-server --config /root/configs/code/code-server.yaml --install-extension ms-python.anaconda-extension-pack"
    )
    run_cmd(
        "code-server --config /root/configs/code/code-server.yaml --install-extension christian-kohler.path-intellisense"
    )
예제 #10
0
def config_init():
    run_cmd("pip3 install -U pip")
    run_cmd("pip3 install -U twine")
    run_cmd("pip3 install -U pyecharts pylint")