Skip to content

Instantly share code, notes, and snippets.

@pvbhanuteja
pvbhanuteja / README.md
Created February 23, 2024 01:54 — forked from liviaerxin/README.md
FastAPI and Uvicorn Logging #python #fastapi #uvicorn #logging

FastAPI and Uvicorn Logging

When running FastAPI app, all the logs in console are from Uvicorn and they do not have timestamp and other useful information. As Uvicorn applies python logging module, we can override Uvicorn logging formatter by applying a new logging configuration.

Meanwhile, it's able to unify the your endpoints logging with the Uvicorn logging by configuring all of them in the config file log_conf.yaml.

Before overriding:

uvicorn main:app --reload
@pvbhanuteja
pvbhanuteja / breach.txt
Created January 8, 2024 06:32 — forked from fawazahmed0/breach.txt
Email and password breach collection list
# Please Note, I am sharing this, hoping this will be used for good public use, such as data analysis, penetration testing etc
# These links are already available all over the internet
# Also Note, Trying to login into someone else's account without their permission is unethical and illegal
# Collection 1
magnet:?xt=urn:btih:B39C603C7E18DB8262067C5926E7D5EA5D20E12E&dn=Collection%201&tr=udp%3a%2f%2ftracker.coppersurfer.tk%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.leechers-paradise.org%3a6969%2fannounce&tr=http%3a%2f%2ft.nyaatracker.com%3a80%2fannounce&tr=http%3a%2f%2fopentracker.xyz%3a80%2fannounce
# Collection 2-5 & Antipublic
magnet:?xt=urn:btih:D136B1ADDE531F38311FBF43FB96FC26DF1A34CD&dn=Collection%20%232-%235%20%26%20Antipublic&tr=udp%3a%2f%2ftracker.coppersurfer.tk%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.leechers-paradise.org%3a6969%2fannounce&tr=http%3a%2f%2ft.nyaatracker.com%3a80%2fannounce&tr=http%3a%2f%2fopentracker.xyz%3a80%2fannounce
PS C:\Users\pvbha> nmap 10.130.40.0/24
Starting Nmap 7.93 ( https://nmap.org ) at 2022-10-26 18:27 Central Daylight Time
Nmap scan report for 10.130.40.0
Host is up (0.033s latency).
All 1000 scanned ports on 10.130.40.0 are in ignored states.
Not shown: 1000 filtered tcp ports (no-response)
Nmap scan report for 10.130.40.1
Host is up (0.031s latency).
All 1000 scanned ports on 10.130.40.1 are in ignored states.
@pvbhanuteja
pvbhanuteja / AWS-pytesseract.md
Created August 16, 2022 20:32 — forked from mdv3101/AWS-pytesseract.md
Steps for installing Tesseract(4.0) on AWS-Lambda

Tesseract-OCR AWS Setup (using pytesseract and python2.7)

Follow these steps on a fresh 64bit AWS AIM instance

Connect to AWS AIM instance, then follow these steps:

  1. Update system libraries
sudo yum -y update
sudo yum -y upgrade
[tool.poetry]
name = "swapping-autoencoder-pytorch"
version = "0.1.0"
description = ""
authors = ["Bhanu <*@gmail.com>"]
[tool.poetry.dependencies]
python = "3.6.14"
torch = {url = "https://download.pytorch.org/whl/cpu/torch-1.9.0%2Bcpu-cp38-cp38-linux_x86_64.whl"}
torchvision = {url = "https://download.pytorch.org/whl/cpu/torchvision-0.10.0%2Bcpu-cp36-cp36m-linux_x86_64.whl"}
@pvbhanuteja
pvbhanuteja / Docker install and basics
Last active June 24, 2021 14:54
Docker install and basics
https://docs.docker.com/engine/install/ubuntu/
sudo chmod 666 /var/run/docker.sock
https://stackoverflow.com/questions/48957195/how-to-fix-docker-got-permission-denied-issue
# Download the file
path_to_zip = tf.keras.utils.get_file(
'spa-eng.zip', origin='http://storage.googleapis.com/download.tensorflow.org/data/spa-eng.zip',
extract=True)
path_to_file = os.path.dirname(path_to_zip)+"/spa-eng/spa.txt"
# Converts the unicode file to ascii
def unicode_to_ascii(s):
return ''.join(c for c in unicodedata.normalize('NFD', s)
@pvbhanuteja
pvbhanuteja / Imports
Created August 4, 2020 19:52
seq2seq attention model
import tensorflow as tf
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from sklearn.model_selection import train_test_split
import unicodedata
import re
import numpy as np
import os
@pvbhanuteja
pvbhanuteja / email_domains
Created July 26, 2020 09:53
top 100 email domains
gmail.com
yahoo.com
hotmail.com
aol.com
hotmail.co.uk
hotmail.fr
msn.com
yahoo.fr
wanadoo.fr
orange.fr
@pvbhanuteja
pvbhanuteja / regex_snippets
Created July 26, 2020 09:22
regex_snippets
. - Any Character Except New Line
\d - Digit (0-9)
\D - Not a Digit (0-9)
\w - Word Character (a-z, A-Z, 0-9, _)
\W - Not a Word Character
\s - Whitespace (space, tab, newline)
\S - Not Whitespace (space, tab, newline)
\b - Word Boundary
\B - Not a Word Boundary