WSL_GeneralTips

# WSL TIPS & TRICKS

## INSTALL
in cmd prompt / powershell as admin:
`wsl --install`
## GPU
-> [guide](https://joelognn.medium.com/installing-wsl2-pytorch-and-cuda-on-windows-11-65a739158d76)
## NETWORK
with tailscale installed my autogenerated config was erronous, no internet access ( DNS resolve issues)
Bit of a bitch at this stage ! doinga  fresh -reinstall

`sudo nano /etc/resolv.conf`\
add / correct the nameserver entry:\
`nameserver 8.8.8.8`

We would also want to stop automatic generation

2435. Paths in Matrix Whose Sum Is Divisible by K

You are given a 0-indexed m x n integer matrix grid and an integer k. You are currently at position (0, 0) and you want to reach position (m - 1, n - 1) moving only down or right. Return the number of paths where the sum of the elements on the path is divisible by k. Since the answer may be very large, return it modulo 109 + 7.
/**
 * @param {number[][]} grid
 * @param {number} k
 * @return {number}
 */
var numberOfPaths = function(grid, k) {
    const MOD = 1e9 + 7; // modulus for large answers
    const m = grid.length;      // number of rows
    const n = grid[0].length;   // number of columns
    
    // Initialize a 3D DP array:
    // dp[i][j][r] = number of ways to reach (i,j) with remainder r
    // Dimensions: m x n x k
    let dp = Array.from({ length: m }, () =>
        Array.from({ length: n }, () =>
      

Streamlit

import streamlit as st
from datetime import datetime
import time

from src.langchain_ext.document_loader import get_openai_api_key
from src.langchain_ext.prompts import get_chat_prompt
from src.langchain_ext.memory import get_memory
from src.langchain_ext.chains import get_chat_chain


# Page configuration
st.set_page_config(
    page_title="AI Chatbot",
    page_icon="🤖",
    layout="wide",
    initial_sidebar_state="expanded"
)

# Custom CSS for better UI
st.markdown("""
  

FastAPI

from fastapi import FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
from typing import Optional
import uvicorn

from src.langchain_ext.document_loader import get_openai_api_key
from src.langchain_ext.prompts import get_chat_prompt
from src.langchain_ext.memory import get_memory
from src.langchain_ext.chains import get_chat_chain


# Initialize FastAPI app
app = FastAPI(
    title="AI Chatbot API",
    description="API for co

UnitVZone – APK & Android Tools Reference Guide

A comprehensive reference for Android users, covering APK tutorials, safe download practices, and practical tech tips. Includes step-by-step guidance to help users [install apps safely](unitvzone.com), optimize device performance, and stay informed about the latest Android tools and updates.
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>UnitVZone — Tech Guides & APK Tutorials</title>
  <meta name="description" content="UnitVZone provides APK tutorials, safe downloads, and tech guides for Android devices.">
  <style>
    body {
      font-family: Arial, sans-serif;
      background: #0A1A2F;
      color: #fff;
      margin: 0;
      padding: 0;
      line-height: 1.6;
 

Jupyter Notes

# Jupyter Notebook Notes

## Différences entre `%` et `!`
C'est une distinction fondamentale qui sépare le bricoleur du développeur qui comprend son environnement d'exécution. Si vous confondez les deux, vous aurez des erreurs de chemin (path) ou d'installation de packages invisibles qui vous rendront fou.

Voici la différence technique brutale :

### 1\. Le `!` (Shell Escape) : Le Touriste

Le point d'exclamation dit au Notebook : **"Passe cette commande au système d'exploitation (Bash/Linux), 

restructure files into folders by year of file creation

# copy files into folders
find . -type f -exec bash -c 'mkdir -p "${1%/*}/$(date -r "$1" "+%Y")"; cp "$1" "${1%/*}/$(date -r "$1" "+%Y")/"' _ {} \;
# copy files with rsync to keep the file times 
find . -type f -exec bash -c 'mkdir -p "${1%/*}/$(date -r "$1" "+%Y")"; rsync -t "$1" "${1%/*}/$(date -r "$1" "+%Y")/"' _ {} \;

#move files into folders
find . -type f -exec bash -c 'mkdir -p "${1%/*}/$(date -r "$1" "+%Y")"; mv "$1" "${1%/*}/$(date -r "$1" "+%Y")/"' _ {} \;

Redirect path checker

Ayima Redirect Path: https://chromewebstore.google.com/detail/redirect-path/aomidfkchockcldhbkggjokdkkebmdll?hl=en

Shopify product url parameters

- _pos: This parameter indicates the position of the search result within the overall search listing. In your example, _pos=2 suggests that the particular search result is the second item in the list.
- _sid: This parameter is a unique identifier for the search session. It helps Shopify track the specific search session and the related actions taken by the user.
- _ss: This parameter represents the source of the search query. It provides information about how the search was initiated, such as th

Restore-CBSComponentRegistry

DISM may exit with error code 2 and the CBS.log file contains ```STATUS_OBJECT_NAME_NOT_FOUND``` errors. ```2025-11-26 08:10:43, Error CSI 00000008 (F) STATUS_OBJECT_NAME_NOT_FOUND #3055437# from Windows::Rtl::SystemImplementation::DirectRegistryProvider::SysOpenKey(flg = 0, key = {provider=NULL, handle=0, name= ("null")}, da = (KEY_READ|KEY_WOW64_64KEY), oa = @0xe0a97fb120->OBJECT_ATTRIBUTES {s:48; rd:NULL; on:[213]'\Registry\Machine\COMPONENTS\DerivedData\VersionedIndex\10.0.22621.6120 (WinBuild.160101.0800)\ComponentFamilies\wow64_microsoft-windows-i..-wow64-setupdll0010_31bf3856ad364e35_none_50f54432bcfb1c52\v!10.0.22621.1'; a:(OBJ_CASE_I[gle=0xd0000034]```
#region RegistryHive
function Mount-RegistryHive {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
        $KeyName
        ,
        [Parameter(Mandatory = $true, Position = 1, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
        $FileName
    )

    begin {
        Add-Type -Name LoadHive -NameSpace RegistryHelper -MemberDefinition @"

[DllImport("adva

Absinthe Opentelemetry Instrumentation

#!/usr/bin/env python3
"""
Apply OpenTelemetry instrumentation to Absinthe dependencies.
Faster and more reliable than shell scripts with complex regex patterns.
"""

import os
import sys
import subprocess
import re
from pathlib import Path


def apply_resolution_ex():
    """Apply patches to deps/absinthe/lib/absinthe/phase/document/execution/resolution.ex"""
    print("📝 Patching resolution.ex...")

    file_path = "deps/absinthe/lib/absinthe/phase/document/execution/resolution.ex"
    with op

main.py


def main():
    pass


if __name__ == '__main__':
    main()

cssで市松模様

<div class="pattern"></div>

HTTPリクエストヘッダーの長さがインフラで制御されている長さより長いと431エラーになる

https://hoge.com?q=ここに1万文字とか入ってくる場合

メールアドレスの長さは255文字までというバリデーションの根拠

RFC 3696 (メールアドレスの長さについて解説)
https://datatracker.ietf.org/doc/html/rfc3696
RFC 5321 (SMTP - Simple Mail Transfer Protocol)
https://datatracker.ietf.org/doc/html/rfc5321
RFC 5322 (メールアドレスのフォーマット定義)
https://datatracker.ietf.org/doc/html/rfc5322

DL3 Project - seen


tail -n+2 ${PRJ_DIR}/All_Identifiers_OCP_Data.csv | \
awk 'BEGIN { FS = OFS = "," }
           { if (seen[$2$3$4$5]=="") seen[$2$3$4$5]=$1 ;\
             print $1, seen[$2$3$4$5]}' > ${PRJ_DIR}/linkage/dedup/duplicate_map

Build a key out of 4 fields
key = $2$3$4$5
Check if this key has been seen before
if (seen[key] == "")
    seen[key] = $1
This means:
✔ If this exact combination of fields 2+3+4+5 has NOT been seen before
Store field1 as the first ID associated with this combination.
✔ If it