首先要安装 mysqlclient,apt install mysql-client。 然后使用里面的 mysqldump 工具。 命令格式示例如下 mysqldump -h127.0.0.1 --port=端口 -uroot -p密码 --databases 数据库名称 > /var/bak/aaa.sql 不得不说备份速度极快。 示例命令: filename=`date +%Y%m%d_%H%M%S` mysqldump -h127.0.0.1 --port=3306 -uroot -p123456 --…

2022年1月21日 2条评论 3267点热度 0人点赞 痴者工良 阅读全文

首先要安装 mysqlclient,apt install mysql-client。 然后使用里面的 mysqldump 工具。 命令格式示例如下 mysqldump -h127.0.0.1 --port=端口 -uroot -p密码 --databases 数据库名称 > /var/bak/aaa.sql 不得不说备份速度极快。 示例命令: filename=<code>date +%Y%m%d_%H%M%S</code> mysqldump -h127.0.0.1 --port=…

2022年1月21日 2条评论 3247点热度 0人点赞 痴者工良 阅读全文

Recently, I migrated my blog system, which involved Nginx, SSL certificates, a MySQL database, and various WordPress files. After quite a bit of effort, to avoid potential issues with server failures in the future, I started a Raspberry Pi at home and used rsy…

2022年1月21日 0条评论 3232点热度 0人点赞 痴者工良 阅读全文

最近将博客系统迁移,有 Nginx,ssl证书,mysql数据库和 wordpress 各类文件,折腾了一番。 为了避免后续服务器故障等问题,在家里启动树莓派,对博客所在的服务器使用 rsync 做定期备份。 树莓派使用自带的 cron 服务,做定期启动任务。 打开 /etc/cron.d 目录,然后创建一个文件,文件不需要后缀名称。 如:bakblog。 文件内容分为三部分,cron时间表达式 + 以某个用户启动任务 + 执行的命令。 但是 这里 cron 的时间表达式,是 5 位,没有 秒和周。 示例如下,此任…

2022年1月21日 0条评论 3226点热度 0人点赞 痴者工良 阅读全文

About Neting Initially, I planned to use Microsoft's official Yarp library to implement an API gateway, but later found it quite cumbersome and decided to abandon that approach. Currently, I have completed the basic functionalities, such as viewing Kubernetes …

2022年1月17日 0条评论 86点热度 0人点赞 痴者工良 阅读全文

关于 Neting 刚开始的时候是打算使用微软官方的 Yarp 库,实现一个 API 网关,后面发现坑比较多,弄起来比较麻烦,就放弃了。目前写完了查看 Kubernetes Service 信息、创建 Route 和 Cluster 和绑定 Kubernetes Service。简单来说,就是完成了基础部分,配置路由和后端服务绑定,如果想实现动态路由和直接转发等功能,只需要按照官方的文档,增加中间件即可。 原本打算使用 .NET 6 的 AOT(一共40MB) ,但是打包运行会容易出现一些依赖问题和环境问题,因此放…

2022年1月17日 0条评论 2601点热度 0人点赞 痴者工良 阅读全文

HammerDB is a database stress testing tool, download link: https://www.hammerdb.com/download.html HammerDB is a leading benchmark and load testing software for some of the most popular databases in the world, supporting Oracle Database, SQL Server, IBM Db2, My…

2022年1月17日 1条评论 5497点热度 1人点赞 痴者工良 阅读全文

Hammerdb 是一个数据库压力测试工具,下载地址: https://www.hammerdb.com/download.html HammerDB 是领先的基准测试和负载测试软件,适用于世界上最流行的数据库,支持 Oracle 数据库、SQL Server、IBM Db2、MySQL、MariaDB 和 PostgreSQL。 TPROC-C 基准测试; TPROC-H 全套测试; 首先创建需要的数据库测试,然后 点击 Schema Build - Options ,配置数据库连接。这里笔者创建的是 TPROC…

2022年1月17日 1条评论 5519点热度 1人点赞 痴者工良 阅读全文

Installed Mysql/MariaDB, but I cannot log in as root; I can only use the mysql account to get in. [root@192-168-0-241 ~]# mysql -u mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 10.3.32-MariaDB-…

2022年1月13日 1条评论 5062点热度 2人点赞 痴者工良 阅读全文

