Skip to content

Instantly share code, notes, and snippets.

@StudioEtrange
StudioEtrange / show-cron-jobs.sh
Created January 28, 2021 02:20 — forked from myshkin-uk/show-cron-jobs.sh
A bash script to list all cron tasks on a computer.
#!/bin/bash
# This script is designed to work only with recent bash implementations, not ash/dash etc.
# @file show-cron-jobs.sh
#
# published at:
# https://gist.github.com/myshkin-uk/d667116d3e2d689f23f18f6cd3c71107
#
# @NOTE DGC 2-Sep-2019
# There is one comment there that the script doesn't run as expected.
@StudioEtrange
StudioEtrange / inline_file_as_string_heredoc.sh
Created January 28, 2021 02:22
inject file inline to command with heredoc
# https://stackoverflow.com/a/38731052
# variable substitution, leading tab retained, overwrite file, echo to stdout
tee /path/to/file <<EOF
${variable}
EOF
# no variable substitution, leading tab retained, overwrite file, echo to stdout
@StudioEtrange
StudioEtrange / -PDF manipulation tools.md
Last active January 19, 2025 15:18
various pdf manipulation tools and tips

various tips and tools for pdf

@StudioEtrange
StudioEtrange / ssl_proxy_onion_demo.sh
Last active October 31, 2025 18:55
open an ssl proxy over ssh and add N layer of ssh/ssl to communication between a client and a server
#!/bin/bash
# Credits : anonymous
# Ouvrir un proxy SSL sur le port ssh
# IE avoir X couche de cryptage ssl + ssh
# Cf NBSSL nombre de couche SSL
# Execute sans parametre = Usage
cd `dirname $0`
@StudioEtrange
StudioEtrange / substitute_key_in_file.sh
Last active November 18, 2021 21:03
Awk function that can in any text or configuration file substitute a key with its own value, if its value is assigned earlier in the file
# In any text or configuration file substitute a key with its own value, if its value is assigned earlier in the file and the key is referenced with {{key}}
# This could be used on any text file, i.e an .ini file or a docker-compose env file
# The mechanism works like in shell script variable syntax in some ways : assignation, declaration, resolution order and comment symbol (#)
# Usage : substitute_key_in_file "<file_path>"
# Input file content:
# N=10
# The number is {{N}}
# # FOO={{N}}
# A=1
@StudioEtrange
StudioEtrange / regexp_extended.go
Last active November 30, 2021 23:59
Golang add regexp functionality
package main
import (
"fmt"
"regexp"
)
// ReplaceAllSubmatchFunc and ReplaceAllStringSubmatchFunc are variant of the same func for []byte and string
// They will replace all matching groups with the repl string
func ReplaceAllStringSubmatch(re *regexp.Regexp, src string, repl string, n int) string {
@StudioEtrange
StudioEtrange / setup_kodi_vstream.md
Last active March 3, 2023 22:48
Guide pour streamer depuis le lecteur Kodi avec vStream

Guide pour streamer depuis le lecteur Kodi avec vStream

Ce guide part de l'installation de Kodi, le configure en français et permet d'obtenir un lecteur de streaming connecté à différentes sources d'hébergement de fichiers vidéos (uptobox, uptostream, lien https divers etc...)

Ainsi Kodi aura la capacité de streamer des contenus en accèdant à des catalogues de liens de fichiers hébergés en ligne tout en les présentant avec les informations complètes sur la vidéo (titre, résumé, ...)

NOTE : ce guide est rédigé avec le skin et menus par défaut de kodi qu'on a lors d'une toute première installation

Installation et configuration de Kodi

@StudioEtrange
StudioEtrange / PulseSecure_disable_pulsetray_macos.md
Last active February 4, 2024 23:05
PulseSecure MacOS : Disable autostart PulseTray app
@StudioEtrange
StudioEtrange / -remote_sync_files.md
Last active March 28, 2026 07:35
Remote sync files with various method for various protocol

Remote sync/copy files with various method for various protocol

@StudioEtrange
StudioEtrange / docker_multi_platform.md
Last active January 30, 2026 02:08
Docker multi platform

Docker multi platform support

  • Docker images support multiple platforms. When you run an image with multi-platform support, Docker automatically selects the image that matches your OS and architecture.

  • About local images storage : The default image store in Docker Engine do not separate image by platform type. Each image:tag erase the previsous one, independently of its image type To solve that you can enable the containerd image store by modifing daemon.json (https://docs.docker.com/storage/containerd/)

  • About BuildKit : BuildKit is enabled by default on Docker Engine >= 23.0. If not enabled, you may activate BuildKit which is a better docker build engine, with export DOCKER_BUILD=1 or by modifying /etc/docker/daemon.json with "features": {"buildkit" : true}. It is not a requirement for basic multi platform support, but it is a requirement when using buildx.

  • DOC : https://docs.docker.com/build/building/multi-platform/