Skip to content

Instantly share code, notes, and snippets.

@liviaerxin
liviaerxin / README.md
Last active October 23, 2025 12:29
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
@genesysflow
genesysflow / ingress.yml
Created September 20, 2022 15:28
k3s expose kubernetes dashboard through traefik ingress
apiVersion: traefik.containo.us/v1alpha1
kind: ServersTransport
metadata:
name: insecure-transport
namespace: default
spec:
insecureSkipVerify: true
---
apiVersion: networking.k8s.io/v1
kind: Ingress
@GuillaumeFalourd
GuillaumeFalourd / github-context-pull-request.json
Created June 26, 2021 17:15
Example of github context payload for a PULL REQUEST event (on Github Actions)
{
"token": "***",
"job": "github-context",
"ref": "refs/pull/16/merge",
"sha": "b4f1729888b5c99abdf8a7a250ecc6cff1e180be",
"repository": "GuillaumeFalourd/poc-github-actions",
"repository_owner": "GuillaumeFalourd",
"repositoryUrl": "git://github.com/GuillaumeFalourd/poc-github-actions.git",
"run_id": "974568708",
"run_number": "2",
@nebhead
nebhead / CustomUSBName.md
Last active October 13, 2025 16:31
Instructions for Adding Custom Naming for Arduino USB Device

The following is capturing instructions on how to add custom naming for an Arduino Leonardo (or generic pro-micro) for my Arcade Controller device. I wanted to have a simple record so that when I inevitably come back to this someday I can recall how I accomplished this. Reference was taken from the following YouTube video (https://youtu.be/hoCOq9Ngp44?t=1156) at approximately 19m16s.

WINDOWS Instructions:

Create a new set of folders: ~\Documents\Arduino\hardware\daemonbite\avr

Copy everything from C:\Program Files (x86)\Arduino\hardware\arduino\avr to this new folder.

@G4brym
G4brym / docker-compose.yml
Created February 1, 2021 19:14
Docker compose for running GlitchTip with persistent PostgreSQL
version: "3.4"
x-environment: &default-environment
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
SECRET_KEY: your-secret-here
PORT: 8000
GLITCHTIP_DOMAIN: https://glitchtip.yourcompany.com
EMAIL_URL: smtp+tls://smtp-user:smtp-password@email-smtp.eu-west-1.amazonaws.com:587
DEFAULT_FROM_EMAIL: glitchtip@yourcompany.com
ENABLE_OPEN_USER_REGISTRATION: "True"
x-depends_on: &default-depends_on
@icebob
icebob / k3s_helm_install.sh
Last active August 15, 2025 08:47
K3S + Helm installing
# Install K3S
curl -sfL https://get.k3s.io | sh -
# Copy k3s config
mkdir $HOME/.kube
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
sudo chmod 644 $HOME/.kube/config
# Check K3S
kubectl get pods -n kube-system
@magickatt
magickatt / github_clone_using_token.sh
Created September 6, 2019 17:31
Clone a GitHub repository using a Personal Access Token
export GITHUB_USER=magickatt
export GITHUB_TOKEN=secret
export GITHUB_REPOSITORY=magickatt/ContainerisingLegacyApplicationsTalk
git clone https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
@sergeyklay
sergeyklay / journalctl-cheatsheet.md
Last active October 31, 2025 12:59
Journalctl Cheat Sheet

Journalctl Cheat Sheet

Configuration

Permissions

To see messages from other users and the system as well as performing various log operations from a regular user add it to the group:

sudo usermod -aG systemd-journal $USER
@roommen
roommen / OpenSSH Update Script - Amazon Linux 2
Last active November 17, 2024 09:36
OpenSSH Update Script - Amazon Linux 2
#!/bin/bash
sudo yum install gcc -y
sudo yum install openssl-devel -y
sudo yum install zlib-devel -y
sudo yum install mlocate -y
sudo yum install autoconf -y
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.1p1.tar.gz
tar zxvf openssh-9.1p1.tar.gz
cd openssh-9.1p1 && ./configure && make && sudo make install
@basoro
basoro / proxmox-proxy
Created May 25, 2019 20:45
Running Proxmox behind a single IP address
I ran into the battle of running all of my VMs and the host node under a single public IP address. Luckily, the host is just pure Debian, and ships with iptables.
What needs to be done is essentially to run all the VMs on a private internal network. Outbound internet access is done via NAT. Inbound access is via port forwarding.
Network configuration
Here’s how it’s done:
Create a virtual interface that serves as the gateway for your VMs: