Skip to content

Instantly share code, notes, and snippets.

@malys
malys / convertToCurl.js
Last active December 3, 2021 13:41
[Artillery to curl] script to artillery script to curl commands #artillery #curl #nodejs #javascript
//node convertToCurl.mjs script.yml > test.sh
// mv convertToCurl.js convertToCurl.mjs
import convertToCurl from './convertToCurlLib.mjs'
import yargs from 'yargs'
import {
hideBin
} from 'yargs/helpers'
const argv = yargs(hideBin(process.argv)).argv
console.log(convertToCurl(argv._[0]))
@malys
malys / Readme.md
Last active January 18, 2022 12:57
[Semantic releasing automation] zx scripts for semver automation #zx #semver #maven #nodejs #javascript

Based on zx-semrel concept, followed scripts are examples to automate full releasing process with zx scripts.

Purpose

zx-semrel concept proposes an implementation of semantic release for node projects using zx.

In our case, we try to generalize this idea to:

  • provide a script agnostic to build technology (npm, maven ,gulp, ...): release.mjs
  • provide a script using maven for build engine: release_maven.mjs
  • provide modularity architecture to factorize code and to cover more use case: release_util_update.mjs
@malys
malys / suspend.cmd
Created October 15, 2021 07:16
[Suspend process] suspend and resume process #windows #dos #batch
@echo off
rem ================================================================
rem To suspend a process, use the following command:
rem suspend.cmd
rem ===========================
rem To resume a process, use the following command:
rem suspend.cmd resume
rem ================================================================
rem Process to suspend or resume
@malys
malys / markExport.js
Last active January 18, 2022 09:32
[Mark preprocessing] plantuml and external file insertion #md #confluence #plantuml #mark
/*
Prerequisites:
* Plantuml + Java
* Mark
* npm i -g zx
* zx markExport.mjs "password"
<!-- Attachment: ./release_stable.puml.png --> => generate automatically image from release_stable.puml
<!-- file://D:/example.js;10;12 --> => insert code snippets
*/
@malys
malys / keldoc.py
Created May 24, 2021 10:00
Vaccination
import requests
import json
import time
import datetime
proxies={
}
searches=[
{"toulouse-31000":"vaccinodrome-toulouse"},
@malys
malys / .bashrc
Created February 7, 2021 15:37
[Nyagos + Bash ] Include bash completion in nyagos #nyagos #bast #completion #windows
#
# Author: Brian Beffa <brbsix@gmail.com>
# Original source: https://brbsix.github.io/2015/11/29/accessing-tab-completion-programmatically-in-bash/
# License: LGPLv3 (http://www.gnu.org/licenses/lgpl-3.0.txt)
#
get_completions(){
local completion COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS COMPREPLY=()
# load bash-completion if necessary
@malys
malys / Authorization Code Flow.jmx
Created January 5, 2021 11:04
[Authorization code flow] #keycloak #jmeter
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.2.1">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Authorization Code Flow" enabled="true">
<stringProp name="TestPlan.comments">add CookieManager.save.cookies=true to user.properties </stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">true</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="scheme" elementType="Argument">
@malys
malys / oauth2-proxy.yaml
Created October 2, 2020 13:32
[Louketo replacement ] #keycloak #proxy #oauth2-proxy
relypartyadmin:
image: quay.io/oauth2-proxy/oauth2-proxy:latest
hostname: relypartyadmin
depends_on:
- appserver
restart: on-failure
ports:
- "8200:8200"
environment:
- OAUTH2_PROXY_STANDARD_LOGGING=true
@malys
malys / gitleaks.sh
Created August 4, 2020 14:51
[GitLeaks for user space] #git #gitleaks #security
user=$1
items=$2
depth=$3
curl --silent -kL https://api.github.com/users/$user/repos?per_page=$items |grep "full_name" |awk -v user="$user" -F"\"" '{print "https://github.com/"$4}' > $user-repos.txt
while read in; do
echo $in
gitleaks --repo="$in" --verbose --pretty --depth=$3 --threads=5 --report=$user-gitleaks-result;
done < $user-repos.txt
@malys
malys / Dockerfile-server
Created April 30, 2020 06:29
[Openxpki] #keystore #pki #windows #docker #docker-compose
FROM debian:buster
ARG DEBIAN_FRONTEND=noninteractive
ARG OPENXPKI_NOCONFIG=1
RUN apt-get update && \
apt-get install --assume-yes gpg libdbd-mysql-perl libapache2-mod-fcgid apache2 wget locales less gettext
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales
RUN wget https://packages.openxpki.org/v3/debian/openxpki.list -O /etc/apt/sources.list.d/openxpki.list