Outils pour utilisateurs

Outils du site


blog

Notes TPM - puce Fritz

Voir aussi :

  • Clipper Chip / Skipjack

Voir :

Éthique :

TSS : TPM Software Stack

Message sur ESXi : Unable to acquire ownership of TPM 2.0 device. Please clear TPM through the BIOS.

Sur ESX :

esxcli system settings encryption recovery list

systemd-tpm2-clear.service /usr/lib/systemd/systemd-tpm2-clear

2025/03/24 15:06

Notes Tower AWX AAP Ansible Automation Platform

Install

shell_plus

shell_plus avec IPython

Install

Voir aussi :

python3.9 -m venv ipython
pip install ipython
cp -a venv/ venv2/
rsync -axv --exclude "*.pyc" --exclude "__pycache__" ipython/ venv2/awx/
rsync -axv --exclude "*.pyc" --exclude "__pycache__" venv/awx/ venv2/awx/
 
cd venv2/
sed -e 's%/venv/awx/%/venv2/awx/%' -i $(grep -rl 'venv/awx' *)
sed -e 's%/var/lib/awx/ipython/%/var/lib/awx/venv2/awx/%' -i $(grep -rl 'awx/ipython' *)
 
find . -name "*.pyc" -delete
find . -name "__pycache__" -delete

Utilisation

export PYTHONPATH=/var/lib/awx/venv2/awx/lib/python3.9/site-packages
SHELL_PLUS=ipython
 
# awx-manage shell_plus --ipython
awx-manage shell_plus

Erreur AttributeError: module 'typing' has no attribute '_ClassVar'

