Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
# To extract the sound from a video and save it as MP3: | |
ffmpeg -i <video.mp4> -vn <sound>.mp3 | |
# To convert frames from a video or GIF into individual numbered images: | |
ffmpeg -i <video.mpg|video.gif> <frame_%d.png> | |
# To combine numbered images (frame_1.jpg, frame_2.jpg, etc) into a video or GIF: | |
ffmpeg -i <frame_%d.jpg> -f image2 <video.mpg|video.gif> | |
# To quickly extract a single frame from a video at time mm:ss and save it as a 128x128 resolution image: |
# uvicorn main:app --host $(hostname) --port 8080 --log-level debug --reload | |
from fastapi import APIRouter, FastAPI | |
from utils import create_versioned_docs | |
VERSION = '2.0.0' | |
TITLE = 'Sample Versioned API' | |
DESCRIPTION = 'Sample versioned API blurb' | |
app = FastAPI(docs_url=None, redoc_url=None, title=TITLE, version=VERSION, description=DESCRIPTION) |
from fastapi import APIRouter, FastAPI | |
from utils import create_versioning_docs | |
app = FastAPI(docs_url=None, redoc_url=None) | |
v1_router = APIRouter(prefix="/v1") | |
v2_router = APIRouter(prefix="/v2") |
import base64 | |
import hashlib | |
import hmac | |
import json | |
from flask import Flask, jsonify, request | |
app = Flask(__name__) |
import jwt | |
import time | |
import datetime | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.hazmat.primitives import serialization | |
# Load the key we created | |
with open("mykey.pem", "rb") as key_file: | |
private_key = serialization.load_pem_private_key( |
CREATE TABLE test | |
( | |
id INTEGER, | |
parent INTEGER | |
); | |
INSERT INTO test (id, parent) VALUES | |
(1, NULL), | |
(2, 1), |
The standard names for indexes in PostgreSQL are:
{tablename}_{columnname(s)}_{suffix}
where the suffix is one of the following:
pkey
for a Primary Key constraint;key
for a Unique constraint;excl
for an Exclusion constraint;idx
for any other kind of index;
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json" |