Skip to content

Instantly share code, notes, and snippets.

View lktslionel's full-sized avatar
👨‍💻

Lionel LONKAP TSAMBA lktslionel

👨‍💻
View GitHub Profile
@lktslionel
lktslionel / openssl-cheat.sh
Created November 18, 2022 20:13 — forked from alvarow/openssl-cheat.sh
OpenSSL and Keytool cheat sheet
# Generate a new key
openssl genrsa -out server.key 2048
# Generate a new CSR
openssl req -sha256 -new -key server.key -out server.csr
# Check certificate against CA
openssl verify -verbose -CApath ./CA/ -CAfile ./CA/cacert.pem cert.pem
# Self Signed
@lktslionel
lktslionel / GitHub Actions Packaging & Auto-Discovery.md
Last active January 9, 2023 10:08
Packaging & Auto-discovery of docker-based GitHub Actions using GitHub CLI

Docker-based GitHub Actions Packaging & Discovery

What if we can use GitHub Container Registry as a GitHub Action Registry (which is missing at the moment). This entails using the GitHub CLI to package a docker-based GitHub Actions and publish the action image with everything necessary to make it discoverable by the GitHub Workflow Engine.


Contents

@lktslionel
lktslionel / mithril.guide.md
Last active March 29, 2022 11:46 — forked from StephanHoyer/gist:bddccd9e159828867d2a
Isomorphic applications with mithril

Attention

This post described how to create an application with mithril 0.2.x. Now that ver 1.0 is out, some things are a little differnent.

The example is updated with the current version of mithril, though.

Isomorphic applications with mithril

@lktslionel
lktslionel / algorith-morphing.py
Last active March 2, 2022 12:24
Carole Morphing
#
# ALGORITHM
#
#
# Function to handle image
#
# 1. load_image("/checmi/vers/fichier") -> np.darray (image)
# 2. move_image(image: np.darray, (dy: int, dx: int)) -> np.darray (image)
export let errorRate = new Rate("errors");
export default function() {
let res = http.get("https://httpbin.org/status/200,400")
let requestTimedout = check(res, {"exceeds timeout of 1500ms": (r) => r.timings.duration < 1500});
let requestTimedout = !(checkRequestSucceeded)
if (requestTimedout) {
@lktslionel
lktslionel / retry-exponentail-backoff.py
Created December 16, 2021 22:27
Exponential BackOff implemented in python
import time
DEFAULT_TIMEOUT_IN_SEC = 1
DEFAULT_MAX_ATTEMPTS = 5
def retry(**kwargs):
def inner(func):
attempt = 0
max_attempts = kwargs["attempts"] if kwargs["attempts"] else DEFAULT_MAX_ATTEMPTS
@lktslionel
lktslionel / find-xargs-cmd.sh
Created June 10, 2021 09:15
[TIP] Make redirection after running a `find` followed by a `xargs` command
find src/modules \
-type d\
-not -path src/modules\
-print0 \
| $_XARGS_CMD -I module bash -c 'terraform-docs markdown "module" > "module"/README.md'
Check $?
color:
interactive-color:
background-color:
text-color:
font:
family:
size:
line-height:
typography:
border:
@lktslionel
lktslionel / Git workflow playground.md
Last active March 29, 2021 22:04
Git workflow playground

Git workflow playground

# Brnach courante
CURR_BRANCH=$(git rev-parse --abbrev-ref HEAD)

# Go to develop
git checkout develop
@lktslionel
lktslionel / bash_flock.sh
Created March 12, 2021 08:18 — forked from jpclipffel/bash_flock.sh
Bash flock example
#!/bin/bash
#
# Bash `flock` example.
# Works on: Linux, BSD
# Doesn't work on: MacOS
# The file which represent the lock.
LOCKFILE="`basename $0`.lock"
# Timeout in seconds.