Notes
Spring Boot Chain of Responsibility Pattern Example
- By Ercan
- 26/09/2025
- 0 comments
The Chain of Responsibility is a behavioral design pattern that allows us to process a request through a sequence of handlers. Each handler decides whether it can process the request or pass it along to the next handler in the chain. In this article, we will demonstrate how this pattern can be applied in a Spring Boot application to resolve which hashing algorithm was used for a given hash. Problem to Solve Given a plain text string and its hashed value, we want to determine which algorithm (MD5, SHA1, SHA256, etc.) generated the hash. The API Our project provides a simple A..
Spring Boot Strategy Pattern Example
- By Ercan
- 25/09/2025
- 0 comments
Design patterns are one of the most valuable tools in a developer’s toolkit. They provide proven solutions to recurring design problems and help us write code that is maintainable, flexible, and easy to extend. One of the most practical patterns in everyday software development is the Strategy Pattern. In this article, we’ll look at how the Strategy Pattern can be applied in a real-world example using Spring Boot. We will build a simple REST API that takes a piece of text and returns its hash, depending on the algorithm selected by the client. The project is a minimal but effective demonstr..
Backing Up and Restoring PostgreSQL Databases
- By Ercan
- 17/04/2025
- 0 comments
This guide outlines the steps to back up and restore PostgreSQL databases using command-line tools on Windows. Backing Up a Database To back up a PostgreSQL database, use the `pg_dump` utility: .\pg_dump.exe -U <username> -d <database_name> > <dump_path> Example: .\pg_dump.exe -U postgres -d testdb > C:\Users\Ercan\Desktop\db_dump.sql Backing Up a Table To back up a PostgreSQL table, use the `pg_dump` utility: .\pg_dump.exe -U <username> -d <database_name> -t <table_name> > <dump_path> Example: .\pg_dump.e..
Backing Up and Restoring MongoDB
- By Ercan
- 17/04/2025
- 0 comments
This guide outlines the steps to back up and restore MongoDB databases using the official MongoDB Database Tools. 1. Download MongoDB Database Tools Obtain the MongoDB Database Tools from the official website: https://www.mongodb.com/try/download/database-tools 2. Backing Up a Database Use the `mongodump` utility to create a backup of your database: .\mongodump.exe --db=<<db_name>> --out <<dump_path>> Replace `<<db_name>>` with the name of your database and `<<dump_path>>` with the desired output directory. 3. Restoring ..
Installing PHP Xdebug on Windows
- By Ercan
- 17/04/2025
- 0 comments
This guide outlines the steps to install and configure Xdebug for PHP on a Windows environment. 1. Download the Appropriate Xdebug DLL Visit the official Xdebug downloads page to obtain the DLL that matches your PHP version: https://xdebug.org/download#releases 2. Rename and Move the DLL File Rename the downloaded file to `php_xdebug.dll` and move it to the `ext` directory within your PHP installation path (e.g., `C:\php\ext`). 3. Update php.ini Configuration Open your `php.ini` file and add the following configuration: [xdebug] zend_extension=xdebug xdebug.mode=deb..
Backing Up and Restoring GPG Keys
- By Ercan
- 17/04/2025
- 0 comments
This guide outlines the steps to back up and restore your GPG keys, ensuring the security and continuity of your cryptographic identity. Backing Up GPG Keys 1. Export the Secret Key To back up your secret GPG key, use the following command: gpg --export-secret-keys --armor > secret.asc This command exports your secret key in ASCII format to the file `secret.asc`. 2. Export the Trust Database (Optional) To back up your trust database, execute: gpg --export-ownertrust > trustdb.txt This will save your trust settings to `trustdb.txt`. Restoring GPG Keys ..
Installing Podman on Windows
- By Ercan
- 17/04/2025
- 0 comments
This guide outlines the steps to install Podman on a Windows environment. 1. Enable Required Windows Features Open PowerShell as Administrator and execute: dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart Restart your computer to apply the changes. 2. Install WSL 2 Download and install the latest WSL 2 update from: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi 3. Set WSL 2 as Default Version In PowerShell,..
Changing Podman Data Directory on Windows
- By Ercan
- 17/04/2025
- 0 comments
This guide outlines the steps to change the Podman data directory on a Windows environment by exporting and importing the WSL instance. 1. Stop the Podman Machine Execute the following command to stop the Podman machine: podman machine stop 2. Export the WSL Instance Export the existing WSL instance to a backup file: wsl --export <<instance_name>> backup.tar 3. Unregister the WSL Instance Unregister the current WSL instance: wsl --unregister <<instance_name>> 4. Import the WSL Instance to New Location Import the WSL instance to t..
Using OpenStreetMap Data with PostgreSQL
- By Ercan
- 13/04/2025
- 0 comments
This guide outlines the steps to import OpenStreetMap (OSM) data into a PostgreSQL database with PostGIS support on a Windows environment. 1. Install PostGIS Extension Add spatial support to PostgreSQL by installing the PostGIS extension: https://postgis.net/install/ 2. Create a PostgreSQL Database Create a new database in PostgreSQL to store the OSM data. Then, enable the necessary extensions by executing: CREATE EXTENSION postgis; CREATE EXTENSION hstore; 3. Download OSM Data Obtain the desired .osm.pbf file from Geofabrik: https://download.geofabrik.de/ 4. Downloa..
Installing PostgreSQL on Windows
- By Ercan
- 13/04/2025
- 0 comments
This guide outlines the steps to install and initialize PostgreSQL on a Windows environment using the ZIP archive. 1. Download PostgreSQL Visit the official PostgreSQL website and download the ZIP archive: https://www.enterprisedb.com/download-postgresql-binaries 2. Extract the ZIP File Extract the downloaded ZIP file to your desired location, for example: D:\Dev\pgsql-14.1 3. Create Necessary Directories Within the extracted folder, create the following directories: mkdir <<postgresql_path>>\data mkdir <<postgresql_path>>\log 4. Initialize Po..