Archives de l’auteur : davidhxxx

Pip and packages

Generalities Repository : https://pypi.org/ List installed modules : python3 -c « help(‘modules’) » or : pip3 list List a depth tree of dependencies of a python environment: pipdeptree. It is a third-party dependency. To install it: pip install pipdeptree List available versions … 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

Gradle

Basic tasks clean : delete the build directory build : build the application publish : publish the jar in the configured remote repository Important env variables GRADLE_OPTS : Specifies JVM arguments to use when starting the Gradle client VM. The … Continuer la lecture

Publié dans Non classé | Laisser un commentaire