Top N things you should do after installing or upgrading to your new Fedora 36 workstation.
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import requests | |
class ElasticScroll(object): | |
"""Manages scroll contexts for elasticsearch scroll queries. | |
Args: | |
host (str): Elasticsearch host url. Example: ``http://localhost:9200``. | |
index (str): Elasticsearch index name. Example: ``my_index``. |
Python 3.9 comes as a default with Fedora 34. However, sometimes you may wish to install older versions for development and test purposes. Apart from groupinstall
command, these instructions work for CentOS and REHL systems as well.
Install python development dependencies.
sudo dnf groupinstall "Development Tools"
sudo dnf install python3-devel openssl-devel zlib-devel bzip2-devel sqlite-devel libffi-devel
Note: You will need to rebuild and reinstall if you install new source or development libraries for python. Do not create or modify symlinks for python
, python3
, etc, as that may and will break many dependent libraries in your system.
When you want to run tests against multiple test parameters, but you have to use other pytest.fixture
objects,
you can use pytest.mark.parametrize
with indirect parameter to target a fixture for extracting request.param
from parametrize list.
Example
# Pre-compiler and Compiler flags | |
CXX_FLAGS := -Wall -Wextra -std=c++17 -ggdb | |
PRE_FLAGS := -MMD -MP | |
# Project directory structure | |
BIN := bin | |
SRC := src | |
LIB := lib | |
INC := include | |
MAINFILE := $(SRC)/main.cpp |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import json | |
import requests | |
class ElasticBulk(object): | |
"""Class for indexing documents in bulk""" |
Source: This SO Answer
- Is the Cron daemon running?
- Run
ps ax | grep cron
and look for cron.
- Run
- Debian:
service cron status
, if not running,service cron start
orservice cron restart
# -*- coding: utf-8 -*- | |
import click | |
from paho.mqtt.client import Client | |
class MQTTClient(object): | |
"""Manages Paho MQTT client lifecycle and callbacks""" | |
def __init__(self, config: dict, message_processor=None): | |
self.config = config |
"""A simple yaml loader | |
Load the content of an yaml file into a python dict. Environment variable can be specified with ${VAR_NAME}. A | |
default string value can be specified with ${VAR_NAME:DEFAULT}. Able to process multiple occurrences. | |
requirement: PyYAML | |
run: python loader.py | |
""" | |
import os |