Skip to content

Instantly share code, notes, and snippets.

View zobayer1's full-sized avatar
🚧
What should I do next?

Zobayer Hasan zobayer1

🚧
What should I do next?
View GitHub Profile
@zobayer1
zobayer1 / Makefile
Last active November 8, 2024 13:37
Generic Makefile for C++ projects with multiple cpp and h files
# 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
@zobayer1
zobayer1 / pytest_parametrize.md
Last active August 26, 2022 04:13
Using pytest parametrize with indirect for multiple test functions

Using pytest.mark.parametrize with other fixtures

Introduction

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

@zobayer1
zobayer1 / fedora_install_python3.md
Last active March 31, 2025 09:31
Install Python 3.6, 3.7, 3.8 in your Fedora system

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.

Prerequisites

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.

@zobayer1
zobayer1 / fedora_post_install.md
Last active January 15, 2025 10:52
Fedora 36 post installation notes for software developers. Things you should do after installing your new Fedora 36 workstation.

Fedora 36 Post Installation (For Software Developers)

Top N things you should do after installing or upgrading to your new Fedora 36 workstation.


Settings

Change Hostname

@zobayer1
zobayer1 / elastic_scroll.py
Last active November 14, 2020 23:26
Simple generator function to download Elasticsearch index data using scroll query
#!/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``.