Outils pour utilisateurs

Outils du site


blog

Notes Jenkins

Serveur

# podman run -p 8080:8080 -p 50000:50000 --restart=on-failure -v jenkins_home:/var/jenkins_home docker.io/jenkins/jenkins:lts
podman run -p 8080:8080 -p 50000:50000 --restart=on-failure -v jenkins_home:/var/jenkins_home docker.io/jenkins/jenkins:lts-jdk21
 
podman exec -l cat /var/jenkins_home/secrets/initialAdminPassword

Plugins :

  • Role-based Authorization Strategy
  • Pipeline

Recommandés :

  • Folders
  • OWASP Markup Formatter
  • Build Timeout
  • Credentials Binding
  • Timestamper
  • Workspace Cleanup
  • Ant
  • Gradle
  • Pipeline
  • GitHub Branch Source
  • Pipeline: GitHub Groovy Libraries
  • Pipeline Graph View
  • Git
  • SSH Build Agents
  • Matrix Authorization Strategy
  • LDAP
  • Email Extension
  • Mailer
  • Dark Theme
Pb Erreur Form too large 208753>200000
Solution

Ajouter l'argument ci-dessous dans le fichier jenkins.xml :

-Dorg.eclipse.jetty.server.Request.maxFormContentSize=5000000

API

read -s MDP
# curl -u admin:"$MDP" -s http://localhost:8080/api/json | python3 -m json.tool
curl -u admin:"$MDP" -s http://localhost:8080/api/json | jq .

CLI

wget http://jenkins:8080/jnlpJars/jenkins-cli.jar
java -jar jenkins-cli.jar -s http://localhost:8080/ help

Salve

wget http://jenkins:8080/jnlpJars/agent.jar
java -jar agent.jar  -jnlpUrl http://jenkins:8080/computer/vmdeb1/slave-agent.jnlp -jnlpCredentials user:password

Pipeline

A Jenkinsfile is written using a Groovy-based DSL (Domain-Specific Language) and can be structured in two ways:

  • Declarative Pipeline (recommended for most users)
  • Scripted Pipeline
2025/03/24 15:06

Notes Java JVM

Notes dev Java

Quarkus

Voir :

Voir aussi :

Le FrameWork Quarkus pour développer en Java pour du K8B / Docker

La compilation est plus “complète”, donc plus de temps de compiliation, mais un temps d'execution / démarrage réduit. Permet le Serverless. La sortie de la compilation est un binaire, plus un jar. Cela réduit l'emprunte mémoire.

Install du JRE Java 8 sur Debian 7

mkdir /opt/
cd /opt/
tar xvf /root/jre-8u161-linux-x64.tar.gz
 
ln -s /opt/jre1.8.0_161 /opt/jre
 
cat >> /etc/environment <<EOF
JAVA_HOME="/opt/jre"
EOF
 
update-alternatives --install /usr/bin/java java /opt/jre/bin/java 1
update-alternatives --set java /opt/jre/bin/java
 
java -version

Lib utilisée

Savoir si la lib log4j est utilisée

for pid in $(pidof java);do cat /proc/$pid/cmdline|xargs -0 && cat /proc/$pid/maps |grep log4j;done

Notes

Defaut Max Heap Size

java -XX:+PrintFlagsFinal -version 2>&1 | grep MaxHeapSize

Voir :

  • jps
  • jstat
  • jconsole
jstatd.all.policy
grant codebase "file:${java.home}/../lib/tools.jar" {
  permission java.security.AllPermission;
};

JVM OPT_ARGS

java --illegal-access=<paramater> -jar plop.jar

parameter :

  • permit
  • warn
  • debug
  • deny
Autres
  • JAVA_MAX_MEM_RATIO
  • -XX:MaxRAMPercentage
  • JAVA_MAX_MEM_RATIO=80.0
2025/03/24 15:06

Bash astuces

Check syntax avec shellcheck

Voir aussi :

shellcheck monscript.sh

Si faux positif

# shellcheck disable=SC2086
rsync $RSYNC_OPT "${PART}/" "${PART_TMP}/"
$ shellcheck plop.sh
 
In mkiso-debian.sh line 56:
        source "$FIC_PROPERTIES"
        ^-- SC1090: Can't follow non-constant source. Use a directive to specify location.

Solution

Ajouter en commentaire shellcheck source=

plop.sh

# shellcheck source=vars/vm-deb10.var
source "$FIC_PROPERTIES"

puis

shellcheck -x plop.sh

.shellcheckrc

external-sources=true
shell=bash
color=always

Variables

Alternative à eval pour les variables Meta variables

$ a=1
$ b=2
$ meta_var="a"
$ echo ${!meta_var}
1

Appel de variable

$ B=2
$ KEY=B
$ echo ${KEY}
B
$ echo ${!KEY}
2

Déclaration / affectation de variables dynamiques

$ declare $KEY=12
$ echo ${!KEY}
12

Ou encore

K=V
 
declare -n V2=K
# Ce qui revient à :
# V2="$K"
 
$ LETTRE=ALPHA
$ ALPHA=A
$ declare -n PLOP=$LETTRE
$ echo $PLOP
A
Linter

shfmt https://github.com/mvdan/sh

~/go/bin/shfmt -i 4 -s -w plop.sh

Auto indent vim

:set expandtab ts=4 sw=4 ai
:retab

bashate

pip3 install bashate
 
bashate file.sh
bashate -i E010,E011 file.sh file2.sh
Autres

/etc/skel/.bash_logout

/usr/bin/clear
2025/03/24 15:06

Notes iTop ITSM ESM CMDB ITIL

Voir :

Voir aussi :

sudo docker run -d -p 8000:80 --name=my-itop vbkunin/itop
2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki