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,那麼現在是時候開始使用它了!
DBeaver Ultimate 22.1 旗舰版激活方法
本站惯例:本文假定你知道DBeaver。不知道可以问问搜索引擎。 DBeaver是一款优秀的数据库管理工具,支持管理众多数据库产品,巴拉巴拉。 DBeaver Ultimate(简称DBeaverUE)支持MongoDB、Redis、Apache Hive等,对比于DBeaver Enterprise多了连接云服务器的功能,但是需要付费使用。 这次要送的这份礼就是: DBeaverUE 22.1.0及以下版本(理论上适用于目前所有新老版本)的破解,可使用它来激活你手头上的DBeaverUE。 下载地址: 百度云下载(download link),提取码:hvx1。 OneDrive(download link) 具体使用方法已写在压缩包的README.txt内,有什么问题可以给我提Issue或进QQ群:30347511讨论。 按照README.txt配置好之后,使用DBeaverUE专用激活码: 1 2 3 4 5 aYhAFjjtp3uQZmeLzF3S4H6eTbOgmru0jxYErPCvgmkhkn0D8N2yY6ULK8oT3fnpoEu7GPny7csN sXL1g+D+8xR++/L8ePsVLUj4du5AMZORr2xGaGKG2rXa3NEoIiEAHSp4a6cQgMMbIspeOy7dYWX6 99Fhtpnu1YBoTmoJPaHBuwHDiOQQk5nXCPflrhA7lldA8TZ3dSUsj4Sr8CqBQeS+2E32xwSniymK 7fKcVX75qnuxhn7vUY7YL2UY7EKeN/AZ+1NIB6umKUODyOAFIc8q6zZT8b9aXqXVzwLJZxHbEgcO 8lsQfyvqUgqD6clzvFry9+JwuQsXN0wW26KDQA== DBeaverUE有几点需要注意的: windows 系统请使用ZIP包,下载链接:x64 mac 系统请使用DMG包,下载链接:intel / m1 linux 系统请使用.TAR.GZ包,下载链接:x64 DBeaver运行需要java,请自行安装! 不要使用DBeaver自带的jre,它被人为阉割了。 22.1版本请在dbeaver.ini文件末尾添加一行:-Dlm.debug.mode=true 请自行安装jdk11,替换dbeaver.ini内由-vm指定的java路径,把地址换成自己安装的! 如果你的dbeaver.ini内没有-vm参数,请在首行添加你安装jdk的java路径: 1 2 -vm /path/to/your/bin/java 下面是国际惯例: 本项目只做个人学习研究之用,不得用于商业用途! 若资金允许,请购买正版,谢谢合作! 本文作者: Neo Peng 本文链接: https://zhile.io/2019/05/09/dbeaver-ue-license-crack.html 版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-ND 4.0 许可协议。转载请注明出处!
Spring Boot Admin的介绍及使用
Spring Boot 有一个非常好用的监控和管理的源软件,这个软件就是 Spring Boot Admin。该软件能够将 Actuator 中的信息进行界面化的展示,也可以监控所有 Spring Boot 应用的健康状况,提供实时警报功能。 主要的功能点有: 显示应用程序的监控状态 应用程序上下线监控 查看 JVM,线程信息 可视化的查看日志以及下载日志文件 动态切换日志级别 Http 请求信息跟踪 其他功能点…… 可点击 https://github.com/codecentric/spring-boot-admin 更多了解 Spring-boot-admin。 创建Spring Boot Admin项目 创建一个 Spring Boot 项目,用于展示各个服务中的监控信息,加上 Spring Boot Admin 的依赖,具体代码如下所示。 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-server</artifactId> <version>2.0.2</version> </dependency> 创建一个启动类,具体代码如下所示。 @EnableAdminServer @SpringBootApplication public class App { public static void main(String[] args) { […]
Docker Dockerfile
什么是 Dockerfile? Dockerfile 是一个用来构建镜像的文本文件,文本内容包含了一条条构建镜像所需的指令和说明。 使用 Dockerfile 定制镜像 这里仅讲解如何运行 Dockerfile 文件来定制一个镜像,具体 Dockerfile 文件内指令详解,将在下一节中介绍,这里你只要知道构建的流程即可。 1、下面以定制一个 nginx 镜像(构建好的镜像内会有一个 /usr/share/nginx/html/index.html 文件) 在一个空目录下,新建一个名为 Dockerfile 文件,并在文件内添加以下内容: FROM nginx RUN echo ‘这是一个本地构建的nginx镜像’ > /usr/share/nginx/html/index.html 2、FROM 和 RUN 指令的作用 FROM:定制的镜像都是基于 FROM 的镜像,这里的 nginx 就是定制需要的基础镜像。后续的操作都是基于 nginx。 RUN:用于执行后面跟着的命令行命令。有以下俩种格式: shell 格式: RUN <命令行命令> # <命令行命令> 等同于,在终端操作的 shell 命令。 exec 格式: RUN [“可执行文件”, “参数1”, “参数2”] # 例如: […]