Skip to content

Commit 642da67

Browse files
committed
feat: antisèches groupées dans leur propre section
1 parent 2659df0 commit 642da67

26 files changed

Lines changed: 405 additions & 233 deletions

.eleventy.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ export default function (eleventyConfig) {
5151
eleventyConfig.addCollection("blog", function (collectionApi) {
5252
return collectionApi.getFilteredByGlob(["blog/*.md", "blog/*.html"]);
5353
});
54-
54+
eleventyConfig.addCollection("antiseches", function (collectionApi) {
55+
return collectionApi.getFilteredByGlob(["antiseches/*.md", "antiseches/*.html"]);
56+
});
5557
eleventyConfig.addCollection("latestFewFinishedArticles", function (collectionApi) {
5658
return collectionApi.getFilteredByGlob(["blog/*.md", "blog/*.html"])
5759
.filter(item => !item.data.stub)
@@ -105,6 +107,7 @@ export default function (eleventyConfig) {
105107
])
106108
.flatMap(page => page.data.tags)))
107109
.filter(tag => tag !== undefined)
110+
.filter(tag => tag !== "all")
108111
.sort((a, b) => a.localeCompare(b));
109112

110113
});

_includes/antiseche.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
layout: layout.html
3+
---
4+
5+
<article>
6+
7+
<hgroup>
8+
<h1>Antisèche {{title}}</h1>
9+
</hgroup>
10+
{% if tags %}
11+
<ul class="tags">
12+
{% for tag in tags %}
13+
<li><a href="/tags/{{tag}}">{{tag}}</a></li>
14+
{% endfor %}
15+
</ul>
16+
{% endif %}
17+
<p lang="{{lang}}"> {{description}} </p>
18+
{{content}}
19+
</article>
20+
21+
<nav aria-label="Autres antisèches">
22+
<h2>Autres antisèches</h2>
23+
<ul class="antiseches-autres">
24+
{% for antiseche in collections.antiseches %}
25+
{% if antiseche.url != page.url %}
26+
<li><a href="{{antiseche.url}}">{{antiseche.data.title}}</a></li>
27+
{% endif %}
28+
{% endfor %}
29+
</ul>
30+
</nav>

_includes/default.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66

77
<h1>{{title}}</h1>
88

9-
{% if category %}
10-
{{ category }}
11-
{% endif %}
12-
139
{% if tags %}
1410
<ul class="tags">
1511
{% for tag in tags %}

_includes/layout.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<body>
1313
<header>
1414
<nav class="header-skip-content">
15-
<ul>
15+
<ul class="nav-menu">
1616
<li><a href="#content">Aller au contenu</a></li>
1717
<li><a href="#menu">Aller au menu</a></li>
1818
<li><a href="#search">Aller à la recherche</a></li>
@@ -64,11 +64,13 @@
6464
Voir cette page sur GitHub
6565
</a>
6666
<nav>
67-
<ul>
67+
<ul class="footer-links">
68+
<li><a href="/tags">Tags</a></li>
69+
<li><a href="/making-of">Making of</a></li>
70+
<li><a href="/antiseches">Antisèches</a></li>
71+
<li><a href="/externe/podcasts">Podcasts</a></li>
6872
<li><a href="/ai">AI</a></li>
6973
<li><a href="/labo">labo</a></li>
70-
<li><a href="/making-of">Making of</a></li>
71-
<li><a href="/externe/podcasts">Mes recommandations de podcast</a></li>
7274
</ul>
7375
</nav>
7476
</footer>

antiseches.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
layout: default.html
3+
title: Antisèches
4+
description: Références rapides sur des thématiques précises
5+
eleventyImport:
6+
collections: ["antiseches"]
7+
---
8+
9+
{% for antiseche in collections.antiseches %}
10+
- [{{antiseche.data.title}}]({{antiseche.url}})
11+
{% endfor %}
12+
13+

antiseches/antiseches.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"layout": "antiseche.html",
3+
"category": "Antisèches",
4+
"description": "",
5+
"tags": ["Antisèche","How-to","Cheat-sheet"]
6+
}

