Skip to content

Instantly share code, notes, and snippets.

@AyushSachdev
Last active June 25, 2018 09:15
Show Gist options
  • Select an option

  • Save AyushSachdev/edc23605438f1cccdd50 to your computer and use it in GitHub Desktop.

Select an option

Save AyushSachdev/edc23605438f1cccdd50 to your computer and use it in GitHub Desktop.

Revisions

  1. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ A shell script to install VPN using SoftEther and Transmission CLI Torrent Clien

    ```shell
    sudo su
    wget bit.ly/DigitalVPN
    wget ayush.sachdev.me/DigitalOceanVPN
    sh DigitalVPN
    ```

  2. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -8,8 +8,8 @@ A shell script to install VPN using SoftEther and Transmission CLI Torrent Clien

    ```shell
    sudo su
    wget bit.ly/DigitalOceanVPN
    sh DigitalOceanVPN
    wget bit.ly/DigitalVPN
    sh DigitalVPN
    ```

    * Once the script starts running, follow the prompts.
  3. AyushSachdev revised this gist Jun 6, 2014. 2 changed files with 22 additions and 7 deletions.
    6 changes: 5 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -65,4 +65,8 @@ At

    * Export OpenVPN config using ```OpenVpnMakeConfig ~/my_openvpn_config.zip```

    * Copy the link shown and enter the password
    * Copy the link shown and enter the password

    * Hit control-C to stop dropbox sync: ```^C```

    * You can use ```dropbox.py help``` to control the Dropbox sync
    23 changes: 17 additions & 6 deletions TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -19,11 +19,11 @@ apt-get -y install transmission-cli transmission-common transmission-daemon ngin
    # "rpc-authentication-required": false
    # "rpc-whitelist-enabled": false

    mkdir /usr/share/nginx/www
    mkdir /usr/share/nginx/www/downloads
    mkdir /usr/share/nginx/www/torrents
    mkdir -p /usr/share/nginx/www
    mkdir -p /usr/share/nginx/www/downloads
    mkdir -p /usr/share/nginx/www/torrents
    chmod -R 777 /usr/share/nginx/www
    rm /usr/share/nginx/www/index.html
    rm -f /usr/share/nginx/www/index.html

    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/settings.json
    mv $DIR/settings.json /etc/transmission-daemon/settings.json
    @@ -54,7 +54,7 @@ chmod 700 /usr/local/vpnserver/vpncmd
    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/vpnserver
    mv $DIR/vpnserver /etc/init.d/vpnserver

    mkdir /var/lock/subsys
    mkdir -p /var/lock/subsys
    chmod 755 /etc/init.d/vpnserver && /etc/init.d/vpnserver start
    update-rc.d vpnserver defaults
    cd /usr/local/vpnserver
    @@ -65,4 +65,15 @@ echo "Now setup the real VPN server"

    cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
    echo "Copy the link shown and do it"
    ~/.dropbox-dist/dropboxd
    ~/.dropbox-dist/dropboxd

    wget -O /bin/dropbox.py "https://www.dropbox.com/download?dl=packages/dropbox.py"
    chmod +x /bin/dropbox.py
    dropbox.py autostart y
    dropbox.py start
    dropbox.py status
    dropbox.py lansync y
    dropbox.py status
    mkdir -p ~/Dropbox/torrents
    rm -r -f /usr/share/nginx/www/torrents
    ln -s ~/Dropbox/torrents /usr/share/nginx/www
  4. AyushSachdev revised this gist Jun 6, 2014. 2 changed files with 8 additions and 2 deletions.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -63,4 +63,6 @@ At

    * Enable OpenVPN using ```OpenVpnEnable yes /PORTS:1194```

    * Export OpenVPN config using ```OpenVpnMakeConfig ~/my_openvpn_config.zip```
    * Export OpenVPN config using ```OpenVpnMakeConfig ~/my_openvpn_config.zip```

    * Copy the link shown and enter the password
    6 changes: 5 additions & 1 deletion TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -61,4 +61,8 @@ cd /usr/local/vpnserver
    echo "Check the VPN installation by pressing 3 and type check then quit"
    ./vpncmd
    echo "Now setup the real VPN server"
    ./vpncmd
    ./vpncmd

    cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
    echo "Copy the link shown and do it"
    ~/.dropbox-dist/dropboxd
  5. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 45 additions and 1 deletion.
    46 changes: 45 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -19,4 +19,48 @@ At
    * Press **3** and type ```check```

    * If all goes well, type ```quit```
    * If all goes well, type ```quit```

    * Press **1** to select "Management of VPN Server or VPN Bridge"

    * Press Enter without typing anything to connect to the localhost server

    * Again press Enter without inputting anything to connect to server by server admin mode.

    * Then use command below to change admin password ```ServerPasswordSet```

    * Create a Virtual Hub named *VPN* using the command ```HubCreate VPN```

    * Next you will be asked to enter an administrator password for the hub. This password will be used whenever you are not logged in as server admin mode, and you want to manage that specific hub.

    * Now select the Virtual Hub you created using this command ```Hub VPN```

    * Enable SecureNAT using ```SecureNatEnable```

    * Create a user named *Ayush* using the command ```UserCreate ayush```

    * To set a password for *Ayush*, type ```UserPasswordSet ayush```

    * To enable IPsecEnable type ```IPsecEnable```

    * **Enable L2TP over IPsec Server Function**: Choose **yes** to enable L2TP VPN over IPSec with pre-shared key encryption. Now you can make VPN connections to this server using iPhone, Android, Windows, and Mac OS X devices.

    * **Enable Raw L2TP Server Function**: This will enable L2TP VPN for clients with no IPSec encryption.

    * **Enable EtherIP / L2TPv3 over IPsec Server Function**: Routers which are compatible with EtherIP / L2TPv3 over IPsec can connect to this server by enabling this function.

    * **Pre Shared Key for IPsec**: Enter a pre-shared key to use with L2TP VPN.

    * **Default Virtual HUB in a case of omitting the HUB on the Username**: Users must specify the Virtual Hub they are trying to connect to by using **Username@TargetHubName** as their username when connecting. This option specifies which Virtual Hub to be used if the user does not provide such information. In our case enter **VPN**.

    * Get Fully Qualified Domain Name (FQDN) using ```hostname -f```

    * Generate a server for SSL using ```ServerCertRegenerate [FQDN]```

    * Export the SSL certificate using ```ServerCertGet ~/cert.cer```

    * Enable SSTP using ```SstpEnable yes```

    * Enable OpenVPN using ```OpenVpnEnable yes /PORTS:1194```

    * Export OpenVPN config using ```OpenVpnMakeConfig ~/my_openvpn_config.zip```
  6. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -58,5 +58,7 @@ mkdir /var/lock/subsys
    chmod 755 /etc/init.d/vpnserver && /etc/init.d/vpnserver start
    update-rc.d vpnserver defaults
    cd /usr/local/vpnserver
    echo "Setup VPN Softether manually now"
    echo "Check the VPN installation by pressing 3 and type check then quit"
    ./vpncmd
    echo "Now setup the real VPN server"
    ./vpncmd
  7. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 22 additions and 2 deletions.
    24 changes: 22 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,22 @@
    Readme
    ======
    # Readme

    A shell script to install VPN using SoftEther and Transmission CLI Torrent Client on Ubuntu 14.04 for use on Digital Ocean

    ## Execution

    * Execution for installation and setup

    ```shell
    sudo su
    wget bit.ly/DigitalOceanVPN
    sh DigitalOceanVPN
    ```

    * Once the script starts running, follow the prompts.
    At

    > Setup VPN Softether manually now
    * Press **3** and type ```check```

    * If all goes well, type ```quit```
  8. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    Readme
    ======
  9. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -43,6 +43,7 @@ apt-get install -y make gcc openssl build-essential
    apt-get update -y && apt-get upgrade -y
    apt-get dist-upgrade -y
    cd $DIR/vpnserver
    echo "Agree to the License Aggreement"
    make
    cd $DIR
    mv $DIR/vpnserver /usr/local
    @@ -57,4 +58,5 @@ mkdir /var/lock/subsys
    chmod 755 /etc/init.d/vpnserver && /etc/init.d/vpnserver start
    update-rc.d vpnserver defaults
    cd /usr/local/vpnserver
    echo "DONE"
    echo "Setup VPN Softether manually now"
    ./vpncmd
  10. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 14 additions and 13 deletions.
    27 changes: 14 additions & 13 deletions TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,8 @@
    # Torrent - http://filesharefreak.com/2012/05/10/seedbox-from-scratch-new-server-to-seeding-in-less-than-5-minutes
    # VPN - https://www.digitalocean.com/community/articles/how-to-setup-a-multi-protocol-vpn-server-using-softether

    echo "Checking Permissions"
    DIR="`pwd`"

    apt-get update -y && apt-get upgrade -y
    apt-get dist-upgrade -y
    apt-get -y install python-software-properties vim
    @@ -25,13 +26,13 @@ chmod -R 777 /usr/share/nginx/www
    rm /usr/share/nginx/www/index.html

    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/settings.json
    mv settings.json /etc/transmission-daemon/settings.json
    mv $DIR/settings.json /etc/transmission-daemon/settings.json

    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/nginx.conf
    mv nginx.conf /etc/nginx/nginx.conf
    mv $DIR/nginx.conf /etc/nginx/nginx.conf

    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/default-site
    mv default-site /etc/nginx/sites-enabled/default
    mv $DIR/default-site /etc/nginx/sites-enabled/default

    /etc/init.d/transmission-daemon reload
    /etc/init.d/nginx restart
    @@ -41,19 +42,19 @@ tar xzvf softether-vpnserver-v4.07-9448-rtm-2014.06.06-linux-x64-64bit.tar.gz
    apt-get install -y make gcc openssl build-essential
    apt-get update -y && apt-get upgrade -y
    apt-get dist-upgrade -y
    cd vpnserver
    cd $DIR/vpnserver
    make
    cd ..
    mv vpnserver /usr/local
    cd /usr/local/vpnserver/
    chmod 600 *
    chmod 700 vpnserver
    chmod 700 vpncmd
    cd $DIR
    mv $DIR/vpnserver /usr/local
    chmod 600 /usr/local/vpnserver/*
    chmod 700 /usr/local/vpnserver/vpnserver
    chmod 700 /usr/local/vpnserver/vpncmd

    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/vpnserver
    mv vpnserver /etc/init.d/vpnserver
    mv $DIR/vpnserver /etc/init.d/vpnserver

    mkdir /var/lock/subsys
    chmod 755 /etc/init.d/vpnserver && /etc/init.d/vpnserver start
    update-rc.d vpnserver defaults
    cd /usr/local/vpnserver
    cd /usr/local/vpnserver
    echo "DONE"
  11. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 12 additions and 5 deletions.
    17 changes: 12 additions & 5 deletions TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -38,15 +38,22 @@ mv default-site /etc/nginx/sites-enabled/default

    wget http://www.softether-download.com/files/softether/v4.07-9448-rtm-2014.06.06-tree/Linux/SoftEther%20VPN%20Server/64bit%20-%20Intel%20x64%20or%20AMD64/softether-vpnserver-v4.07-9448-rtm-2014.06.06-linux-x64-64bit.tar.gz
    tar xzvf softether-vpnserver-v4.07-9448-rtm-2014.06.06-linux-x64-64bit.tar.gz
    apt-get install make gcc openssl build-essential
    apt-get update
    apt-get upgrade
    apt-get dist-upgrade
    apt-get install -y make gcc openssl build-essential
    apt-get update -y && apt-get upgrade -y
    apt-get dist-upgrade -y
    cd vpnserver
    make
    cd ..
    mv vpnserver /usr/local
    cd /usr/local/vpnserver/
    chmod 600 *
    chmod 700 vpnserver
    chmod 700 vpncmd
    chmod 700 vpncmd

    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/vpnserver
    mv vpnserver /etc/init.d/vpnserver

    mkdir /var/lock/subsys
    chmod 755 /etc/init.d/vpnserver && /etc/init.d/vpnserver start
    update-rc.d vpnserver defaults
    cd /usr/local/vpnserver
  12. AyushSachdev revised this gist Jun 6, 2014. 2 changed files with 41 additions and 1 deletion.
    17 changes: 16 additions & 1 deletion TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -34,4 +34,19 @@ wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/de
    mv default-site /etc/nginx/sites-enabled/default

    /etc/init.d/transmission-daemon reload
    /etc/init.d/nginx restart
    /etc/init.d/nginx restart

    wget http://www.softether-download.com/files/softether/v4.07-9448-rtm-2014.06.06-tree/Linux/SoftEther%20VPN%20Server/64bit%20-%20Intel%20x64%20or%20AMD64/softether-vpnserver-v4.07-9448-rtm-2014.06.06-linux-x64-64bit.tar.gz
    tar xzvf softether-vpnserver-v4.07-9448-rtm-2014.06.06-linux-x64-64bit.tar.gz
    apt-get install make gcc openssl build-essential
    apt-get update
    apt-get upgrade
    apt-get dist-upgrade
    cd vpnserver
    make
    cd ..
    mv vpnserver /usr/local
    cd /usr/local/vpnserver/
    chmod 600 *
    chmod 700 vpnserver
    chmod 700 vpncmd
    25 changes: 25 additions & 0 deletions vpnserver
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    #!/bin/sh
    # chkconfig: 2345 99 01
    # description: SoftEther VPN Server
    DAEMON=/usr/local/vpnserver/vpnserver
    LOCK=/var/lock/subsys/vpnserver
    test -x $DAEMON || exit 0
    case "$1" in
    start)
    $DAEMON start
    touch $LOCK
    ;;
    stop)
    $DAEMON stop
    rm $LOCK
    ;;
    restart)
    $DAEMON stop
    sleep 3
    $DAEMON start
    ;;
    *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
    esac
    exit 0
  13. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -18,8 +18,9 @@ apt-get -y install transmission-cli transmission-common transmission-daemon ngin
    # "rpc-authentication-required": false
    # "rpc-whitelist-enabled": false

    mkdir /usr/share/ngninx/www
    mkdir /usr/share/ngninx/www/torrents
    mkdir /usr/share/nginx/www
    mkdir /usr/share/nginx/www/downloads
    mkdir /usr/share/nginx/www/torrents
    chmod -R 777 /usr/share/nginx/www
    rm /usr/share/nginx/www/index.html

  14. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions settings.json
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@
    "blocklist-url": "http://www.example.com/blocklist",
    "cache-size-mb": 4,
    "dht-enabled": true,
    "download-dir": "/var/lib/transmission-daemon/downloads",
    "download-dir": "/usr/share/nginx/www/downloads",
    "download-limit": 100,
    "download-limit-enabled": 0,
    "download-queue-enabled": true,
    @@ -43,15 +43,15 @@
    "ratio-limit": 2,
    "ratio-limit-enabled": false,
    "rename-partial-files": true,
    "rpc-authentication-required": true,
    "rpc-authentication-required": false,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-password": "{91cf1eea8281c75ef83302f6ed093ee707c82023lPsm1a/9",
    "rpc-port": 9091,
    "rpc-url": "/transmission/",
    "rpc-username": "transmission",
    "rpc-whitelist": "127.0.0.1",
    "rpc-whitelist-enabled": true,
    "rpc-whitelist-enabled": false,
    "scrape-paused-torrents-enabled": true,
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
  15. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -22,10 +22,15 @@ mkdir /usr/share/ngninx/www
    mkdir /usr/share/ngninx/www/torrents
    chmod -R 777 /usr/share/nginx/www
    rm /usr/share/nginx/www/index.html

    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/settings.json
    mv settings.json /etc/transmission-daemon/settings.json

    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/nginx.conf
    mv nginx.conf /etc/nginx/nginx.conf

    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/default-site
    mv default-site /etc/nginx/sites-enabled/default

    /etc/init.d/transmission-daemon reload
    /etc/init.d/nginx restart
  16. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 112 additions and 0 deletions.
    112 changes: 112 additions & 0 deletions default-site
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,112 @@
    # You may add here your
    # server {
    # ...
    # }
    # statements for each of your virtual hosts to this file

    ##
    # You should look at the following URL's in order to grasp a solid understanding
    # of Nginx configuration files in order to fully unleash the power of Nginx.
    # http://wiki.nginx.org/Pitfalls
    # http://wiki.nginx.org/QuickStart
    # http://wiki.nginx.org/Configuration
    #
    # Generally, you will want to move this file somewhere, and start with a clean
    # file but keep this around for reference. Or just disable in sites-enabled.
    #
    # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
    ##

    server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /usr/share/nginx/www;
    index index.html index.htm;

    # Make site accessible from http://localhost/
    server_name localhost;

    location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;
    # Uncomment to enable naxsi on this location
    # include /etc/nginx/naxsi.rules
    }

    # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
    #location /RequestDenied {
    # proxy_pass http://127.0.0.1:8080;
    #}

    #error_page 404 /404.html;

    # redirect server error pages to the static page /50x.html
    #
    #error_page 500 502 503 504 /50x.html;
    #location = /50x.html {
    # root /usr/share/nginx/www;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    # fastcgi_split_path_info ^(.+\.php)(/.+)$;
    # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    #
    # # With php5-cgi alone:
    # fastcgi_pass 127.0.0.1:9000;
    # # With php5-fpm:
    # fastcgi_pass unix:/var/run/php5-fpm.sock;
    # fastcgi_index index.php;
    # include fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    # deny all;
    #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    # listen 8000;
    # listen somename:8080;
    # server_name somename alias another.alias;
    # root html;
    # index index.html index.htm;
    #
    # location / {
    # try_files $uri $uri/ =404;
    # }
    #}


    # HTTPS server
    #
    #server {
    # listen 443;
    # server_name localhost;
    #
    # root html;
    # index index.html index.htm;
    #
    # ssl on;
    # ssl_certificate cert.pem;
    # ssl_certificate_key cert.key;
    #
    # ssl_session_timeout 5m;
    #
    # ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
    # ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
    # ssl_prefer_server_ciphers on;
    #
    # location / {
    # try_files $uri $uri/ =404;
    # }
    #}
  17. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,8 @@ apt-get -y install transmission-cli transmission-common transmission-daemon ngin
    # "rpc-whitelist-enabled": false

    mkdir /usr/share/ngninx/www
    chmod 777 /usr/share/nginx/www
    mkdir /usr/share/ngninx/www/torrents
    chmod -R 777 /usr/share/nginx/www
    rm /usr/share/nginx/www/index.html
    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/settings.json
    mv settings.json /etc/transmission-daemon/settings.json
  18. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -24,4 +24,7 @@ rm /usr/share/nginx/www/index.html
    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/settings.json
    mv settings.json /etc/transmission-daemon/settings.json
    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/nginx.conf
    mv nginx.conf /etc/nginx/nginx.conf
    mv nginx.conf /etc/nginx/nginx.conf

    /etc/init.d/transmission-daemon reload
    /etc/init.d/nginx restart
  19. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,5 @@ chmod 777 /usr/share/nginx/www
    rm /usr/share/nginx/www/index.html
    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/settings.json
    mv settings.json /etc/transmission-daemon/settings.json
    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/nginx.conf
    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/nginx.conf
    mv nginx.conf /etc/nginx/nginx.conf
  20. AyushSachdev revised this gist Jun 6, 2014. 2 changed files with 101 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -19,3 +19,8 @@ apt-get -y install transmission-cli transmission-common transmission-daemon ngin
    # "rpc-whitelist-enabled": false

    mkdir /usr/share/ngninx/www
    chmod 777 /usr/share/nginx/www
    rm /usr/share/nginx/www/index.html
    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/settings.json
    mv settings.json /etc/transmission-daemon/settings.json
    wget https://gist.github.com/AyushSachdev/edc23605438f1cccdd50/raw/nginx.conf
    96 changes: 96 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,96 @@
    user www-data;
    worker_processes 4;
    pid /run/nginx.pid;

    events {
    worker_connections 768;
    # multi_accept on;
    }

    http {
    autoindex on;

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # nginx-naxsi config
    ##
    # Uncomment it if you installed nginx-naxsi
    ##

    #include /etc/nginx/naxsi_core.rules;

    ##
    # nginx-passenger config
    ##
    # Uncomment it if you installed nginx-passenger
    ##

    #passenger_root /usr;
    #passenger_ruby /usr/bin/ruby;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
    }


    #mail {
    # # See sample authentication script at:
    # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
    #
    # # auth_http localhost/auth.php;
    # # pop3_capabilities "TOP" "USER";
    # # imap_capabilities "IMAP4rev1" "UIDPLUS";
    #
    # server {
    # listen localhost:110;
    # protocol pop3;
    # proxy on;
    # }
    #
    # server {
    # listen localhost:143;
    # protocol imap;
    # proxy on;
    # }
    #}
  21. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 73 additions and 0 deletions.
    73 changes: 73 additions & 0 deletions settings.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,73 @@
    {
    "alt-speed-down": 50,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 50,
    "bind-address-ipv4": "0.0.0.0",
    "bind-address-ipv6": "::",
    "blocklist-enabled": false,
    "blocklist-url": "http://www.example.com/blocklist",
    "cache-size-mb": 4,
    "dht-enabled": true,
    "download-dir": "/var/lib/transmission-daemon/downloads",
    "download-limit": 100,
    "download-limit-enabled": 0,
    "download-queue-enabled": true,
    "download-queue-size": 5,
    "encryption": 1,
    "idle-seeding-limit": 30,
    "idle-seeding-limit-enabled": false,
    "incomplete-dir": "/home/debian-transmission/Downloads",
    "incomplete-dir-enabled": false,
    "lpd-enabled": false,
    "max-peers-global": 200,
    "message-level": 2,
    "peer-congestion-algorithm": "",
    "peer-id-ttl-hours": 6,
    "peer-limit-global": 200,
    "peer-limit-per-torrent": 50,
    "peer-port": 51413,
    "peer-port-random-high": 65535,
    "peer-port-random-low": 49152,
    "peer-port-random-on-start": false,
    "peer-socket-tos": "default",
    "pex-enabled": true,
    "port-forwarding-enabled": false,
    "preallocation": 1,
    "prefetch-enabled": 1,
    "queue-stalled-enabled": true,
    "queue-stalled-minutes": 30,
    "ratio-limit": 2,
    "ratio-limit-enabled": false,
    "rename-partial-files": true,
    "rpc-authentication-required": true,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-password": "{91cf1eea8281c75ef83302f6ed093ee707c82023lPsm1a/9",
    "rpc-port": 9091,
    "rpc-url": "/transmission/",
    "rpc-username": "transmission",
    "rpc-whitelist": "127.0.0.1",
    "rpc-whitelist-enabled": true,
    "scrape-paused-torrents-enabled": true,
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
    "seed-queue-enabled": false,
    "seed-queue-size": 10,
    "speed-limit-down": 100,
    "speed-limit-down-enabled": false,
    "speed-limit-up": 100,
    "speed-limit-up-enabled": false,
    "start-added-torrents": true,
    "trash-original-torrent-files": false,
    "umask": 18,
    "upload-limit": 100,
    "upload-limit-enabled": 0,
    "upload-slots-per-torrent": 14,
    "utp-enabled": true,
    "watch-dir": "/usr/share/nginx/www/torrents",
    "watch-dir-enabled": true
    }
  22. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,11 @@ apt-get dist-upgrade -y
    apt-get -y install python-software-properties vim
    add-apt-repository -y ppa:transmissionbt/ppa
    apt-get -y update
    apt-get -y install transmission-cli transmission-common transmission-daemon nginx
    apt-get -y install transmission-cli transmission-common transmission-daemon nginx

    # nano /etc/transmission-daemon/settings.json
    # "download-dir": "/etc/share/ngninx/www"
    # "rpc-authentication-required": false
    # "rpc-whitelist-enabled": false

    mkdir /usr/share/ngninx/www
  23. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,14 @@
    #!/bin/sh
    # VPN and Torrent on Ubuntu 14.04 on Digital Ocean
    # References:
    # Torrent - https://gist.github.com/timothyandrew/6162351
    # Torrent - http://filesharefreak.com/2012/05/10/seedbox-from-scratch-new-server-to-seeding-in-less-than-5-minutes
    # VPN - https://www.digitalocean.com/community/articles/how-to-setup-a-multi-protocol-vpn-server-using-softether

    echo "Checking Permissions"
    apt-get update -y && apt-get upgrade -y
    apt-get dist-upgrade -y
    apt-get dist-upgrade -y
    apt-get -y install python-software-properties vim
    add-apt-repository -y ppa:transmissionbt/ppa
    apt-get -y update
    apt-get -y install transmission-cli transmission-common transmission-daemon nginx
  24. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,5 @@
    # VPN and Torrent on Ubuntu 14.04 on Digital Ocean

    echo "Checking Permissions"
    apt-get update -y && apt-get upgrade -y
    apt-get update -y && apt-get upgrade -y
    apt-get dist-upgrade -y
  25. AyushSachdev revised this gist Jun 6, 2014. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions TorrentWithVPN.sh
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,5 @@
    #!/bin/sh
    # VPN and Torrent on Ubuntu 14.04 on Digital Ocean

    echo "Checking Permissions"
    apt-get update -y && apt-get upgrade -y
  26. AyushSachdev renamed this gist Jun 6, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  27. AyushSachdev renamed this gist Jun 6, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.sh → TorrentWithVPN
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    #!/bin/sh
    # VPN and Torrent on Ubuntu 14.04 on Digital Ocean
  28. AyushSachdev created this gist Jun 6, 2014.
    1 change: 1 addition & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    # VPN and Torrent on Ubuntu 14.04 on Digital Ocean