Skip to content

Instantly share code, notes, and snippets.

View gmolveau's full-sized avatar

Grégoire MOLVEAU gmolveau

View GitHub Profile
@gmolveau
gmolveau / lsiown.sh
Created April 5, 2024 21:46
linuxserver.io lsiown script (extracted with `docker run --rm -it ghcr.io/linuxserver/baseimage-ubuntu:jammy cat /usr/bin/lsiown`)
#!/bin/bash
MAXDEPTH=("-maxdepth" "0")
OPTIONS=()
while getopts RcfvhHLP OPTION
do
if [[ "${OPTION}" != "?" && "${OPTION}" != "R" ]]; then
OPTIONS+=("-${OPTION}")
fi
if [[ "${OPTION}" = "R" ]]; then
@gmolveau
gmolveau / cv_resume_explaining_roles_experiences.md
Last active February 20, 2024 07:53
CV/Resume - explaining your tech experiences

Different kind of roles

  1. implementer

Details : you were told how to fix a problem, and you did as told

Moved deployment from manually-managed hosts to a new Kubernetes cluster.

  1. solver + implementer
@gmolveau
gmolveau / compose.yml
Last active February 7, 2024 12:32
docker compose traefik dns resolving inter containers
version: "3.3"
services:
traefik:
image: "traefik:v3.0"
container_name: "traefik"
command:
#- "--log.level=DEBUG"
- "--api.dashboard=true"
- "--ping=true"
@gmolveau
gmolveau / envsubst.sh
Last active February 5, 2024 17:12
envsubst alternative in pure bash - replace prefixed environment variables (eg. ${XX_MYVAR}) in a text file
#!/bin/bash
usage() {
echo "Usage: $0 [OPTIONS] [file_path]"
echo "OPTIONS:"
echo " -p, --prefix PREFIX Specify the prefix for environment variables"
echo " -h, --help Show this help message"
echo "If no file_path is provided, the script reads from stdin."
exit 1
}
@gmolveau
gmolveau / dvd_logo_bouncing.html
Created October 7, 2023 06:02
DVD logo bouncing corners changing colors in responsive portable HTML
<html>
<head>
<title>Bouncing DVD Logo</title>
<style>
* {margin:0; padding: 0; color:red;}
</style>
</head>
<body>
<canvas id="tv-screen"></canvas>
@gmolveau
gmolveau / finder_macos_new_text_file_automator.md
Last active September 11, 2023 18:56
Create a new text file in the finder with Automator and Quick Action
  • open automator
  • create new quick action
  • workflow received no input in Finder.app
  • search run apple script and double-click on it
  • replace code with :
tell application "Finder"
    set txt to make new file at (the target of the front window) as alias with properties {name:"newfile.txt"}
 select txt
#!/usr/bin/env bash
# Bash3 Boilerplate. Copyright (c) 2014, kvz.io
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
# Set magic variables for current file & dir
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
{
"profiles": {
"__Default_Settings__": {
"removeHiddenElements": true,
"removeUnusedStyles": true,
"removeUnusedFonts": true,
"removeFrames": true,
"removeImports": true,
"compressHTML": true,
"compressCSS": true,
@gmolveau
gmolveau / bash_multiple_commands_parallel.sh
Created July 8, 2023 11:27
bash run multiple commands in parallel
# source : https://stackoverflow.com/a/52033580
# the wait allows COMMAND2 to finish before COMMAND1
# the trap allows the user to kill all the commands with one control-c
(trap 'kill 0' SIGINT; COMMAND1 & COMMAND2 & wait)
@gmolveau
gmolveau / postman_install_without_snap.sh
Created June 14, 2023 13:42
Postman ubuntu install without snap
# ubuntu install Postman without snap
DOWNLOAD_PATH="${HOME}/Downloads"
POSTMAN_FILENAME="postman-linux-x64.tar.gz"
POSTMAN_DOWNLOAD_PATH="${DOWNLOAD_PATH}/${POSTMAN_FILENAME}"
POSTMAN_URL="https://dl.pstmn.io/download/latest/linux_64"
wget -c "${POSTMAN_URL}" -O "${POSTMAN_DOWNLOAD_PATH}"
sudo rm -rf /opt/Postman/