antiseches/bash.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Bash
3+
description: Référence rapide des choses que j’oublie quand j’utilise bash
4+
tags:
5+
- Bash
6+
permalink: antiseches/bash/
7+
---
8+
9+
## Commentaires sur multiligne
10+
11+
On peut mettre des commentaires sur des commandes bash multilignes en
12+
utilisant la substitution de commandes.
13+
14+
```bash
15+
# Converts video to mp3
16+
ffmpeg \
17+
-i "$1" \
18+
-vn `# discard video` \
19+
-ar 44100 `# audio sampling frequency 44100 Hz` \
20+
-ac 2 `# 2 audio channels` \
21+
-b:a 192k `# audio bitrate 192k` \
22+
"$1.mp3"
23+
```

antiseches/docker-compose.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Docker Compose
3+
date: 2025-01-25T18:25
4+
tags:
5+
- PostgreSQL
6+
- Docker
7+
permalink: antiseches/docker-compose/
8+
cover_image: /public/img/cover_images/docker.gif
9+
cover_image_alt: La mascotte Docker redessinée par mes soins
10+
---
11+
12+
```shell
13+
docker compose up -d
14+
docker compose up --build
15+
docker compose down
16+
docker compose down --rmi all --volumes
17+
```
18+
19+
## PostgreSQL
20+
21+
```yml
22+
version: '3.9'
23+
24+
services:
25+
26+
db:
27+
image: postgres
28+
restart: always
29+
environment:
30+
POSTGRES_PASSWORD: postgres
31+
POSTGRES_USER: postgres
32+
POSTGRES_DB: dev
33+
ports:
34+
- "5432:5432"
35+
36+
```
37+
38+

antiseches/ffmpeg.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Ffmpeg
3+
description: Petites astuces pour manipuler vidéo et son en ligne de commande
4+
tags:
5+
- Ffmpeg
6+
permalink: antiseches/ffmpeg/
7+
---
8+
9+
## Couper une vidéo
10+
11+
Couper une vidéo depuis le moment indiqué par `-ss` et jusqu'au moment indiqué par `-to`.
12+
En absence de `-to`, le flux est tronqué jusqu'à la fin de la vidéo.
13+
14+
```sh
15+
ffmpeg -i "2025-02-03 09-00-38.mkv" \
16+
-ss 00:00:00 \
17+
-to 3:33:40 \
18+
-codec copy \
19+
"2025-02-03 09-00-38-edited.mkv"
20+
```
21+
22+
- `-codec copy` pour copier le stream sans réencoder
23+
24+
## Réduire l'espace disque d'une vidéo
25+
26+
Ré-encoder une vidéo avec libx264, garder le son tel quel.
27+
En général la taille du fichier est considérablement réduite (env 5x moins par rapport à h264 (high)) pour une qualité similaire.
28+
Lors de la lecture, libx264 semble utiliser un peu plus de CPU (+4%).
29+
30+
```shell
31+
ffmpeg -i "2025-02-03_WOOP.mkv" \
32+
-map 0:v -map 0:a \
33+
-c:v libx264 -c:a copy \
34+
"2025-02-03_WOOP-libx264.mkv"
35+
```
36+
37+
Conversion en libx265. Réduit encore plus l'espace de stockage (presque 7x moins par rapport à h264 (high)). Requiert plus de CPU sur des machines plus anciennes.
38+
39+
```shell
40+
ffmpeg -i "2025-02-03_WOOP.mkv" \
41+
-map 0:v -map 0:a \
42+
-c:v libx265 -c:a copy \
43+
"2025-02-03_WOOP-libx265.mkv"
44+
```
45+
46+
## Changer l'échelle d'une vidéo
47+
48+
```shell
49+
ffmpeg -i "input.mov" \
50+
-filter:v scale=720:-1 \
51+
-c:a copy \
52+
"output.mov"
53+
```
54+
55+
## Changer le nombre d'images par seconde
56+
57+
```shell
58+
ffmpeg -i "input.mov" \
59+
-filter:v fps=30 \
60+
-c:a copy \
61+
"output.mov"
62+
```

antiseches/ghostty.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: "Ghostty"
3+
tags:
4+
- Ghostty
5+
- Ssh
6+
- Terminal
7+
permalink: antiseches/ghostty/
8+
---
9+
10+
## Envoyer les informations terminfo via SSH à une machine distante
11+
12+
Symptômes :
13+
- On ne peut pas utiliser des raccourcis comme `CTRL + L` pour vider l'écran
14+
- Message au login : `tput: unknown terminal "xterm-ghostty"`
15+
16+
Quand on utilise l'émulateur de terminal [ghostty](http://ghostty.org/).
17+
Très souvent, quand on se connecte à une machine distante via `ssh` on obtient le message :
18+
19+
```text
20+
tput: unknown terminal "xterm-ghostty"
21+
```
22+
23+
Ca signifie que la machine distante ne sait pas interpréter les informations qu'envoie ghossty.
24+
Ces informations (`terminfo`) permettent à ghossty d'indiquer à la machine distante ce qu'il est capable de faire.
25+
26+
Il est possible de configurer la machine distante pour qu'elle dispose de ces informations :
27+
28+
```sh
29+
infocmp -x | ssh YOUR-SERVER -- tic -x -
30+
# adapté à mon cas
31+
infocmp -x | ssh monuserdistant@urldemonserve.ur -- tic -x -
32+
infocmp -x | ssh mauricienne@10.0.0.17 -- tic -x -
33+
```
34+
35+
La commande `tic` peut donner l'avertissement suivante qu'on peut ignorer :
36+
```text
37+
"<stdin>", line 2, col 31, terminal 'xterm-ghostty': older tic versions may treat the description field as an alias
38+
```
39+
40+
L'information est enregistré dans la machine distante à l'emplacement suivant :
41+
`/usr/share/terminfo`
42+

0 commit comments

Comments
 (0)