Skip to content

Instantly share code, notes, and snippets.

View floweb's full-sized avatar

Florian Le Frioux floweb

  • Seldon Finance
  • Basusarri, Euskal Herria, France
View GitHub Profile
@rdkls
rdkls / tfsec-json-to-gitlab-sast-report.py
Last active September 6, 2023 18:52
python script to convert tfsec json output into gitlab sast report, will get parsed by gitlab and result in vulnerabilities being visible/manageable in gitlab vuln management interface
#!/usr/bin/env python3
import sys
import datetime
import json
import uuid
'''
# Description
Convert tfsec json output to gitlab sast json format
TFSec https://github.com/aquasecurity/tfsec
@floweb
floweb / 🎵 My Spotify Top Tracks
Last active August 7, 2024 16:09
spotify-box
Gans Media Retro Games Hot Mulligan
Wonder Cheese Xavier Dang
Shhhh! Golf is On Hot Mulligan
This Is Why Paramore
Shhhh! Golf is On Hot Mulligan
BCKYRD - Acoustic Hot Mulligan
Black Hole Be Your Own Pet
Heem Wasn't There Hot Mulligan
BCKYRD Hot Mulligan
À la renverse Intenable
@nymous
nymous / README.md
Last active September 13, 2024 17:37
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

@maxandersen
maxandersen / Dockerfile
Last active April 27, 2022 11:06
This is a standalone dockerfile with embedded java and using jbang for building as answer to https://twitter.com/jordisola_/status/1517244462673674240?s=20 Try out using: `docker build -t myapp . && docker run -p 8080:8080 myapp`
# syntax=docker/dockerfile:1.4
FROM jbangdev/jbang-action as builder
WORKDIR /
COPY <<EOF main.java
//DEPS io.quarkus:quarkus-bom:2.8.0.Final@pom
//DEPS io.quarkus:quarkus-resteasy-reactive
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
@xgp
xgp / Dockerfile
Last active August 12, 2024 17:56
Keycloak 17 example using JGroups JDBC_PING discovery protocol for Infinispan
FROM quay.io/keycloak/keycloak:17.0.0 as builder
ENV KC_METRICS_ENABLED=true
ENV KC_FEATURES=preview
ENV KC_DB=postgres
ENV KC_HTTP_RELATIVE_PATH=/auth
# specify the custom cache config file here
ENV KC_CACHE_CONFIG_FILE=cache-ispn-jdbc-ping.xml
# copy the custom cache config file into the keycloak conf dir
@scyto
scyto / docker-swarm-architecture.md
Last active September 12, 2024 15:15
My Docker Swarm Architecture
@SwitHak
SwitHak / 20211210-TLP-WHITE_LOG4J.md
Last active September 9, 2024 14:28
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-20 2238 UTC

Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)

Errors, typos, something to say ?

  • If you want to add a link, comment or send it to me
  • Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak

Other great resources

  • Royce Williams list sorted by vendors responses Royce List
  • Very detailed list NCSC-NL
  • The list maintained by U.S. Cybersecurity and Infrastructure Security Agency: CISA List
@kjmph
kjmph / A_UUID_v7_for_Postgres.sql
Last active September 10, 2024 09:55
Postgres PL/pgSQL function for UUID v7 and a bonus custom UUID v8 to support microsecond precision as well. Read more here: https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
create or replace function uuid_generate_v7()
returns uuid
as $$
begin
-- use random v4 uuid as starting point (which has the same variant we need)
-- then overlay timestamp
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string
return encode(