Archives de l’auteur : davidhxxx

python venv

Introduction When using that ? In almost every applications. The python and packages installed on the host may suit to some applications needs but not to all. To settle that : the venv module. That is the standard python module … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Pip : package manager

Pip Generalities Repository : https://pypi.org/ requirements.txt VS requirements.in requirements.txt is the pip official format to list all dependencies for a project. It is a universal format understood by pip install -r but also uv pip, poetry export, Docker, Heroku, AWS, … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Python HTTP requests

Requests API Allow to send HTTP/1.1 requests. No need to manually add query strings to your URLs, or to form-encode POST data. Basic usage : import requests … response = requests.get(’https://api.github.com/events’) Session Object A Session object has all the methods … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Kubernetes Volumes

Volume overviews At its core, a volume is a directory, possibly with some data in it, which is accessible to the containers in a pod. How that directory comes to be, the medium that backs it, and the contents of … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Regex (Java, Bash…)

Greedy patternPart(.*) is greedy Greedy consumes the maximum of the input that matches String methodFullName = "foo.bar.foobar.Foox.doFoo"; Pattern pattern = Pattern.compile("(.*)\\.(.*)$"); Matcher matcher = pattern.matcher(methodFullName); if (matcher.matches()) { String className = matcher.group(1); String methodName = matcher.group(2); System.out.println(className + "!" + … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Kibana

Kibana queries and filters Location Discover page. Basic Syntax The search field on the discover page provides a way to query in a selected time frame. And we have a filter field to apply boolean operators, wildcards, and field filtering. … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Filebeat 7

Filebeat Commandline Filebeat commands run Runs Filebeat. This command is used by default if you start Filebeat without specifying a command. setup Sets up the initial environment, including the index template, ILM policy and write alias, Kibana dashboards (when available), … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

ELK with Docker

General infos Official Elastic docker registry : docker.elastic.co Web site : https://www.docker.elastic.co Known Errors ELK Problem : VM’s max mnumber of memory map too low : Symptom : Elasticsearch container fails at startup with the error message : ERROR: [1] … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

install and update docker

Components to install/upgrade – docker-ce – docker-ce-cli – containerd.io Update docker version 2 solutions : 1) using the ubuntu repository if the available versions look suitable. Find available version for docker-ce : apt-get list | grep docker-ce Upgrade it : … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Python as command line tools

Format a JSON in shell : curl « http://myurl » | python -m json.tool Or : cat foo.json | python -m json.tool

Publié dans Non classé | Laisser un commentaire