Category: Develope

  • Use Child_Process to pull code?

    Yes, that is a simple opinion. Do it with one simple file: Now, you can write an API to call http://localhost:3000 to pull 3 project. You can `composer update` or something more.

  • Convert Interface in Typescript

    I have one Interface: Convert fields in the interface to required The desired result is as follows: Solution: Convert fields in the interface to optional The desired result is as follows: Solution: Convert some fields by name instead of all The desired result is as follows: Solution: Convert fields in the interface to other value…

  • Build NestJS Library

    To build a NestJS library, you can follow these steps: Create a new NestJS project using the NestJS CLI: Change the working directory to your library folder: Create a new library module using the NestJS CLI: This will generate a new folder my-library inside the src folder. This folder contains the library module and its…

  • Compare strings and calculate scores, find the closest string

    Compare strings and calculate scores, find the closest string by JS:

  • NestJS (NodeJS) sending message to Kafka topic is easy

    NestJS (NodeJS) send message to Kafka topic easily in this quick trick: Create a new NestJS test project: Paste this code in main.ts: Install package: Make sure topic: ‘test-server’ was created on target Kafka server, and you are subscribing on that topic to watch the result. Run script: Note: Your script only runs if you…

  • Config Cyberpanel/ OpenLiteSpeed server to run NodeJS on port 80/443

    If you use LiteSpeed, you can run NodeJS project as a PHP project. Step 1: Add a domain (example domain.com) to your server You need to: Create a folder to upload your code. Or create by Cyberpanel admin tool (recommend). Add new DNS record (A) from domain to your server IP Step 2: Modify the…

  • Install MongoDB for PHP Laravel

    At this moment, php-mongodb support PHP7.2 for Laravel. You need to change PHP-cli to 7.2 (my server use OpenLiteSpeed): Depend on your server OS, your commands like as: Add “extension=mongodb.so” to php72 config (php.ini). Restart your php server: For OpenLiteSpeed: systemctl restart lsws In your project folder, run:

  • Install AAPT service to read APK file information on Linux (Centos/ Rocky)

    If you want to run aapt read apk file information: STEP 1: Download aapt-linux build-tool at https://androidaapt.com/STEP 2: Copy the entire lib64 folder to usr/lib64 on centosSTEP 3: Copy the aapt file to the usr/bin directory and then chmod +x aapt (755)Example reading file version: Example reading file package name: In your script (my example…

  • Download APK file by PHP script

    This is 100% working PHP script to download a APK file, or any extension: By this way, you can restrict directly download. And you can count downloaded too.