This file contains hidden or 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
# First install the library | |
# pip install youtube | |
# You need youtube credentials. Follow this tutorila to get them https://medium.com/@lyle-okoth/how-to-get-a-google-api-key-d3c38649eaae | |
# This simple example shows you how to search through youtube for python ptogramming videos | |
from youtube import YouTube | |
from youtube.schemas import ( | |
SearchFilter, SearchOptionalParameters, SearchPart, YouTubeResponse, YouTubeRequest | |
) | |
from typing import Iterator |
This file contains hidden or 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
provider "aws" { | |
version = "~> 2.0" | |
region = "eu-west-2" | |
} | |
# Providing a reference to our default VPC | |
resource "aws_default_vpc" "default_vpc" { | |
} | |
# Providing a reference to our default subnets |
This file contains hidden or 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
FLASK_APP=api/__init.py | |
FLASK_ENV=development | |
SECRET_KEY=null | |
POSTGRES_HOST=null | |
POSTGRES_DB=null | |
POSTGRES_PORT=null | |
POSTGRES_USER=null | |
POSTGRES_PASSWORD=null |
This file contains hidden or 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
#!/bin/sh | |
rm -f .env | |
flask_app=$(curl -H "X-Vault-Token: $VAULT_TOKEN" \ | |
-X GET http://127.0.0.1:8200/v1/kv/vault-secret-management/local/flask_app) | |
echo FLASK_APP=$(echo $flask_app | jq -r .data.FLASK_APP) >> .env |
This file contains hidden or 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
version: '3' | |
services: | |
vault: | |
build: | |
context: ./vault | |
dockerfile: Dockerfile | |
ports: | |
- 8200:8200 |
This file contains hidden or 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
# base image | |
FROM alpine:3.14 | |
# set vault version | |
ENV VAULT_VERSION 1.8.2 | |
# create a new directory | |
RUN mkdir /vault | |
# download dependencies |
This file contains hidden or 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
{ | |
"backend": { | |
"file": { | |
"path": "vault/data" | |
} | |
}, | |
"listener": { | |
"tcp":{ | |
"address": "0.0.0.0:8200", | |
"tls_disable": 1 |
This file contains hidden or 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
FLASK_APP=api/__init__.py | |
FLASK_ENV=development | |
SECRET_KEY=supersecretkey | |
POSTGRES_HOST=192.168.xxx.x | |
POSTGRES_DB=lyle | |
POSTGRES_PORT=5438 | |
POSTGRES_USER=postgres | |
POSTGRES_PASSWORD=lyle |
This file contains hidden or 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
version: '3' | |
services: | |
test_db: | |
image: postgres | |
container_name: test_db_2 | |
restart: always | |
environment: | |
POSTGRES_HOST: localhost | |
POSTGRES_DB: lyle |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
"""This module executes the application.""" | |
from flask.cli import FlaskGroup | |
from api import app, db | |
from api.blueprints.default.models import User | |
cli = FlaskGroup(app) |
NewerOlder