How to install OS and connect to NanoPi-R2S (rk3328)

301 Leave a Comment
Official wiki page OS image on Google Drive Install OS Go to google drive, navigate to: 01_Official images/01_SD card images. Download any image, e.g., "rk3328-sd-debian-bullseye-core-5.15-arm64-20230529.img.gz". Unzip it to "rk3328-sd-debian-bullseye-core-5.15-arm64-20230529.img". importat…

How to find all indicators and country codes while using imf api

321 Leave a Comment
When following the imf api service to query data, you have to specify the indicators. You must have viewed this 2 posts: How to Use the API (Python and R) IMF API (Python) But both of them do not explain how to get full list of indicators as well as the country code. Get full list of imf indicators We have to a…

What is OpenAI Function Calling and How to Use it?

178 , 1 Comment
Simply put, OpenAI / ChatGPT function calling can identify the intent and entities in a sentence through a language model. For example, when the user asks "I want to recharge my phone100 USD". The model should recognize the intent recharge and it's 2 entities recharge amont: 100 currency:USD Back to O…

A script to test MySQL port is running

95 Leave a Comment
#!/bin/bash ip="<MySQL HOST>" port="<MySQL PORT>" output_file="<Log File Path>" while : do nc -zv "$ip" "$port" > /dev/null datetime=$(date +"%Y-%m-%d %H:%M:%S") if [ $? -eq 0 ]; then echo "$datetime: Port $port is open on $ip…

From PHP to Python In 10 Minutes

132 , Leave a Comment
PHP and Python are both high-level, interpreted programming languages with a variety of applications, but they have some significant differences in terms of syntax, design philosophy, and use cases. Here's a detailed comparison of the two languages: 1. Purpose and Use Cases PHP: Created by Rasmus Lerdorf in 199…

How to compress mp4 in one command with ffmpeg

94 , Leave a Comment
With ffmpeg, we can create a free video compresser on our local machine. First, create a shell function on you .bashrc or .zshrc: function mp4-compress() { filename=$(basename -- "$1") extension="${filename##*.}" name="${filename%.*}" ffmpeg -i "$1" -vcodec libx265 -crf 2…

How to transfer data between different mongodb instance?

68 Leave a Comment
Here is the python code to transfer data between different mongo instance: def transfer(source_collection, dest_collection, batch_size: int): offset = 0 total = source_collection.count_documents({}) total_inserted = 0 while True: documents = source_collection.find().skip(offset).limit(batch_size) data = list(do…
« Previous Page   Next Page »