Skip to content

Instantly share code, notes, and snippets.

View atlasloewenherz's full-sized avatar

Yassine Elassad atlasloewenherz

  • Bonn
  • 00:28 (UTC +02:00)
View GitHub Profile
gitlab-rails console production
user = User.create(:username=>'root',:password=>'xXxXx',:password_confirmation=>'',:email=>'root@example.com',:name=>'root')
user.save!
#!/usr/bin/env python3
'''
always getting the most recent frame of a camera
================================================
Usage:
------
freshest_camera_frame.py
@atlasloewenherz
atlasloewenherz / README.md
Created October 12, 2023 00:07 — 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
@atlasloewenherz
atlasloewenherz / WireGuard-site-to-site.md
Created March 5, 2023 19:58
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

@atlasloewenherz
atlasloewenherz / docker-mirrorv1-config.yml
Created September 14, 2022 22:04 — forked from diablowu/docker-mirrorv1-config.yml
docker-mirrorv1-config.yml
# All other flavors inherit the `common' config snippet
common: &common
issue: '"docker-registry server"'
# Default log level is info
loglevel: _env:LOGLEVEL:info
# Enable debugging (additional informations in the output of the _ping endpoint)
debug: _env:DEBUG:true
# By default, the registry acts standalone (eg: doesn't query the index)
standalone: _env:STANDALONE:true
@atlasloewenherz
atlasloewenherz / readme.md
Created March 13, 2022 21:26 — forked from ubergesundheit/readme.md
systemd traefik.service

systemd Service Unit for Traefik

Adapted from caddy systemd Service Unit

The provided file should work with systemd version 219 or later. It might work with earlier versions. The easiest way to check your systemd version is to run systemctl --version.

Instructions

We will assume the following:

@atlasloewenherz
atlasloewenherz / create-cloud-template.sh
Created February 26, 2022 11:04 — forked from chriswayg/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
@atlasloewenherz
atlasloewenherz / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Created February 26, 2022 11:02 — forked from ptu/Ubuntu_Debian_Cloud_images_in_Proxmox.md
Ubuntu and Debian Cloud images in Proxmox
@atlasloewenherz
atlasloewenherz / blog20181001-01.cfg
Created January 10, 2022 22:02 — forked from haproxytechblog/blog20181001-01.cfg
Using HAProxy as an API Gateway, Part 1
frontend api_gateway
bind :443 ssl crt /etc/hapee-1.8/certs/cert.pem
acl PATH_cart path_beg -i /cart
acl PATH_catalog path_beg -i /catalog
use_backend be_cart if PATH_cart
use_backend be_catalog if PATH_catalog
backend be_cart
server s1 10.0.0.3:80
@atlasloewenherz
atlasloewenherz / 1_kubernetes_on_macOS.md
Created April 19, 2021 08:53 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites