diff --git a/tools/azure/Readme.md b/tools/azure/Readme.md index 6a67030..268230a 100644 --- a/tools/azure/Readme.md +++ b/tools/azure/Readme.md @@ -1,4 +1,4 @@ -PLEASE SHARE WITH YOUR FRIENDS AND ANYONE WHO WANTS TO HELP BUT DOESN'T KNOW HOW!!! +## PLEASE SHARE WITH YOUR FRIENDS AND ANYONE WHO WANTS TO HELP BUT DOESN'T KNOW HOW!!! The main idea behind uashield on Azure is the following: uashield is able to dynamically update proxies and target IPs. So you, as a user, only have to follow the instructions below and as a result you will add a few servers to something like a botnet. Everything else will be done by guys from the uashield community. Link to the project: [https://github.com/opengs/uashield](https://github.com/opengs/uashield). @@ -10,10 +10,14 @@ PLEASE SHARE WITH YOUR FRIENDS AND ANYONE WHO WANTS TO HELP BUT DOESN'T KNOW ![](https://github.com/opengs/uashield/blob/master/tools/azure/images/2.jpg) 3. Do the registration. They will ask for your bank card information. You must have 1$ in order to pass card validation (it will be returned). + ![](https://github.com/opengs/uashield/blob/master/tools/azure/images/3.jpg) + 4. After the registration, go to the Microsoft Azure main page [https://portal.azure.com/#home](https://portal.azure.com/#home) 5. Select "Virtual machines" from the list. + ![](https://github.com/opengs/uashield/blob/master/tools/azure/images/4.jpg) + 6. Upper left corner - press "Create" - "Virtual machine". ![](https://github.com/opengs/uashield/blob/master/tools/azure/images/5.jpg) @@ -25,24 +29,31 @@ PLEASE SHARE WITH YOUR FRIENDS AND ANYONE WHO WANTS TO HELP BUT DOESN'T KNOW * Image – Ubuntu Server 20.04. * Check "Azure Spot Instance". * Eviction policy – delete. -* Size – Standart\_D2s\_v3 – 2 vcpus, 8 GiB memory. (As you can see, the price for the server is something like 0.129$/hr. With a free 200$ for "Free account" we're able to use 200/0.129 = 1550 hrs of server time for free. For example, 5 servers will work for free for 1550/5 = 310 hrs. If you are not allowed to choose this one, try to find one available with 2 vCPUs and choose it. +* Size – Standart\_D4s\_v4 – 4 vcpus, 16 GiB memory. (As you can see, the price for the server is something like 0.026$/hr. With a free 200$ for "Free account" we're able to use 200/0.026 = 7692 hrs of server time for free. For example, 10 servers will work for free for 7692/10 = 769 hrs, its about 32 days! If Standart\_D4s\_v4 is not available, try to select other 4 vcpus and 16 GiB memory, but if it is much more expencive, then try other region. ![](https://github.com/opengs/uashield/blob/master/tools/azure/images/7.jpg) ![](https://github.com/opengs/uashield/blob/master/tools/azure/images/8.jpg) 8. Go to "Advanced" tab (above) and paste the script [https://github.com/opengs/uashield/blob/master/tools/azure/azure-custom-data-script.sh](https://github.com/opengs/uashield/blob/master/tools/azure/azure-custom-data-script.sh) (just copy it as a text) to "Custom data". + ![](https://github.com/opengs/uashield/blob/master/tools/azure/images/9.jpg) + 9. Go to "Disk" tab and change "OS disk type" from "Premium SSD" to "Standart SSD". + ![](https://github.com/opengs/uashield/blob/master/tools/azure/images/10.jpg) + 10. "Review + create" – "Create". + ![](https://github.com/opengs/uashield/blob/master/tools/azure/images/11.jpg) ![](https://github.com/opengs/uashield/blob/master/tools/azure/images/12.jpg) 11. Wait until deployment is complete. - ![](![](https://github.com/opengs/uashield/blob/master/tools/azure/images/13.jpg) -![](![](https://github.com/opengs/uashield/blob/master/tools/azure/images/14.jpg) +![](https://github.com/opengs/uashield/blob/master/tools/azure/images/13.jpg) + +![](https://github.com/opengs/uashield/blob/master/tools/azure/images/14.jpg) You have successfully created one server. You can repeat steps 5-11 until you exceed the limit of vCPUs available for your free account (Azure won't let you create one more server). -**Also mention that If you exceed the limit in one region, you can choose another one and you will be able to launch servers there.** +### IMPORTANT If you exceed the limit in one region, you can try another one and you will be able to launch servers there +### WARNING Don`t use Australia region. Network traffic is every expensive from there. \ No newline at end of file diff --git a/tools/azure/azure-custom-data-script.sh b/tools/azure/azure-custom-data-script.sh index 8b66789..f2d9937 100644 --- a/tools/azure/azure-custom-data-script.sh +++ b/tools/azure/azure-custom-data-script.sh @@ -31,10 +31,21 @@ sudo apt install -y docker-compose cd /home/ -sudo docker-compose pull && sudo docker-compose up -d --scale worker=$(grep -c ^processor /proc/cpuinfo) +#get amount of CPU cores +cpu_qty=$(grep -c ^processor /proc/cpuinfo) +#set amount of workers as CPU cores minus one to avoid 100% CPU load, because it can cause account ban +if [ $cpu_qty -gt 1 ] #if only one core nothing to decrease +then + workers_qty=$(($cpu_qty-1)) +else + workers_qty=$cpu_qty +fi -sudo echo "*/30 * * * * cd /home/ && sudo docker-compose down -t 1 && sudo docker-compose pull && sudo docker-compose up -d --scale worker=$(grep -c ^processor /proc/cpuinfo)" >> /home/cronjob +sudo docker-compose pull && sudo docker-compose up -d --scale worker=$workers_qty + +sudo echo "*/30 * * * * cd /home/ && sudo docker-compose down -t 1 && sudo docker-compose pull && sudo docker-compose up -d --scale worker=$workers_qty" >> /home/cronjob # restart:always should do the job to run container on startup, but the hard restart is good here to avoid problems -sudo echo "@reboot cd /home/ && sudo docker-compose down -t 1 && sudo docker-compose pull && sudo docker-compose up -d --scale worker=$(grep -c ^processor /proc/cpuinfo)" >> /home/cronjob +sudo echo "@reboot cd /home/ && sudo docker-compose down -t 1 && sudo docker-compose pull && sudo docker-compose up -d --scale worker=$workers_qty" >> /home/cronjob + crontab /home/cronjob