Skip to content

Instantly share code, notes, and snippets.

View lktslionel's full-sized avatar
👨‍💻

Lionel LONKAP TSAMBA lktslionel

👨‍💻
View GitHub Profile
@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.
@lktslionel
lktslionel / bash_strict_mode.md
Created February 17, 2021 21:56 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o pipefail explanation

set -e, -u, -o pipefail

The "set" lines These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing. With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.

set -euo pipefail is short for:

set -e
set -u
@lktslionel
lktslionel / jq.md
Last active January 15, 2021 17:50
Tips and tricks with JQ

Transformations

// input.json
[
  {
    "label": "A",
    "value": "1"
  },
 {
@lktslionel
lktslionel / Set-LKDefaultWorkspace.md
Created January 14, 2021 11:57
Powershell Script to push to the gallery

Generating powershell script

PS> New-ScriptFileInfo -Path Set-LKDefaultWorkspace.ps1 -Description "Set my default project workspace"
PS> Get-Content Set-LKDefaultWorkspace.ps1

# <#PSScriptInfo
# 
# .VERSION 1.0
# 
@lktslionel
lktslionel / Makefile
Created November 21, 2020 21:33 — forked from prwhite/Makefile
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@lktslionel
lktslionel / AdvancedDistributedSystemDesignCourseNotes.md
Created October 2, 2020 00:02 — forked from craigtp/AdvancedDistributedSystemDesignCourseNotes.md
Notes on Udi Dahan's Advanced Distributed System Design Course

Advanced Distributed System Design Course - Udi Dahan

Notes by Craig Phillips

Fallacies of Distributed Computing

  • There are 11 fallacies of Distributed Computing:
    1. The network is reliable
    2. Latency isn’t a problem
    3. Bandwidth isn’t a problem
    4. The network is secure
  1. The topology won’t change
@lktslionel
lktslionel / Makefile
Created August 3, 2020 07:38 — forked from sighingnow/Makefile
Detect operating system in Makefile.
# Detect operating system in Makefile.
# Author: He Tao
# Date: 2015-05-30
OSFLAG :=
ifeq ($(OS),Windows_NT)
OSFLAG += -D WIN32
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
OSFLAG += -D AMD64
endif
@lktslionel
lktslionel / names.csv
Last active October 24, 2019 14:37
Simpson's character names
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 10.
Character ,Voiced by ,Description/role ,First appearance
Homer Simpson ,Dan Castellaneta ,"Husband of Marge; father of Bart, Lisa, and Maggie. ","""Good Night"" (The Simpsons shorts)"
Marge Simpson ,Julie Kavner ,"Wife of Homer; mother of Bart, Lisa, and Maggie. ","""Good Night"""
Bart Simpson ,Nancy Cartwright ,Oldest child and only son of Homer and Marge; brother of Lisa and Maggie. ,"""Good Night"""
Lisa Simpson ,Yeardley Smith ,Middle child and oldest daughter of Homer and Marge; sister of Bart and Maggie. ,"""Good Night"""
Maggie Simpson ,Various ,Youngest child (the baby) and daughter of Homer and Marge; sister of Bart and Lisa. ,"""Good Night"""
Akira ,"George Takei, Hank Azaria ",Waiter at The Happy Sumo; karate teacher. ,"""One Fish, Two Fish, Blowfish, Blue Fish"""
"Albright, Ms. ?Ms. Albright ",Tress MacNeille ,Sunday school teacher. ,"""The Telltale Head"""
"Amadopolis, Aristotle ","Jon Lovitz, Dan Castellaneta ",Owner of the Shelbyville Nuclear Power Plant. ,"""Homer Defined"""
"Atkins ?Atkins,
@lktslionel
lktslionel / How I Do PlantUML.md
Created September 30, 2019 08:02 — forked from jerieljan/How I Do PlantUML.md
PlantUML with Style -- How I do PlantUML

I use PlantUML a lot. It's what I use for drawing all sorts of diagrams and it's handy because of its easy markup (once you get used to it) while making things easy to maintain as projects grow (thanks to version control)

This gist details how I do my PlantUML workspace in a project.

  • The idea is to keep a globals directory for all diagrams to follow (like the "stylesheet" below) to keep things consistent.
  • The stylesheet.iuml file keeps the use of colors consistent through use of basic FOREGROUND, BACKGROUND and ACCENT colors.
  • The style-presets.iuml file defines these colors so you can make "presets" or "themes" out of them.
  • As stated in the stylesheet.iuml, you'll need the Roboto Condensed and Inconsolata fonts for these to work properly.
@lktslionel
lktslionel / sample.sh
Last active February 27, 2025 11:16
Shell Script Sample
#!/bin/bash
# --------------
# TIPS & TRICKS
# --------------
: '
---
- SECTION
---