Skip to content

Instantly share code, notes, and snippets.

@sadra-barikbin
sadra-barikbin / WiFi-dongle-to-hotspot
Last active January 16, 2022 18:10
How to make a WiFi dongle as hotspot/access point in Linux Ubuntu
#Append lines below to the file /etc/network/interfaces
allow-hotplug **interface-name**
iface **interface-name** inet manual
up /etc/init.d/make-wifi-dongle-as-hotspot.sh
@sadra-barikbin
sadra-barikbin / README.md
Last active May 11, 2025 12:52
How does pytest work?

In this tutorial we're going to follow the execution flow of pytest to see how it does work. Pytest is highly extendable to the extent that not only its plugins but also its core functionalities are implemented as plugins. Generally, A program and its plugins work in the way that program starts and at some specific steps of its execution, it gives control to the plugins. Those specific steps are called hooks. The program has a registered list of plugins that once program reaches a hook, their corresponding hook implementations are called in a specific order.

For its plugin system, pytest relies on Pluggy. As per Pluggy, program should hold an instance of PluginManager which is in charge of keeping hook specifications, registering plugins and calling them. Program declares its hooks specification and adds it to the plugin manager. Then plugins can register themselves to the plugin manager.

When a hook is called, its implementations are called in LIFO order, the later

@sadra-barikbin
sadra-barikbin / README.md
Last active October 13, 2024 13:12
How does Tesseract-OCR work ? A Developer Guide

You've certainly heard of Tesseract-OCR if you've been in the OCR field. In this tutorial, we're going to provide a developer guide on how does tesseract work internally. Specifically, what happens when you run the following example.

#include <tesseract/baseapi.h>
#include <leptonica/allheaders.h>

int main()
{
 char *output_base= "OUTPUT_BASE";
@sadra-barikbin
sadra-barikbin / README.md
Last active April 16, 2024 10:11
A tiny introduction to PCIe, SXM, NVLink, etc.

A tiny introduction to PCIe, SXM, NVLink, etc.

PCIe (Peripheral Component Interconnect Express), as it speaks for itself, is a standard for interconnecting peripheral components of a system like the GPU, sound card, network card or SSD. Here is a PCIe adapter containing 4 PCIe slots.

PCIe_slots

Having a GPU connected to the system, CUDA kernels and data are dispatched by CPU from the system RAM to the GPU VRAM through this interface and the results are transmitted back. Below is a Nvidia PCIe GPU.

pcie_gpu