$ ipython
Traceback (most recent call last):
  File "/var/lib/awx/ipython/bin/ipython", line 5, in <module>
    from IPython import start_ipython
  File "/var/lib/awx/ipython/lib/python3.9/site-packages/IPython/__init__.py", line 54, in <module>
    from .terminal.embed import embed
  File "/var/lib/awx/ipython/lib/python3.9/site-packages/IPython/terminal/embed.py", line 14, in <module>
    from IPython.core.magic import Magics, magics_class, line_magic
  File "/var/lib/awx/ipython/lib/python3.9/site-packages/IPython/core/magic.py", line 20, in <module>
    from . import oinspect
  File "/var/lib/awx/ipython/lib/python3.9/site-packages/IPython/core/oinspect.py", line 64, in <module>
    class OInfo:
  File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/dataclasses.py", line 958, in dataclass
    return wrap(_cls)
  File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/dataclasses.py", line 950, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
  File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/dataclasses.py", line 800, in _process_class
    cls_fields = [_get_field(cls, name, type)
  File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/dataclasses.py", line 800, in <listcomp>
    cls_fields = [_get_field(cls, name, type)
  File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/dataclasses.py", line 659, in _get_field
    if (_is_classvar(a_type, typing)
  File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/dataclasses.py", line 550, in _is_classvar
    return type(a_type) is typing._ClassVar
AttributeError: module 'typing' has no attribute '_ClassVar'

Solution

mv ./lib/python3.9/site-packages/dataclasses-0.6.dist-info ./lib/python3.9/site-packages/dataclasses-0.6.dist-info.bak
mv ./lib/python3.9/site-packages/dataclasses.py ./lib/python3.9/site-packages/dataclasses.py.bak
Gestion d'un job
sudo -u awx -i
awx-manage shell_plus --ipython
Analyse d'un job

Analyse d'un job KO

Exemple de changement d'état

su - awx
echo "UnifiedJob.objects.filter(status='running').update(status='canceled')" | awx-manage shell_plus

Exemple

#from awx.main.models import UnifiedJob
 
for i in UnifiedJob.objects.filter():
    print(i)
 
job_jb = UnifiedJob.objects.filter(id=241021)
job_jb.values_list()[0]
job_jb.update(status='canceled')
 
start = time.time()
UnifiedJob.objects.filter(id=1096679).update(status='canceled')
end = time.time()
print(end - start)
Effacement d'inventaire
awx-manage shell_plus
Inventory.object.filter(pending_deletion=True).update(pending_deletion=False)
 
Inventory.object.filter(id=inventoryId).delete()

Note : Avant faire une sauvegarde avec ./setup.sh -b

Autres

[awx@aap-crtl-001]$ awx-manage profile_sql --threshold 1 --minutes 5
SQL profiling initiated with a threshold of 1.0 second(s) and a duration of 5.0 minute(s), any queries that meet criteria can be found in /var/log/tower/profile/.

FIXME

2025/03/24 15:06

Notes thunderbird icedove

Voir aussi :

  • claws-mail

http://www.brighthub.com/office/collaboration/articles/71421.aspx

XNote++

To avoid leaking your locale you should change the mailnews.reply_header_authorwrotesingle and mailnews.reply_header_ondateauthorwrote fields to be the same as in this example.

If you can not change the timezone on your node to GMT then you should also set mailnews.reply_header_type to 1 instead of the default which will cause it to only refer to the author and not the time they wrote their message, otherwise Thunderbird will leak your timezone.

If you can change the timezone on your computer (running in a VM helps here) then you should set it to GMT and can leave the header type set at 2.

2025/03/24 15:06

Notes tests de charge HTTP avec Gatling

Install IDE pour dev

Voir :

Install IDE Scala et tous le reste (pas nécessaire)

apt install python-pip python3-pip snapd
apt-get install openjdk-11-jdk maven
wget https://downloads.lightbend.com/scala/2.12.2/scala-2.12.2.deb
dpkg -i scala-2.12.2.deb
 
snap install intellij-idea-community --classic

Lancement IDE

/snap/bin/intellij-idea-community

getling recorder

./gatling-charts-highcharts-bundle-3.6.0/bin/recorder.sh

Lancement

simulation/plop/test1.scala

package plop.hpplop.simulation.mainProfile
 
import scala.concurrent.duration._
 
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
 
class ChargeHPO extends Simulation {
    val durationTime = scala.util.Properties.envOrElse("DURATION", "3" )
    val minUsers = scala.util.Properties.envOrElse("MINUSER", "2")
    val maxUsers = scala.util.Properties.envOrElse("MAXUSER", "3")
    val baseUrl = scala.util.Properties.envOrElse("BASEURL", "")
    println(baseUrl.toString)
 
    val httpProtocol = http.baseUrl(baseUrl.toString)
 
    val headers_hpo = Map(
        "Host" -> "acme.fr",
    )
 
    val scn = scenario("HP Plop")
        .exec(http("Root")
        .get("/")
        .disableFollowRedirect
        .check(status is (301))
        .headers(headers_hpo)
    )
 
    setUp(
        scn.inject(
            nothingFor(10 seconds),
            rampUsersPerSec(minUsers.toInt) to maxUsers.toInt during (durationTime.toInt minutes)
        ).protocols(httpProtocol)
    )
}
env BASEURL=http://acme.fr ~/code/http/gatling-charts-highcharts-bundle-3.6.0/bin/gatling.sh -sf simulations/plop/ -rd "Test1 "

Pb

Erreur avec l'IDE

gatling-tutorial/src/test/scala/Engine.scala
object gatling is not a member of package io
import io.gatling.app.Gatling

Notes Scala

Voir aussi : Kotlin

2025/03/24 15:06

Notes install TensorFlow

Voir aussi :

  • Pytorch
  • Keras

install prérequis

Install de CUDA 9.0 et patches

Voir Install drivers graphique propriétaire Nvidia CUDA

puis

echo 'export PATH=$PATH:/usr/local/cuda/bin' | sudo tee /etc/profile.d/cuda.sh
echo "/usr/local/cuda/lib64" | sudo tee /etc/ld.so.conf.d/cuda.conf
sudo ldconfig
sudo apt-get install python3-numpy python3-venv
pyvenv plop
cd plop
source bin/activate
pip install -U pip
pip install -U pillow
pip install -U opencv-python

Install Tensor

Install libcudnn.so

nvidia-docker pull tensorflow/tensorflow:latest-gpu
updatedb
locate libcudnn.so
sudo cp -p /var/lib/docker/overlay2/64b8c9d64be38b0853ce15db5bfbf53c3fcfed8887fcd651faa27b3c37c4cd00/diff/usr/lib/x86_64-linux-gnu/libcudnn.so.7.1.4 /usr/lib/x86_64-linux-gnu/
ldconfig

Install de TensorFlow

pip install -U tensorflow==1.8.0
pip install -U tensorflow-gpu==1.8.0

Test

python3
import tensorflow as tf

Pb

error: invalid command 'bdist_wheel'
error: invalid command 'bdist_wheel'
Failed building wheel for absl-py
Solution
pip install -U pip
ImportError: libcudnn.so.7
ImportError: libcudnn.so.7: cannot open shared object file: No such file or directory
Solution
nvidia-docker pull tensorflow/tensorflow:latest-gpu
updatedb
locate libcudnn.so
sudo cp -p /var/lib/docker/overlay2/64b8c9d64be38b0853ce15db5bfbf53c3fcfed8887fcd651faa27b3c37c4cd00/diff/usr/lib/x86_64-linux-gnu/libcudnn.so.7.1.4 /usr/lib/x86_64-linux-gnu/
ldconfig
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