semvec/pypi-packages huggingface dataset:
meris-checker 1.1.0
A script which checks the qrator database to see if any of your IPs is listed as part of the Meris botnet.
License: MIT
Requires Python: >=3.6,<4.0

# meris-checker

meris-checker is a command which helps you determine whether or not your IP addresses are listed in the Qrator Labs database of meris botnet IPs.

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install meris-checker.

```bash
pip install meris-checker
```

## Usage

There are two ways to use this script. The first is to create a file named `ips.txt`:

```bash
$ echo 127.0.0.1 >> ips.txt
$ echo 127.0.0.0/29 >> ips.txt
$ poetry run meris-checker
IP 127.0.0.1 is safe, whew!
IP 127.0.0.0 is safe, whew!
IP 127.0.0.1 is safe, whew!
IP 127.0.0.2 is safe, whew!
IP 127.0.0.3 is safe, whew!
IP 127.0.0.4 is safe, whew!
IP 127.0.0.5 is safe, whew!
IP 127.0.0.6 is safe, whew!
IP 127.0.0.7 is safe, whew!
```

The second is to specify the IPs one-at-a-time on the command line:

```bash
$ poetry run meris-checker 127.0.0.1 127.0.0.0/30
IP 127.0.0.1 is safe, whew!
IP 127.0.0.0 is safe, whew!
IP 127.0.0.1 is safe, whew!
IP 127.0.0.2 is safe, whew!
IP 127.0.0.3 is safe, whew!
```

This should work with any valid IPv4/IPv6 address or subnet. However, please be aware that it hits the Qrator API for each address in the subnet individually, so you should probably limit your lookups to narrow ranges that you actually own.

The script is rate-limited to 1 IP query per second, so a /24 will take ~6 minutes to run.

## Contributing

Patches are welcome. Please email don@bloono.com

## License

[MIT](https://choosealicense.com/licenses/mit/)
efk-log 0.3.1
Python Json Log IO Operator
License: MIT

# Efk-log

## Quick start

> Called from where the project was launched.



### En

1. Logs in json format are easily collected in es and can be easily indexed on top of kibana for related fields.

2. Note that it is important to avoid index value conflicts, as different value types for the same index name can cause conflicts.

3. Use the supervisor to guard the service processes started by gunicorn when starting a multi-process service, in conjunction with the supervisor's logging feature.

   1. file_path=None

   2. supervisor-related parameters are sliced to avoid large log files.

      ```
      stdout_logfile_maxbytes = 50MB   ; max # logfile bytes b4 rotation (default 50MB)
      stdout_logfile_backups = 10 ; # of stdout logfile backups (default 10)
      stdout_logfile = /data/logs/efk-log/efk-log.log
      ```

### Zh

1. json 格式的日志 方便收集到es中可方便对相关字段在kibana上面创建索引

2. 需要注意的是，要避免索引值的冲突，相同的索引名，数值类型不同就会造成冲突

3. 多进程启动 服务时候配合 supervisor 的日志功能使用，使用supervisor 守护gunicorn 启动的服务进程

   1. file_path=None

   2. supervisor 相关参数 进行切分，避免日志文件太大

      ```
      stdout_logfile_maxbytes = 50MB   ; max # logfile bytes b4 rotation (default 50MB)
      stdout_logfile_backups = 10 ; # of stdout logfile backups (default 10)
      stdout_logfile = /data/logs/efk-log/efk-log.log
      ```



### Flask 

```
LogJsonFormat(file_path=None, console=True, project='efk-log')
```

### Celery

```
from celery.signals import setup_logging

@setup_logging.connect
def set_log(*args, **kwargs):
    LogJsonFormat(file_path=None, console=True, project='celery-prd')
```



### Demo

```
from efk_log import LogJsonFormat

if __name__ == '__main__':
    LogJsonFormat(file_path=None, console=True, project='efk-log')

    import logging

    LOGGER = logging.getLogger(__name__)

    LOGGER.info('get user info', extra={'metrics': {
        'cid': 'xxxxxx'
    }})

    try:
        2 / 0
    except Exception as e:
        LOGGER.exception('except...', exc_info=e)

    LOGGER.error('error')
```