Skip to content

Instantly share code, notes, and snippets.

View lpenaud's full-sized avatar
💻
Working

Loïc Penaud lpenaud

💻
Working
View GitHub Profile
@lpenaud
lpenaud / README.md
Created July 29, 2025 09:09
Transfère de fichier SSH

Transfère de fichier SSH

Vous voulez transférer des fichiers sur un serveur à distance dont vous avez un accès SSH mais sans SFTP, SCP ou rsync fonctionnel ? Alors j'ai la solution la plomberie.

Par contre ce n'est absolument pas propre à ne pas faire en production.

Teeing

tee est une commande qui permet de d'écrire dans des fichiers ce qui lis depuis son entrée standard stdin.

@lpenaud
lpenaud / mediainfo.md
Created March 7, 2025 18:54
Mediainfo

Mediainfo

Mediainfo comes in handy for printing information from media files; however, some features, like --Output, are poorly documented or unclear.

Human readable tracklist

mediainfo --Output="General;%Track/Position%. %Title% - %Duration/String%\n" *.flac
@lpenaud
lpenaud / exemples.md
Last active September 16, 2025 12:56
GNU / Linux

Lister les processus qui écoute un port en particulier

sudo lsof -i :80

Récupérer l'identifiant du processus qui écoute un port donné

@lpenaud
lpenaud / README.md
Last active October 22, 2025 10:16
Jellyfin backup

Backup

The data and config directories can be modify by automatic migration.

  • data directory with all SQLite dbs
  • config directory

The upgrade from v10.11.0 break my instance. Why? Because it availaible on APT without warning. My first thought was, "It will be easy like all times" but no, because there are some major changes to this one. Furthemore, it was too late in the evening, to so I didn't sleep well 😴.

@lpenaud
lpenaud / xml.ts
Last active January 22, 2025 17:42
XmlTransformStream
export interface TreeXmlNode {
name: string;
content: string;
children: TreeXmlNode[];
}
export interface XmlMark {
name: string;
content: string;
type: symbol;
@lpenaud
lpenaud / AllOfFutureHelpers.md
Last active December 4, 2024 14:18
AllOfFuturesHelpers

All of futures

Create futures from list and function.

Usage

final var list = List.of('A', 'B', 'C');
AllOfFutureHelpers.<> builder()
 .function(e -&gt; someIOFunction(e))
@lpenaud
lpenaud / ArrayMatcherAnswer.java
Created November 14, 2024 13:42
Multi-Answer Mockito
import java.util.LinkedList;
import java.util.List;
import org.mockito.ArgumentMatcher;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import lombok.AllArgsConstructor;
import lombok.Setter;
@lpenaud
lpenaud / HashMap.md
Created October 15, 2024 13:52
HashMap number mapping

From number of mapping

Java 19 add newHashMap(int) to HashMap and LinkedHashMap.

See: Java doc HashMap

Calculate capacity from load factory

private static final short DEFAULT_LOAD_FACTOR = .75;
@lpenaud
lpenaud / Split-cue.md
Created October 8, 2024 19:18
Split cue file

Split cue file to flac tracks

Dependencies

  • flac
  • shnsplit
  • file

Optional dependencies

@lpenaud
lpenaud / rsync-english.md
Last active February 25, 2025 09:00
Backup files

Backup files with rsync

Incremental backup

rsync -a --delete -Pau INDIR [INDIRS...] OUTDIR
  • -a: Archive mode copy the access rights.
  • --delete: Remove files if there aren't in the source directory anymore.