Archives de l’auteur : davidhxxx

Python docstring

Main docstring formats In Python, they are multiple docstring formats. There is an official format: reStructuredText but there are also not official but very used formats. – reStructuredText: Official Python documentation standard. It has many features but it is also … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

CDK python examples

Basic infrastructure that defines  initial configuration, connections, key name to grant SSH access and use a static elastic IP import aws_cdk.aws_ec2 as ec2 # import aws_cdk.aws_ec2.Port as Port import aws_cdk.aws_iam as iam from aws_cdk import ( # Duration, Stack, Duration, # aws_sqs … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Windows performance diagnostic

Analyze in more depth the memory used by windows rammap The tool may show some helpful information such as driver locked memory that is memory used by virtual machine or a graphical driver

Publié dans Non classé | Laisser un commentaire

grub hints

Important file locations configuration file: /boot/grub/grub.cfg configuration file used by default: /etc/default/grub Change the boot order – Identify the boot partition where we want to boot by default: cat /boot/grub/grub.cfg | grep -i ‘menuentry ‘ For each bootable partition, we … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

nginx

Redirect traffic to another url A nginx configuration to redirect traffic from localhost:8080 to https://fooserver:9200/ Here how to start a docker container with that configuration stored into a /conf/nginx.conf file : docker run –name nginx-redirect-traffic -p 8080:8080 -v /conf/nginx.conf:/etc/nginx/nginx.conf:ro -d … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Docker daemon configuration

Publié dans Non classé | Laisser un commentaire

gitlab pipelines with python application

Define a stage for creating a docker image for the python application and running python tests on a container of that image This approach is more verbose than directly executing python tests without creating a docker image for the application. … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

How to run tests in python according to the library

Unittest versus pytest Some differences between them: 1) unittest is standard, it is a built-in module while pytest is a third party module. 2) The syntax of the 2 api is distinct while pytest is able to work with tests … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

python json (built-in library)

Scope and limitations Scope: – exposes an API familiar to users of the standard library marshal and pickle modules. – Allows customization of serialization and deserialization Drawbacks: – Customisation of serialization and deserialization may be quite cumbersome, especially the deserialization … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Python formatting and linters

Pycharm formatter for python Python is less configurable than java. Here my current modifications against the default configuration to have a quite good formatting: A very important setting is the line wrapping. Without that, we may have some IDE errors … Continuer la lecture

Publié dans Non classé | Laisser un commentaire