Skip to content

Instantly share code, notes, and snippets.

View ludndev's full-sized avatar
💭
I may be slow to respond.

Judicaël AHYI ludndev

💭
I may be slow to respond.
View GitHub Profile
ludndev@server:~$ katana --document-root my-web-app
__ __ ______ ______ ______ __ __ ______
/\ \/ / /\ __ \ /\__ _\ /\ __ \ /\ "-.\ \ /\ __ \
\ \ _"-. \ \ __ \ \/_/\ \/ \ \ __ \ \ \ \-. \ \ \ __ \
\ \_\ \_\ \ \_\ \_\ \ \_\ \ \_\ \_\ \ \_\\"\_\ \ \_\ \_\
\/_/\/_/ \/_/\/_/ \/_/ \/_/\/_/ \/_/ \/_/ \/_/\/_/
Katana 0.1.0
Lightweight Web Server - Serving (Static) Content with Elegance
-------------------------------------------------------------------
[2025-10-14 13:16:52] [INFO] Server starting on http://0.0.0.0:8080
You are ChatGPT, a large language model based on the GPT-5 model and trained by OpenAI.
Knowledge cutoff: 2024-06
Current date: 2025-08-08
Image input capabilities: Enabled
Personality: v2
Do not reproduce song lyrics or any other copyrighted material, even if asked.
You're an insightful, encouraging assistant who combines meticulous clarity with genuine enthusiasm and gentle humor.
Supportive thoroughness: Patiently explain complex topics clearly and comprehensively.
Lighthearted interactions: Maintain friendly tone with subtle humor and warmth.
@ludndev
ludndev / millisecond-to-human-readable.util.ts
Created August 27, 2025 13:57
Converts milliseconds to a concise, human-readable time format (e.g., "1h 30m")
function msToHumanReadable(ms: number): string {
const seconds = Math.floor(ms / 1000) % 60;
const minutes = Math.floor(ms / 60000) % 60;
const hours = Math.floor(ms / 3600000) % 24;
const days = Math.floor(ms / 86400000);
const parts: string[] = [];
if (days > 0) parts.push(`${days}d`);
if (hours > 0) parts.push(`${hours}h`);
@ludndev
ludndev / architecture.md
Created August 26, 2025 11:00 — forked from LcsGa/architecture.md
Architecture angular

L'architecture du projet se découpe en deux grandes catégories :

  • L'application en elle-même ;
  • Des bibliothèques génériques (qui pourraient, en principe, être publiées sur npm).

Concentrons-nous sur l'application. Elle se découpe en trois modules principaux et un sous-module :

  • common
  • feature
  • feature/shared (le sous-module)
@ludndev
ludndev / archlinux-qemu-kvm.md
Created August 26, 2025 10:59 — forked from eujuliu/archlinux-qemu-kvm.md
QEMU-KVM Installation for Arch Linux

QEMU-KVM in Arch Linux

Check Virtualization Support

lscpu | grep -i Virtualization
  • VT-x for Intel
  • AMD-Vi for AMD

Ensure that your kernel includes KVM modules

@ludndev
ludndev / ANSI.md
Created August 26, 2025 10:56 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@ludndev
ludndev / prisma.ts
Created August 21, 2025 19:47 — forked from gamedevsam/prisma.ts
NestJS Prisma server with an extension to log all queries
import { Global, INestApplication, Injectable, Logger, Module, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
import { Prisma, PrismaClient } from '@prisma/client';
import { ITXClientDenyList } from '@prisma/client/runtime/library';
import { PRISMA_ORM_LOG_LEVEL, PRISMA_SQL_LOG_LEVEL } from '~/server_config';
export type PrismaTransaction = Omit<PrismaClient, ITXClientDenyList>;
const logger = new Logger('prisma');
export const logQueriesExtension = Prisma.defineExtension((client) => {
@ludndev
ludndev / prisma.service.ts
Created August 21, 2025 18:00
How to register extensions for this PrismaService ?
import { Injectable, OnModuleInit, OnModuleDestroy, Logger } from '@nestjs/common';
import { Prisma, PrismaClient } from '../../../../generated/prisma';
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
private readonly logger = new Logger(this.constructor.name);
constructor() {
super();
}

NestJs Winston Logger Config

  • add this to your main.ts
import { WINSTON_MODULE_NEST_PROVIDER } from 'nest-winston';


// in bootstrap function, right after 'const app = await NestFactory.create(AppModule);'
app.useLogger(app.get(WINSTON_MODULE_NEST_PROVIDER));
#!/bin/bash
# ------------------------------------------------------------------------------
# Script : start_hotspot.sh
# Description : Démarre un hotspot Wi-Fi en utilisant create_ap, tout en restant
# connecté à un autre réseau Wi-Fi (mode AP + STA).
# Distribution : Ubuntu 24.04 (nécessite que l’interface supporte le mode AP+STA)
# Auteur : Judicaël AHYI
# ------------------------------------------------------------------------------