Skip to content

Instantly share code, notes, and snippets.

View twyle's full-sized avatar

lyle okoth twyle

View GitHub Profile
# 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
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
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
@twyle
twyle / run.sh
Last active June 23, 2022 12:01
#!/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
version: '3'
services:
vault:
build:
context: ./vault
dockerfile: Dockerfile
ports:
- 8200:8200
# base image
FROM alpine:3.14
# set vault version
ENV VAULT_VERSION 1.8.2
# create a new directory
RUN mkdir /vault
# download dependencies
{
"backend": {
"file": {
"path": "vault/data"
}
},
"listener": {
"tcp":{
"address": "0.0.0.0:8200",
"tls_disable": 1
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
version: '3'
services:
test_db:
image: postgres
container_name: test_db_2
restart: always
environment:
POSTGRES_HOST: localhost
POSTGRES_DB: lyle
# -*- 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)