🐧 Swap File

# Linux Swap Configuration Guide for EC2 Instances

## What is Swap?

**Swap** is disk space that the Linux kernel uses as virtual memory when physical RAM is full. Think of it as an overflow area for memory.

**How it works:**
1. When RAM fills up, Linux moves rarely-used memory pages to swap
2. Frees up RAM for active processes
3. If a swapped-out page is needed, Linux reads it back from disk (slow but prevents crashes)

**Trade-off:** Swap is 100-1000x slower than RAM, but prevents

👁️ Notebook LM - Questions

# NotebookLM - Questions Pièges & Réponses pour Présentation Finance

## 🔒 SÉCURITÉ & CONFIDENTIALITÉ

### Q1 : "Si on met des données sensibles dans NotebookLM, sont-elles utilisées pour entraîner l'IA ?"

**Réponse courte :**
Cela dépend de la version utilisée.

**Réponse détaillée :**

| Version | Training IA | Revue humaine | Verdict |
|---------|-------------|---------------|---------|
| **Free** | ❌ Non | ⚠️ Si feedback donné | ❌ Proscrire pour données sensibles |
| **Plus** 

👁️ Notebook LM - Prompt Templating

# Templates NotebookLM - Audio/Video Overviews

## Structure d'un bon prompt

```
[LANGUE]
[AUDIENCE]
[OBJECTIF]
[FOCUS/INCLURE]
[EXCLURE]
[TON]
[DURÉE]
[STRUCTURE]
```

---

## 📊 TEMPLATE 1 : Briefing Exécutif (5min)

### Use case
Présenter un sujet technique à la direction

### Instructions
```
Language: French
Target audience: C-level executives, board members, non-technical stakeholders
Goal: Enable strategic decision-making on [TOPIC]
Focus on: 
- Business impact

👁️ Notebook LM - Limites

# NotebookLM - Jour 1 Matinée : Tester les Limites

## 📋 Vue d'ensemble (09h-10h30)

**Objectif** : Comprendre quand NotebookLM excelle et quand il atteint ses limites

---

## 1️⃣ Versions NotebookLM - Comparatif

| Critère | **Free** | **Plus** | **Enterprise** |
|---------|----------|----------|----------------|
| **Prix** | Gratuit | $14-22/mois (Workspace)<br>$20/mois (Google One AI Premium) | Sur devis |
| **Notebooks** | 20 | 100 | Illimité |
| **Sources/notebook** | 50 | 30

⚖️ DORA

# DORA - Digital Operational Resilience Act

## Définition
Règlement européen entré en vigueur le **17 janvier 2025** pour renforcer la résilience numérique du secteur financier.

## Objectifs
- Garantir que les institutions financières peuvent **résister, répondre et se remettre** de perturbations ICT (cyber-attaques, pannes systèmes)
- Harmoniser les règles de cybersécurité dans l'UE
- Superviser les fournisseurs IT critiques du secteur financier

## Qui est concerné ?
- Banques
- 

Database Schema for PC Repair

Includes service schedules, work orders, billing and invoices
-- Create database
CREATE DATABASE pc_repair_service;
USE pc_repair_service;

-- Customers table
CREATE TABLE customers (
    customer_id INT AUTO_INCREMENT PRIMARY KEY,
    full_name VARCHAR(100) NOT NULL,
    email VARCHAR(100) UNIQUE,
    phone VARCHAR(20),
    address TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Devices table
CREATE TABLE devices (
    device_id INT AUTO_INCREMENT PRIMARY KEY,
    customer_id INT NOT NULL,
    device_type VARCHAR(50),   -- e.g., Laptop, De

417. Pacific Atlantic Water Flow

There is an m x n rectangular island that borders both the Pacific Ocean and Atlantic Ocean. The Pacific Ocean touches the island's left and top edges, and the Atlantic Ocean touches the island's right and bottom edges. The island is partitioned into a grid of square cells. You are given an m x n integer matrix heights where heights[r][c] represents the height above sea level of the cell at coordinate (r, c). The island receives a lot of rain, and the rain water can flow to neighboring cells directly north, south, east, and west if the neighboring cell's height is less than or equal to the current cell's height. Water can flow from any cell adjacent to an ocean into the ocean. Return a 2D list of grid coordinates result where result[i] = [ri, ci] denotes that rain water can flow from cell (ri, ci) to both the Pacific and Atlantic oceans.
/**
 * Given a matrix of heights, returns coordinates of cells that can flow to both the Pacific and Atlantic oceans.
 * Pacific touches the left and top edges; Atlantic touches the right and bottom edges.
 * @param {number[][]} heights - 2D grid of elevation values
 * @return {number[][]} - List of coordinates [i, j] that can reach both oceans
 */
var pacificAtlantic = function(heights) {
    let row = heights.length;
    let col = heights[0].length;
    let arr = []; // Stores final result: ce

C1 U5

grasp - physical or mental. If mental, difference between understand/catch on to sth.
  used mostly as "physical"
diminutive - use with comparison. Business, academic language
resent
go to work
partially

Fetch API with FormData

### **1. Sending Form Data with Fetch (FormData object)**

If you already have a `<form>` element in HTML:

```html
<form id="myForm">
  <input type="text" name="username" placeholder="Enter username">
  <input type="email" name="email" placeholder="Enter email">
  <button type="submit">Submit</button>
