This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add - | |
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yc compute instance create \ | |
--name reddit-app \ | |
--hostname reddit-app \ | |
--memory=4 \ | |
--create-boot-disk image-folder-id=standard-images,image-family=ubuntu-1604-lts,size=10GB \ | |
--network-interface subnet-name=default-ru-central1-a,nat-ip-version=ipv4 \ | |
--metadata serial-port-enable=1 \ | |
--ssh-key ~/.ssh/appuser.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Создадим сервисный аккаунт: | |
yc iam service-account create --name service | |
2. Добавим роль нашему сервисному аккаунту: | |
yc resource-manager folder add-access-binding default \ | |
--role editor \ | |
--subject serviceAccount:<ID_SERVICE_ACCOUNT> | |
3. Создадим ключи доступа для аккаунта service: | |
yc iam access-key create --service-account-name service \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import psutil | |
from flask import Flask | |
app = Flask(__name__) | |
STALE = 12345678910111213 | |
@app.route('/') |