Skip to content

Instantly share code, notes, and snippets.

View mikamboo's full-sized avatar
🏠
Working from home

Michaël P.O. mikamboo

🏠
Working from home
View GitHub Profile
@mikamboo
mikamboo / beautifulsoup_example.py
Created August 31, 2022 14:47
Exemple utilisation BeatifulSoup Python
import urllib.request
from bs4 import BeautifulSoup
with urllib.request.urlopen("http://www.monkooli.com") as url:
html_page = url.read()
soup = BeautifulSoup(html_page, "html.parser")
print(soup.head.meta)
@mikamboo
mikamboo / kube-nodejs-echo-header.yaml
Created April 20, 2022 13:01
Kubectl create nodejs app to echo headers
apiVersion: v1
kind: ConfigMap
metadata:
name: nodejs-app
labels:
app: nodejs-app
data:
server.js: |
const http = require("http");
const host = '0.0.0.0';
@mikamboo
mikamboo / KEYSTORE.md
Last active December 9, 2021 00:33
Keystore Private key CSR

Create Private key stored in Keystore

If the .keystore does not exist i will be created

keytool -genkey -keystore .keystore -validity 300 \
-storepass myKeypass -keypass myKeypass -dname "CN=MyKey-Name" -alias MY-CERTKEY -storetype pkcs12

NOTE: For java version 11+, store password and key password must be equals.

@mikamboo
mikamboo / server.js
Created September 29, 2021 17:54
NodeJS : Handler POST body using native http createServer
const http = require("http");
const { parse } = require("querystring");
const hostname = "0.0.0.0";
const port = 3000;
const server = http.createServer((req, res) => {
if (req.method === "POST") {
let body = "";
req.on("data", (chunk) => {
// convert Buffer to string
@mikamboo
mikamboo / README.md
Last active October 4, 2021 17:34
DevOps : Firebase hosting deploy using Gitlab-CI + Doppler secret maneger

Mettre en place un pipeline CI/CD avec Gitlab pour déployer un application web sur Firebase en utilisant Doppler pour gérer les secrets.

Pré-requis

  • Un projet Firebase actif
  • Un prjet sous Gitlab
  • Un compte sur Doppler

Step 1 : Get Firebase token + init project

@mikamboo
mikamboo / README.md
Last active March 21, 2024 15:44
JS : Display image in browser console

Function to display image in js console

Source : https://stackoverflow.com/a/47177899

console.image = function(url, size = 100) {
  const image = new Image();
  image.src = url;
  image.onload = function() {
 var style = [
@mikamboo
mikamboo / .gitlab-ci.yml
Created January 29, 2021 09:09 — forked from angeloreale/.gitlab-ci.yml
Dockerizing a Node.js and MongoDB app with CI/CD Pipelines on Gitlab for staging and production environments.
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
STAGE_CONTAINER: dev
PROD_CONTAINER: prod
DEV_FOLDER: /path/to/repo/dev
PROD_FOLDER: /path/to/repo/prod
@mikamboo
mikamboo / README.md
Last active August 14, 2023 11:05
Serve files using MiniIO + Ngrok

MinIO Object Storage + Ngrok HTTPS url

Create in less than 5 minutes an Object Storage with local files exposed via HTTPS public URL. In this tutorial I use Docker to quickly run MinIO server, and ngrok to easily share files from local machine without messing with DNS and firewall settings.

Summary in two commands:

docker run --rm -p 9000:9000 \
 -v /tmp/local-data:/data \
@mikamboo
mikamboo / 00-README.md
Last active January 3, 2024 23:10
CKA : Training

CKA : Training notes

K8S Architercture

K8S components

Controle plane (Master)

  1. kube apiserver
@mikamboo
mikamboo / README.md
Last active November 30, 2020 15:01
E2E Testing Solutions