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 / install_bangla_fonts.sh
Created December 4, 2025 10:45
Script for downloading Bangla fonts from OmicronLab and install in your system
#!/bin/bash
# Bangla Font Installer Script v1.0
# MIT License
# Downloads and installs Bangla fonts from OmicronLab
set -e # Exit on error
# Color codes for output
RED='\033[0;31m'
@zobayer1
zobayer1 / docker-cheat.md
Created October 22, 2024 10:16
Docker Important and Forgotten Commands

Docker Cheatsheet

Check health-check logs of a container

docker inspect --format "{{json .State.Health }}" <container name> | jq
@zobayer1
zobayer1 / generator_send.py
Last active October 24, 2026 21:04
Python Generator Send Usage - Send data back to a co-routine
"""
Imagine you are reading data from a source and sending it to somewhere else.
This is a good use-case for generator send method. We can keep writing as we
keep reading them without going in and out of respective context managers.
"""
from typing import Generator
def read_data(file_name: str) -> Generator[str, None, None]:
with open(file_name, "r") as input_file:
@zobayer1
zobayer1 / postgres_pgadmin.compose.yaml
Created February 22, 2024 16:16
Run postgres12 and pgadmin4 with docker compose
version: "3"
services:
postgres:
image: postgres:12-alpine
restart: always
ports:
- "5432:5432"
environment:
@zobayer1
zobayer1 / compile-openssl_102.sh
Created March 14, 2023 11:41 — forked from meanevo/compile-openssl_102.sh
Compile OpenSSL 1.0.2* from source on CentOS 7
# Make sure you have these installed
yum install -y make gcc perl pcre-devel zlib-devel
# Download/Extract source
wget -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz
tar -zxf /tmp/openssl.tgz -C /tmp
cd /tmp/openssl-*
# Optional: Patch chacha20
# https://github.com/cloudflare/sslconfig/tree/master/patches
wget https://raw.githubusercontent.com/cloudflare/sslconfig/master/patches/openssl__chacha20_poly1305_draft_and_rfc_ossl102j.patch
patch -p1 < openssl__chacha20_poly1305_draft_and_rfc_ossl102j.patch
@zobayer1
zobayer1 / remove_old_kernel.sh
Created December 8, 2022 05:28
Cleanup your old Kernels after booting up the latest kernel
#!/usr/bin/env bash
##
## Cleanup your old Kernels after booting up the latest kernel.
## Source: https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/#sect-clean-up-old-kernels
##
old_kernels=($(dnf repoquery --installonly --latest-limit=-1 -q))
if [ "${#old_kernels[@]}" -eq 0 ]; then
echo "No old kernels found"
@zobayer1
zobayer1 / psycopg_connect.py
Created September 8, 2021 23:59
A simple python snippet for connecting to PostgreSQL database using psycopg2 library.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""PostgreSQL Connect
A simple python snippet for connecting to PostgreSQL database using psycopg2 library.
Installl psycopg2:
sudo dnf install python3-devel postgresql-devel
pip install psycopg2
"""
@zobayer1
zobayer1 / send_mail.py
Last active November 1, 2023 07:23
Send Emails from GMail using Python SMTP library
# -*- coding: utf-8 -*-
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import formataddr
from typing import List
class SendMail(object):
@zobayer1
zobayer1 / gist_blur.md
Last active November 8, 2025 11:44 — forked from AbuAbir/Good practice.md
Good practice to showcase achievement

GIST and BLUR

*collected from "Zobayer Hasan", Solution Architect, TigerIT Bangladesh

Works that you can show are always lot more impressive than works that you can only talk about. So yes, your projects on GitHub should carry a good amount of weight, or consideration in a recruitment phase, granted that they are relevant to the position or field you are trying to get in, and you are able to explain / answer relevant questions. When it comes to group projects, it is a bit sketchy. But these are great for showing how honest you are. Because, trust me, interviewers are usually good enough to catch you if you try to fool them (if they can't, they're probably from a bad company, and you don't want to get in there anyway).

@zobayer1
zobayer1 / loader.py
Last active December 1, 2023 16:01
Parsing environment variables in an YAML file using PyYAML library
"""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