Skip to content

Instantly share code, notes, and snippets.

@nymous
nymous / README.md
Last active March 28, 2024 16:46
Logging setup for FastAPI, Uvicorn and Structlog (with Datadog integration)

Logging setup for FastAPI

This logging setup configures Structlog to output pretty logs in development, and JSON log lines in production.

Then, you can use Structlog loggers or standard logging loggers, and they both will be processed by the Structlog pipeline (see the hello() endpoint for reference). That way any log generated by your dependencies will also be processed and enriched, even if they know nothing about Structlog!

Requests are assigned a correlation ID with the asgi-correlation-id middleware (either captured from incoming request or generated on the fly). All logs are linked to the correlation ID, and to the Datadog trace/span if instrumented. This data "global to the request" is stored in context vars, and automatically added to all logs produced during the request thanks to Structlog. You can add to these "global local variables" at any point in an endpoint with `structlog.contextvars.bind_contextvars(custom

@TarlogicSecurity
TarlogicSecurity / kerberos_attacks_cheatsheet.md
Created May 14, 2019 13:33
A cheatsheet with commands that can be used to perform kerberos attacks

Kerberos cheatsheet

Bruteforcing

With kerbrute.py:

python kerbrute.py -domain <domain_name> -users <users_file> -passwords <passwords_file> -outputfile <output_file>

With Rubeus version with brute module:

@dan987
dan987 / good_practices.md
Last active March 28, 2024 16:43
Common practice guideline: Guidelines and concepts. Reference to common patterns can be found all over the web.

100% of these suggestions are based on recent & relevant real world experience. We have, at least at one point, tried to use these patterns on our own & witnessed how the decision played out over years in production.

General Concepts

@WestleyK
WestleyK / output-color.sh
Created August 15, 2018 01:19
printf color output
#!/bin/bash
#
# Created by: Westley K
# Date: Aug 14, 2018
#
# run this in your terminal, and
# you will get nice colors and effects!
#
@ctaggart
ctaggart / create_source.rs
Last active March 28, 2024 16:34
Creating and Printing a TypeScript AST from Rust
#![allow(non_snake_case)]
#![allow(dead_code)]
// port of:
// Creating and Printing a TypeScript AST
// https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#creating-and-printing-a-typescript-ast
extern crate typescript_ts as ts;
extern crate chakracore;
use chakracore::context::ContextGuard;
@peterforgacs
peterforgacs / Windows10AWSEC2.md
Last active March 28, 2024 16:30
Running Windows 10 on AWS EC2

Running Windows 10 on AWS EC2

Downloading the image

Download the windows image you want.

AWS vmimport supported versions: Microsoft Windows 10 (Professional, Enterprise, Education) (US English) (64-bit only)

So Home wont work.

@vmartins
vmartins / mame-roms1.md
Created September 27, 2022 17:49
MAME download all roms arcade (1/2)
@wanlce
wanlce / emby.md
Last active March 28, 2024 16:28
Linux 下 Emby客户端破解教程

Linux 下 Emby客户端破解教程

emby 客户端是需要付费才能使用的, 市面上也有许多三方修改版或者用第三方客户端来绕过这个限制,但是基本都是移动端设置或windows,很少有关于 linux 版的客户端的,今天我来教大家自己动手,丰衣足食(通用版)

解锁前 Untitled

以下仅供个人研究使用

@jtmoon79
jtmoon79 / python-embedded-for-Win10.md
Last active March 28, 2024 16:25
fully configuring embedded Python on Windows 10

Update: use PowerShell script PythonEmbed4Win.ps1.

The instructions in this gist have some subtle problems and this gist will not be updated.

About


@fusetim
fusetim / protonvpn-wireguard-generator.py
Last active March 28, 2024 16:24
Generate lots of Wireguard configuration for your ProtonVPN Account.
import http.client
import http.cookies
import json
import base64
import hashlib
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import x25519
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives import hashes