라벨이 개발-EN인 게시물 표시

[7] Nging Server Setup - Building a Text Detection API using Drogon Server with OpenCV

이미지
Setting up text detection in RHEL and integrating it with a Drogon server to develop functionality that extracts text information as an API and displays it to clients. Note: The purpose is Text Detection, not OCR (Optical Character Recognition). OCR will be integrated later. --- ## 0. Search for Text Detection Frameworks | Framework | Language | Pros | Cons | |---------------------|-----------------|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------| | Tesseract OCR | C++ (Python, etc.) | Open source, supports multiple languages, customizable | Can have degraded performance without preprocessing, requires integration wit...

[6] Nginx Server Setup - Implementing Upload/Download + Simple Upload Client

이미지
With directory listing set up, let's implement file upload/download functionality using Drogon. --- ## 1. Server Function Implementation ### 1-1. Implementing Drogon Controller Register the Drogon Controller. (This step is required for it to be recognized during the build.) ``` cd /root/drogon2/drogon/build/drogon_ctl drogon_ctl create controller FileController ``` --- ### 1-2. Implement Upload/Download Functionality Source path: `/root/drogon2/drogon/build/drogon_ctl/testAPI/controllers` FileController.h #pragma once #include using namespace drogon; class FileController : public HttpController { public: std::string _storagePath = "/root/storage/"; METHOD_LIST_BEGIN // Handles POST requests for "/upload" ADD_METHOD_TO(FileController::handleUpload, "/upload", Post); // Handles GET requests for "/download/{filename}" ADD_METHOD_TO(FileController::handleDownload, "/download/{1}...

[5] Nginx Server Setup - Folder Listing on Web

이미지
Before implementing file upload/download functionality, let's first create a local storage directory and make it accessible via the web. --- ## 1. Create Storage and Set Permissions - Create storage directory ``` mkdir /root/storage cd /root/storage vi test.txt # Add any content, save, and exit ``` - Grant permissions to the directory for the user running NGINX ``` ps aux | grep nginx ``` --- For example, if the NGINX process runs as "nobody", change the folder's ownership: ``` [root@vbox build] (master) $ ps aux | grep nginx root 52636 0.0 0.0 4544 2412 ? Ss 01:26 0:00 nginx: master process ./nginx root 59772 0.0 0.1 13064 9600 pts/1 T 06:04 0:00 /usr/bin/vim nginx.conf nobody 60676 0.0 0.0 13168 5484 ? S 06:23 0:00 nginx: worker process nobody 60677 0.0 0.0 13168 5612 ? S 06:23 0:00 nginx: worker process ``` --- - Change permissions and ownership sudo chmod -...

[4] Nginx Server Setup - Writing a Drogon Test API

이미지
Let's create an API using Drogon to return specific values as a test. --- ## 1. Setting up the Drogon Test Project - Run the following command in the directory where `drogon_ctl` is installed: ``` drogon_ctl create project testAPI cd testAPI ``` --- ## 2. Build - The full path will be /root/drogon2/drogon/build/drogon_ctl/testAPI/build ``` mkdir build cd build cmake .. make ``` --- If the following error occurs, it’s best to set the environment variable and reinstall Drogon: ``` CMake Error at /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package): By not providing "FindJsoncpp.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Jsoncpp", but CMake did not find one. Could not find a package configuration file provided by "Jsoncpp" with any of the following names: JsoncppConfig.cmake jsoncpp-config.cmake Add the installation ...

[3] Nginx Server Setup - Connecting to C++ Web Framework

이미지
## 0. Researching C++ Web Frameworks To achieve the goal of building a server in C++, I've started by researching suitable C++ web frameworks. According to GPT recommendations, **Drogon** is popular, so I'll proceed with this framework first. --- | Framework | Advantages | Disadvantages | |------------|-------------------------------------------------------------------------------------------|------------------------------------------------------------------| | **Drogon** | Supports modern C++14/17 standards Asynchronous programming and multi-thread support Supports HTTP2 and WebSocket High performance and user-friendly API Active community and support | Initial setup can be complex due to many features | | **Pistache** | Lightweight design enables quick web server implementation Suitable for RESTful API development Simple code an...

[2] Nginx Server Setup - Downloading and Setting Up a Specific Version of Nginx

이미지
Instead of installing Nginx directly to the system path, this guide explains how to download, build, and set up Nginx manually. --- ## Setup Environment - Red Hat Enterprise Linux release 9.4 (Plow) ## 1. Download and Extract Nginx To download and extract Nginx: ``` wget http://nginx.org/download/nginx-1.21.6.tar.gz tar -xvf nginx-1.21.6.tar.gz ``` To download a different version, simply change the version number in the command and proceed with the steps as outlined. --- ## 2. Install Required Libraries Install essential libraries: ``` sudo yum install -y gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel ``` ``` Explanation of each library: - gcc: The C compiler required to compile Nginx source code into an executable. - pcre: Provides regular expression handling for Nginx. - pcre-devel: Contains development headers needed when compiling Nginx. - zlib: Enables gzip compression in Nginx. - zlib-devel: Provides zlibs development files needed for compiling. - openssl: N...

Checking if the First Page of a PDF Contains Text and Images on RHEL

## How to Verify Text and Images on the First Page of a PDF in RHEL - There are times when you need to check if a PDF file consists solely of text or if it includes images or a mix of elements. - In particular, there may be cases where it’s essential to confirm if both text and images are present on the first page. This task can be performed efficiently on RHEL using "pdfimages", "pdftotext", and "pdfgrep". --- ### Prerequisites: Installing Required Packages - First, install "pdfimages", "pdftotext", and "pdfgrep" on your RHEL environment. - Generally, RHEL provides these tools through the **Poppler** and **PDFgrep** packages. To install "poppler-utils": ``` sudo yum install poppler-utils ``` To install "pdfgrep": ``` sudo yum install pdfgrep ``` --- ### 1. Checking if an Image is Present on the First Page - The "pdfimages" command is a valuable tool included in the Poppler package for...

Performance Comparison of Image Processing Frameworks: ImageMagick vs. libvips

### Large Image Processing - Performance Comparison of libvips and ImageMagick Image processing plays a vital role across various fields, from web development to data analysis. Among the widely used tools are ImageMagick and libvips, each offering robust features and performance. In this post, we’ll examine the pros and cons of each library and benchmark results to see which tool is better suited for large image processing and thumbnail generation. --- ### Comparison Table: libvips vs. ImageMagick | **Feature** | **libvips** | **ImageMagick** | |---------------------|--------------------------------------------------------------------|-----------------------------------------------------------------| | **Extraction Speed**| Fast, especially for large images, 4-8 times faster | Stable performance for various tasks; speed reduction possible for large images...

이 블로그의 인기 게시물

윤석열 계엄령 선포! 방산주 대폭발? 관련주 투자 전략 완벽 분석

한국 핵무장 논의와 방위산업 관련주: 핵무기 개발 과정과 유망 종목 분석

[로스트아크] 제작 효율 최적화 위한 영지 세팅