Skip to content

Instantly share code, notes, and snippets.

@valentinconan
valentinconan / .gitlab-ci.yml
Last active May 22, 2025 14:06
Gitlab automatic link to linear tickets through MR name containing CAPXXXX
mr_automatic_link_ticket:
stage: validate
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
before_script:
- apk add jq curl bash
script:
- |
cat > script.sh << 'EOF'
#!/bin/bash
@valentinconan
valentinconan / .gitlab-ci.yml
Created February 26, 2025 10:59
Gitlab coverage review and post comment on MR
stages:
- test
- coverage
test:
stage: test
rules:
- if: ($CI_PIPELINE_SOURCE == 'merge_request_event')
when: always
- when: always
@valentinconan
valentinconan / README.md
Last active January 2, 2025 11:09
Gitlab pipeline configuration
@valentinconan
valentinconan / README.md
Created April 17, 2024 12:34
Orchestration setup

Install dev environment

Install tools

Install k3s server

curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--flannel-backend=vxlan" sh -

Without traefik

curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable traefik --flannel-backend=vxlan" sh -

@valentinconan
valentinconan / genericJsonTransform.go
Created July 17, 2023 20:05
A simple generic Golang method used to manage the conversion of json into a declared structure
func main() {
stringifyData := `{"name":"toto"}`
var data interface{}
if err := json.Unmarshal([]byte(stringifyData), &data); err != nil {
panic(err)
}
//transform interface to declared struct
res := transform[Test](data)
@valentinconan
valentinconan / EncodeSHA256WithDSA.go
Last active June 28, 2023 21:54
Signature using SHA256 with DSA and a PEM file as private key
package service
import (
"crypto/dsa"
"crypto/rand"
"crypto/sha256"
"encoding/asn1"
"encoding/base64"
"encoding/pem"
"errors"
@valentinconan
valentinconan / Microsoft.PowerShell_profile.ps1
Last active April 18, 2019 16:45
Create powerShell alias
# Execute this to create alias
#cd $env:USERPROFILE\Documents
#md WindowsPowerShell -ErrorAction SilentlyContinue
#cd WindowsPowerShell
#New-Item Microsoft.PowerShell_profile.ps1 -ItemType "file" -ErrorAction SilentlyContinue
#powershell_ise.exe .\Microsoft.PowerShell_profile.ps1
#then execute $profile to save and restart powershell
@valentinconan
valentinconan / dockerReminders.md
Last active April 3, 2024 15:58
Docker reminders

Reminders

Clean

docker rmi $(docker images –qf dangling=true)
docker volume rm $(docker volume ls -qf dangling=true)

Stats

# classic one
docker stats --format "table {{.Name}}\t{{.Container}}\t{{.CPUPerc}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}"
@valentinconan
valentinconan / InterceptorNodeServer.js
Created July 2, 2018 10:03
InterceptorNodeServer
/*
npm install http
npm install fs
npm install path
npm install xml
npm install querystring
*/
var http = require('http'),
fileSystem = require('fs'),
path = require('path'),
:label
echo start
timeout 5
REM replace COMMAND by your command
for /f "delims=" %%i in ('COMMAND') do set _string=%%i
rem --- Remove whitespace at left
for /F "tokens=*" %%s in ("%_string%") do set _trimmed=%%s
echo off
echo [%_trimmed%]
if not %_trimmed% == "healthy" goto label