Skip to content

Instantly share code, notes, and snippets.

View bhubr's full-sized avatar

Benoît Hubert bhubr

View GitHub Profile
@bhubr
bhubr / README.md
Last active June 29, 2022 07:46
Atelier Docker - CI/CD

Atelier Docker et CI/CD

Rappels sur Docker

Docker est une plate-forme permettant de lancer des applications dans des conteneurs.

Selon 451 Research, cité par Wikipedia :

Docker est un outil qui peut empaqueter une application et ses dépendances dans un conteneur isolé, qui pourra être exécuté sur n'importe quel serveur

@bhubr
bhubr / about.md
Last active June 5, 2022 07:28
Run a dummy Node.js server in Docker

Run a dummy Node.js server in Docker

TL;DR

The command: curl -L -o- http://bit.do/node-hello-docker | bash

After it's run you can open http://localhost:3333

Why?

@bhubr
bhubr / net-wsl2.md
Created May 27, 2022 21:18
Access server inside WSL2 from local network
@bhubr
bhubr / README.md
Last active May 23, 2022 09:09
Sujet algo brute-force JWT

JWT Crack

Precision : si vous faites un console.log du resultat, cela peut prendre longtemps.

Vous aurez surement interet a ecrire ce resultat dans un fichier. Pour cela, vous pouvez utiliser fs.writeFileSync de la bibliotheque standard de Node.js (convertir votre tableau de sortie en JSON car writeFileSync permet d'ecrire des strings, pas n'importe quel objet...)

const characters = [
  'a',
 'b',
@bhubr
bhubr / Ressources-native.md
Last active March 14, 2022 20:14
Ressources React Native
@bhubr
bhubr / Vagrantfile
Last active February 28, 2022 13:02
ecosystem.config.js sample for TypeScript Node.js server (without deploy)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Define VMs with static private IP addresses, vcpu, memory and vagrant-box.
boxes = [
{
:box => "debian/bullseye64",
:name => "managed-host1",
:ram => 1024,
@bhubr
bhubr / angular-pokedex.md
Last active January 31, 2022 11:08
Sujet synthèse-éval Pokémon

Angular Pokédex

  1. Créer le squelette de l'application que vous allez appeler angular-pokedex.

  2. Vous placer dans ce dossier (cd angular-pokedex) et lancer l'application

  3. Vous aurez besoin de différents composants :

    • pokemon-list -> liste des pokémons
    • pokemon-card -> afficher un pokémon : son nom
  4. Pour "remplir" votre application et pouvoir afficher quelque chose, vous n'allez pas directement faire des requêtes API. On avait directement écrit un tableau dans le composant. Voir "échantillon de données"

  5. Vous aurez besoin d'une fonction pour récupérer l'image d'un Pokémon, par rapport à son URL. Comme elle repose sur la notion relativement avancée de "regex" (expression rationnelle en français), elle vous est fournie : voir "obtenir l'image".

@bhubr
bhubr / docker.md
Last active May 29, 2022 09:28
Récap commandes Docker

Récap commandes Docker

Récupérer une image depuis le Docker Hub

On peut "pull" une image depuis le registre Docker, un peu comme on "pull" du code depuis GitHub :

docker pull hello-world
@bhubr
bhubr / exemple-bind.html
Last active February 8, 2022 13:36
Angular M1 CP IL - 7 janvier 2022
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JavaScript Bind</title>
</head>
<body>
@bhubr
bhubr / README.md
Created December 29, 2021 00:00
Prepare USB pendrive and burn MacOS installer

Run sudo diskutil list to get a list of drives. On my setup, I got this as part of the output:

/dev/disk2 (external, physical):
  #:                       TYPE NAME                    SIZE       IDENTIFIER
  0:     FDisk_partition_scheme                        *15.9 GB    disk2
  1:             Windows_FAT_32 ESD-USB                 15.9 GB    disk2s1

Since my USB pendrive is /dev/disk2, I can repartition it as HFS+ like so:

sudo diskutil partitionDisk /dev/disk2 GPT hfs+ InstallMojave "100%"