{D1} - Prometheus初识和服务部署

六二三
+++ 第一部分:Prometheus简介及一些必要的名词解释 +++ From metrics to insight Power your metrics and alerting with the leading open-source monitoring solution. 从指标到洞察力,使用领先的开源监控解决方案为您的数据指标和警报提供助力。 什么是Prometheus? Prometheus是一个开源系统监控和警报工具包,最初在 SoundCloud构建。自 2012 年成立以来,许多公司和组织都采用了 Prometheus,该项目拥有非常活跃的开发者和用户社区。它现在是一个独立的开源项目,独立于任何公司维护。为了强调这一点,并明确项目的治理

Using Raspberry PI to flash Esp-01s with Micropython firmware

六二三
Flashing esp-01s micropython firmware workflow raspberrypi4B board <---> esp-link <---> esp-01s board Download micropython firmware for esp-01s 1M // https://micropython.org/download/esp8266-1m/ wget -c https://micropython.org/resources/firmware/esp8266-1m-20210902-v1.17.bin Flashing with Thonny IDE // Install flash tool - esptool pip3 install -U esptool // find connect esp01s port dmesg|grep tty // check esp01s board info esptool.py -p /dev/ttyACM0 flash_id

Split string with multiple delimiters in Python

六二三
Python string split() method allows a string to be easily split into a list based on a delimiter. Though in some cases, you might need the separation to occur based on not just one but multiple delimiter values. This quick 101 article introduces two convenient approaches this can be achieved in Python. Split String With Two Delimiters in Python Assume the following string. text = "python is, an easy;language; to, learn." For our example, we need to split it either by a semicolon followed by a space ;, or by a comma followed by a space ,. In this case, any occurrences of singular semicolons or commas i.e. , , ; with no trailing spaces should not be concerned. Regular Expressions A delimiter is a sequence of one or more characters used to specify the boundary between separate, independent regions in plain text or other data streams. An example of a delimiter is the comma character, which acts as a field delimiter in a sequence of comma-separated values. Use Basic Expression Python’s built-in module re has a split() method we can use for this case. Let’s use a basic a or b regular expression (a|b) for separating our multiple delimiters. import re text = "python is, an easy;language; to, learn." print(re.split('; |, ', text)) Output: ['python is', 'an easy;language', 'to', 'learn.'] As mentioned on the Wikipedia page, Regular Expressions use IEEE POSIX as the standard for its syntax.