安装了 Mysql/MariaDB ,但是 root 死活进不去,只能用 mysql 这个账号进去。 [root@192-168-0-241 ~]# mysql -u mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 10.3.32-MariaDB-log MariaDB Server Copyright (c) 2000, 2018, Or…

2022年1月13日 1条评论 5104点热度 2人点赞 痴者工良 阅读全文

scanme.nmap.org is the domain or IP address to be scanned. package main import ( "fmt" "net" "sort" ) func main() { ports := make(chan int, 100) results := make(chan int) var openports []int // Start 100 worker threads for i := 0;…

2021年11月17日 0条评论 84点热度 0人点赞 痴者工良 阅读全文

scanme.nmap.org 是要扫描的域名或 IP 地址。 package main import ( "fmt" "net" "sort" ) func main() { ports := make(chan int, 100) results := make(chan int) var openports []int // 开启 100 个工作者线程 for i := 0; i < cap(ports); i++ { go worker(ports, results) } // 向[......]继续…

2021年11月17日 0条评论 2316点热度 0人点赞 痴者工良 阅读全文

reflect.Type.Elem() can return the type of the element, for example, for pointer types, it returns the type without the pointer. reflect.Value.Elem() is used to obtain a reference to the value that the pointer points to. type name struct { } func (n name) Prin…

2021年11月16日 0条评论 62点热度 0人点赞 痴者工良 阅读全文

reflect.Type.Elem() 可以返回元素的类型,例如指针类型,返回不带指针的类型。 reflect.Value.Elem() 是获取指向值的引用。 type name struct { } func (n name) Print(str string) { } func main() { var n interface{} = &name{} t := reflect.TypeOf(n) var na interface{} // 实例化 if t.Kind() == reflect.Ptr {…

2021年11月16日 0条评论 2594点热度 0人点赞 痴者工良 阅读全文

/// <summary> /// Convert between value types and strings /// </summary> public class JsonStringToNumberConverter : JsonConverterFactory { /// <summary> /// Gets the default instance /// </summary> public static JsonStringTo[......]继续阅读

2021年11月3日 1条评论 82点热度 0人点赞 痴者工良 阅读全文

||其代码如下: /// <summary> /// 值类型和字符串互转 /// </summary> public class JsonStringToNumberConverter : JsonConverterFactory { /// <summary> /// 获取默认实例 /// </summary> public static JsonStringToNumberConverter Default { get; } = new J[......]继续阅读

2021年11月3日 1条评论 2990点热度 0人点赞 痴者工良 阅读全文

In the context of Linux, here's how to invoke a command-line program in Go, with the example code as follows: package main import ( "log" "os" "os/exec" ) func main() { cmd := exec.Command("top") cmd.Stdin = os.Stdin cmd…

2021年10月5日 0条评论 3073点热度 2人点赞 痴者工良 阅读全文

以 Linux 为例,在 Go 中调用一个命令行程序,其代码示例如下: package main import ( "log" "os" "os/exec" ) func main() { cmd := exec.Command("top") cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Run(); err != nil { log.Fatal(err) } } 首先使用 cmd[......] 继…

2021年10月5日 0条评论 3067点热度 2人点赞 痴者工良 阅读全文

Manjaro prompts when updating or installing software: 正在下载所需的密钥...... :: 是否导入 PGP 公钥 A85E811EB4CA2E08 ,"Caleb Maclennan <alerque@archlinux.org>"? [Y/n] y :: 是否导入 PGP 公钥 E0959FEA8B550539 ,"George Rawlinson <grawlinson@archlinux.org>&q…

2021年10月5日 0条评论 8619点热度 7人点赞 痴者工良 阅读全文

Manjaro 更新软件、安装软件时,提示: 正在下载所需的密钥...... :: 是否导入 PGP 公钥 A85E811EB4CA2E08 ,"Caleb Maclennan <alerque@archlinux.org>"? [Y/n] y :: 是否导入 PGP 公钥 E0959FEA8B550539 ,"George Rawlinson <grawlinson@archlinux.org>"? [Y/n] y y( 71/771) 正在检查软件包完整性[......]继续阅读

2021年10月5日 0条评论 8579点热度 7人点赞 痴者工良 阅读全文
1192021222354