</form>
```

You can submit it with JavaScript:

```javascript
document.getElementById('myForm').addEventListener('submit', async function (e) {
  e.preventDefault(); // prevent default form submi

Fetch API with PHP Backend Example

# Fetch API Usage

1. Handling `FormData` (`multipart/form-data`)
2. Handling JSON (`application/json`)

---

## **1. PHP Backend for FormData (multipart/form-data)**

If you send data using `FormData`, the browser automatically sends it as `multipart/form-data`.

Example Fetch:

```javascript
const formData = new FormData();
formData.append("username", "Ryan");
formData.append("email", "test@example.com");

fetch("process.php", {
  method: "POST",
  body: formData
});
```

PHP (`process.php`):

Javascript DOM Manipulation Reference

## 📝 JavaScript DOM Manipulation Cheat Sheet

### 🔍 Selecting Elements

```js
document.getElementById("id");              // By ID
document.getElementsByClassName("class");   // By class (HTMLCollection)
document.getElementsByTagName("tag");       // By tag
document.querySelector("cssSelector");      // First match
document.querySelectorAll("cssSelector");   // All matches (NodeList)
```

---

### ✏️ Changing Content

```js
element.textContent = "Hello World";   // Text only
element.innerHTML = 

Javascript Form Events Quick Reference

### 🔹 **JavaScript Form Events Reference**

| **Event**    | **Description**                                                                                 | **Typical Use**                                     |
| ------------ | ----------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| **submit**   | Fired when a form is submitted.                                                                 | Val

PHP Database CRUD with Automatic Query Building

# Install phpdotenv Using Composer ```php composer require vlucas/phpdotenv ```
<?php
require __DIR__ . '/vendor/autoload.php';

use Dotenv\Dotenv;

class Database {
    private $pdo;
    private static $instance = null;

    private function __construct() {
        // Load .env
        $dotenv = Dotenv::createImmutable(__DIR__);
        $dotenv->load();

        $host    = $_ENV['DB_HOST'];
        $db      = $_ENV['DB_NAME'];
        $user    = $_ENV['DB_USER'];
        $pass    = $_ENV['DB_PASS'];
        $charset = $_ENV['DB_CHARSET'] ?? 'utf8mb4';

        $dsn = "mysq

11. Container With Most Water

You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines that together with the x-axis form a container, such that the container contains the most water. Return the maximum amount of water a container can store. Notice that you may not slant the container.
/**
 * @param {number[]} height
 * @return {number}
 */
var maxArea = function(height) {
    // Initialize two pointers: one at the start, one at the end of the array
    let left = 0;
    let right = height.length - 1;

    // Variable to keep track of the maximum area found so far
    let maxArea = 0;

    // Loop until the two pointers meet
    while (left < right) {
        // Calculate the width between the two lines
        let width = right - left;

        // Calculate the height of the 

Openshift Cheatsheet

# Openshift Cheatsheet

## Work with projects (Kubernetes namespaces)

1) Run `oc get project` to get all projects.
2) Run `oc project [project-name]` to change project.

## Create an application from a container image
 * `oc new-app [image-path]`: Create an application
 * `oc expose service/[app-name]`: Create a route to expose access to the application.
 
## Get the application’s Kubernetes label and Delete resources
 * `oc get deployment --show-labels`: The result should be as below and the l

US States Array

<?php
$states = array(
    'AL' => 'Alabama',
    'AK' => 'Alaska',
    'AZ' => 'Arizona',
    'AR' => 'Arkansas',
    'CA' => 'California',
    'CO' => 'Colorado',
    'CT' => 'Connecticut',
    'DE' => 'Delaware',
    'FL' => 'Florida',
    'GA' => 'Georgia',
    'HI' => 'Hawaii',
    'ID' => 'Idaho',
    'IL' => 'Illinois',
    'IN' => 'Indiana',
    'IA' => 'Iowa',
    'KS' => 'Kansas',
    'KY' => 'Kentucky',
    'LA' => 'Louisiana',
    'ME' => 'Maine',
    'MD' => 'Maryland',
    'MA' =>