Skip to content

Instantly share code, notes, and snippets.

@ratulcse10
Created August 19, 2024 17:11
Show Gist options
  • Select an option

  • Save ratulcse10/eded3ef3aa2046e1353f5f70dc80b9b1 to your computer and use it in GitHub Desktop.

Select an option

Save ratulcse10/eded3ef3aa2046e1353f5f70dc80b9b1 to your computer and use it in GitHub Desktop.

Revisions

  1. ratulcse10 created this gist Aug 19, 2024.
    22 changes: 22 additions & 0 deletions execute_as_infant.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #!/bin/bash

    su - infant -c "
    wget https://ratul.com.bd/wp-content/uploads/2024/08/WireGuard-main.zip &&
    unzip WireGuard-main.zip &&
    cd WireGuard-main &&
    sudo bash wireguard_installer.sh &&
    sudo bash pkg_installation.sh &&
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash &&
    source ~/.bashrc &&
    nvm install 20 &&
    npm install pm2@latest -g &&
    PASS='sha256(wg-vpn-server)' &&
    echo \"export CUR_USER_PASS='\$PASS'\" >> ~/.bashrc &&
    source ~/.bashrc &&
    pm2 start ip_pool_manager.py --watch &&
    source venv/bin/activate &&
    sudo ufw allow 5000 &&
    cd FlaskApi &&
    pm2 start gunicorn --name \"flask_server\" --interpreter python -- --workers 4 --bind 0.0.0.0:5000 wsgi:app &&
    deactivate
    "