Docker Timezone Settings

【Notes】Docker Timezone Settings If we want to Dockerset hostthe same time zone internally, how should we set it? Quick Start Many people on the Internet said that containeryou can add the following command at startup: Method 1: -v /etc/localtime:/etc/localtime:ro Method 2: -and “TZ=Asia/Taipei” But sometimes it works, and sometimes it doesn’t work. Why? It depends on what you […]

A Tour of Python NLP Libraries

NLP, or Natural Language Processing, is a field within Artificial Intelligence that focuses on the interaction between human language and computers. It tries to explore and apply text data so computers can understand the text meaningfully. As the NLP field research progresses, how we process text data in computers has evolved. Modern times, we have […]

dump nginx memory

# Set pid of nginx master process here pid=8192 # generate gdb commands from the process’s memory mappings using awk cat /proc/$pid/maps | awk ‘$6 !~ “^/” {split ($1,addrs,”-“); print “dump memory mem_” addrs[1] ” 0x” addrs[1] ” 0x” addrs[2] ;}END{print “quit”}’ > gdb-commands # use gdb with the -x option to dump these memory […]

A high availability (HA) architecture using Keepalived and Nginx

Here’s an example configuration for setting up a high availability (HA) architecture using Keepalived and Nginx: Install Keepalived and Nginx on each server. Configure Keepalived on both servers: Edit the Keepalived configuration file (e.g., /etc/keepalived/keepalived.conf) on each server. Specify the virtual IP (VIP) address that will be used for HA. For example, set virtual_ipaddress to “192.168.0.100”. Configure […]

MySQL Master Slave Replication: 7 Easy Steps

1. Setting Up The Master The first thing you need to accomplish in the MySQL master-slave replication process is to install and configure the master server. If you have not installed MySQL, then you can install MySQL using the following command: root@repl-master:~# sudo apt-get update root@repl-master:~# sudo apt-get install mysql-server mysql-client -y root@repl-master:~# sudo mysql_secure_installation […]

Collect and visualize MySQL server logs with the updated MySQL integration for Grafana Cloud

Today, we are excited to announce that the MySQL integration has received an important update, which includes a new pre-built MySQL logs dashboard and the Grafana Agent configuration to view and collect MySQL server logs. The integration is already available in Grafana Cloud, our platform that brings together all your metrics, logs, and traces with Grafana for full-stack […]

關於Python 3虛擬環境(venv)

Python是一種流行的高級編程語言,廣泛用於Web開發、數據科學、人工智能等領域。為了保持Python的穩定性和可靠性,Python 3引入了venv(虛擬環境)的概念,這使得開發人員可以為每個Python應用程序建立獨立的環境,這些環境之間相互獨立,不會干擾彼此。 venv是Python 3的內置模塊,可以通過命令行創建和管理虛擬環境。下面我們將一步步介紹如何使用venv創建虛擬環境。 首先,打開命令行終端,進入你想要創建虛擬環境的目錄。然後運行以下命令: “` python3 -m venv myenv “` 這個命令將在當前目錄中創建一個名為“myenv”的虛擬環境。你可以將“myenv”替換為你想要的任何名稱。 接下來,啟動虛擬環境。在命令行中運行以下命令: – 在Windows中: “` myenv\Scripts\activate.bat “` – 在Mac或Linux中: “` source myenv/bin/activate “` 這會激活虛擬環境,你將看到命令行前面出現了虛擬環境的名稱。 現在你可以安裝你需要的Python庫或模塊。在虛擬環境中運行以下命令: “` pip install <package_name> “` 當你完成開發工作後,你可以退出虛擬環境。在命令行中運行以下命令: “` deactivate “` 這將退出虛擬環境,你將回到原來的Python環境。 總之,venv是一個非常有用的工具,它可以幫助開發人員管理Python應用程序的依賴性並避免版本衝突。如果你還沒有使用venv,那麼現在是時候開始使用它了!

ESP32 vs ESP8266 – Pros and Cons

What’s the difference between ESP32 and ESP8266? Should you use the ESP32 or the ESP8266 in your projects? In this article, we’ll compare the ESP32 with the ESP8266 and cover the pros and cons of each board. The ESP32 and ESP8266 are cheap Wi-Fi modules perfectly suited for DIY projects in the Internet of Things […]

Analog JoyStick with Arduino

The Analog Joystick is similar to two potentiometers connected together, one for the vertical movement (Y-axis) and other for the horizontal movement (X-axis). The joystick also comes with a Select switch. It can be very handy for retro gaming, robot control or RC cars. So let’s understand how it works! Basics The Arduino Uno or any other Arduino board that […]

Mac 安裝Secp256k1 no secp256k1 in java.library.path

報錯 #報錯提示 no secp256k1 in java.library.path 解決方案 使用 brew 安裝構建依賴項 brew install autoconf automake libtool berkeley-db4 pkg-config openssl boost boost-build libevent 下載secp256k1 #隨便找個地方clone就行 git clone [email protected]:bitcoin-core/secp256k1.git 構建secp256k1 #以下步驟都在clone的secp256k1 中進行 1. sh autogen.sh #這一步與github 中的不同,github 的還是會出錯,視情況輸入命令吧 2. ./configure –enable-module-recovery –enable-jni –enable-module-ecdh –enable-experimental 3. make 4. make check 5. sudo make install 6. 參考資料 secp256k1 Github 構建依賴項issue