创建mysql数据库一句话

2022-07-25 15:15:12

create database [数据库名称] default character set utf8mb4 collate utf8mb4_general_ci;
create table docliste (
    `id` varchar(20) not null,
    `title` varchar(500) null comment '标题',
    `cateid` varchar(50) null comment '关联的类型',
    primary key (`id`) using btree 
) engine =InnoDB character set = utf8mb4 collate = utf8mb4_general_ci row_format=Dynamic;
linux 批量kill 进程

2022-07-21 11:02:00

ps -ef|grep tomcat|grep -v grep|awk '{print $2}'|xargs kill -9
vsftp 创建目录无权限

2022-07-16 23:37:30

该给的都给了,该放的都放了,端口啥的都没问题,最后就是不行。 我这边的问题是这样的。 创建了 ftpadmin 用户,他的主目录是 /home/ftpadmin 但是我定义的他的目录是 /mnt/ftpadmin 然后设定在了 vsftp.conf 文件中,最终通过一遍一遍的尝试,发现了这个问题...

如果实在不行,文件夹就别换了,用默认的吧。

linux 测试硬盘4k读写速度

2022-07-13 17:58:05

mkdir /root/test
# 写入速度
time dd if=/dev/zero of=/root/test/out bs=4k oflag=direct count=500000

# 读取速度
time dd if=/root/test/out of=/dev/null bs=4k
Linux查看某天创建的文件

2022-07-13 15:53:44

find . -newermt '2022-07-02' ! -newermt '2022-07-3'

find . -mtime 10

-mtime n : n为数字,意思为在n天之前的“一天之内”被更改过内容的文件

-mtime +n : 列出在n天之前(不含n天本身)被更改过内容的文件名

-mtime -n : 列出在n天之内(含n天本身)被更改过内容的文件名

win10查看曾经链接过的wifi密码

2022-06-30 15:46:32

netsh wlan show profile "qingdao" key=clear
好看的字体

2022-06-28 09:20:40

个人在浏览的时候碰到的觉的好看的字体

x-locale-heading-primary,zillaslab,Palatino,"Palatino Linotype",x-locale-heading-secondary,Source Han Serif SC,STZhongsong,simsun,serif
beauty, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji
常用正则整理

2022-06-22 17:43:57

# 校验数字,最多3位正整数(不限制0开头) ,小数最多两位

/^\d{1,3}(\.\d{1,2})?$/

ffmpeg提取截图关键帧

2022-06-22 07:57:42

ffmpeg -i /data/video_1.mp4 -f image2  -vf fps=fps=1/60 -qscale:v 2 /data/mp4-%05d.jpeg

批量截图

#!/usr/bin/env bash
 
videos_root=/data/videos
save_root=/data/video_imgs/Image_fps50/
for video in $videos_root/*;
do
echo $video
save_dir=$save_root$(basename $video .avi)
if [ ! -d $save_dir ];then
mkdir $save_dir
fi
ffmpeg -i $video -f image2  -vf fps=fps=50 -qscale:v 2 $save_dir/mp4-%05d.jpeg
 
done
podman exec

2022-06-02 10:16:56

podman exec -it ql /bin/bash

部分容器没有bash 无法进入

podman exec -it ql /bin/sh
https 自签名-nginx 自签名证书 配置 https

2022-05-20 15:29:39

最近在研究nginx,整好遇到一个需求就是希望服务器与客户端之间传输内容是加密的,防止中间监听泄露信息,但是去证书服务商那边申请证书又不合算,因为访问服务器的都是内部人士,所以自己给自己颁发证书,忽略掉浏览器的不信任警报即可。下面是颁发证书和配置过程。

1、首先确保机器上安装了openssl和openssl-devel

# yum install openssl
# yum install openssl-devel

2、生成证书

首先,进入你想创建证书和私钥的目录,例如:
# cd /etc/nginx/

创建服务器私钥,命令会让你输入一个口令:
# openssl genrsa -des3 -out server.key 2048

创建签名请求的证书(CSR):
# openssl req -new -key server.key -out server.csr

在加载SSL支持的Nginx并使用上述私钥时除去必须的口令:
# cp server.key server.key.org
# openssl rsa -in server.key.org -out server.key
最后标记证书使用上述私钥和CSR:
# openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt

3、配置Nginx,让其包含新标记的证书和私钥

server {
    server_name YOUR_DOMAINNAME_HERE;
    listen 443;
    ssl on;
    ssl_certificate server.crt;
    ssl_certificate_key server.key;
}
shell 获取进程id pid

2022-04-14 21:43:12

ps -ef | grep "name" | grep -v grep | awk '{print $2}'

pgrep -f name

pidof name

# 根据进程杀掉
pkill -f name

openssl 转换 pem 为 crt

2022-03-24 11:56:26

openssl x509 -outform der -in your-cert.pem -out your-cert.crt
mysqldump 常用命令

2022-03-05 20:57:32

-- 所有数据库
mysqldump -uroot -p --all-databases > /backup/mysqldump/all.sql

-- 指定数据库
mysqldump -uroot -p test > /backup/mysqldump/test.sql

-- 备份指定数据库指定表(多个表以空格间隔)
mysqldump -uroot -p  mysql db event > /backup/mysqldump/2table.sql

ffmpeg抽取视频中的音频流

2022-02-16 15:30:14

从视频中提取音频

ffmpeg -i input.mp4 -f mp3 -vn output.mp3

将音频从某个时间开始切割

ffmpeg -i input.mp3 -ss 03:01 -t 10 output.mp3

将多个音频拼接为一个

ffmpeg -i xiao2.mp3 -i xiao3.mp3 -i xiao4.mp3 -filter_complex '[0:0] [1:0] [2:0] concat=n=3:v=0:a=1 [a]' -map [a] 44.mp3

将多个音频混合为一个

ffmpeg -i xiao2.mp3 -i xiao3.mp3 -i xiao4.mp3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 -f mp3 3.mp3
centos 密码设置及过期问题

2022-01-06 09:23:11

# 修改密码
passwd ftpadmin
# 然后输入密码,重设

# 设置用户密码过期时间
chage -M 99999 ftpadmin

# 查看用户过期时间
chage -l ftpadmin
贝塞尔曲线公式

2022-01-04 23:29:28

高阶看不懂,先记录一个二阶的贝塞尔曲线公式

B(t) = (1-t)^2P0 + 2t(1-t)P1 + t^2P2

//js 实现
function bezier(posa, posb, posc, t) {
    let x = (1 - t) ** 2 * posa.x + 2 * t * (1 - t) * posb.x + t ** 2 * posc.x;
    let y = (1 - t) ** 2 * posa.y + 2 * t * (1 - t) * posb.y + t ** 2 * posc.y;
    return { x, y };
}
linux 查大文件

2021-09-28 11:30:06

find . -type f -size 100M -print0 | xargs -0 ls -l
du -ht 100M /mnt
hyper-v 安装linux 报错 start pxe over ipv4

2021-06-26 16:52:23

创建虚拟机的时候选择了第二代,需要将安全-安全启动禁用,重新启动即可。

jin-yufeng/parser mp-html 对textarea 不显示

2021-05-12 14:17:57

以前是parser , 后来换了mp-html ,都是同一个人的,mp-html 版本比较新,但是也不行。需要修改源码parser.js

blockTags : 增加 textarea
ignoreTags : 移除 textarea
voidTags : 增加 textarea
微信小程序开发,41001报错 wxvpkg

2021-05-12 09:34:14

左上角用户失效,重新登录。或退出重新登录。

人教数字微服务m3u8转mp4

2021-03-24 20:39:12

视频是有加密的,不过密钥是uri,可以直接通过m3u8 转为mp4 ,命令如下:

ffmpeg -i https://1252524126.vod2.myqcloud.com/9764a7a5vodtransgzp1252524126/3a09ffca5285890815650319442/drm/v.f146750.m3u8 -c copy -bsf:a aac_adtstoasc d:/mma.mp4
ffmpeg 转 ts 为 mp4

2021-03-23 13:49:13

ffmpeg -i xx.ts -c:v libx264 -c:a copy d:/11.mp4 
-c:v video编码
-c:a audio编码
mysql 更新索引时卡住查询不出来

2021-02-26 16:15:24

show full processlist;
//找到waiting xxxx 
kill xxid;
mogodb 下载页面

2021-01-20 11:00:11

http://dl.mongodb.org/dl/win32/x86_64 可以在该页面进行直接下载。

puppeteer 在centos7 调用报错libatk-bridge-2.0.so.0 libgtk-3.so.0

2020-12-16 15:01:14

参考: https://blog.csdn.net/github_38924695/article/details/107058061

//安装如下
yum install at-spi2-atk -y
yum install gtk3 -y
400 bad request The plain HTTP request was sent to HTTPS port

2020-12-10 10:38:04

项目为ssl环境,但总有个别请求是: http://xx.com:443/xx 这样访问的,导致报错。 nginx : 可以增加错误页面跳转

error_page 497 https://$host$request_uri;

或者在页面中增加meta,将调用的http请求升级成https请求并调用

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
ueditor样式复制进去后丢失

2020-12-04 14:40:18

在复制微信公众号文章到ueditor后section样式丢失。

//配置ueditor.config.js
whiteList:{
section : ['class','style']
}

增加classstyle 即可。

ffmpeg压缩mp4视频命令

2020-12-02 09:04:35

ffmpeg -i test.mp4 -r 10 -b:a 32k test_c.mp4

通过降低帧率和音频码率达到压缩目的。帧率10fps,码率32k.

nginx 二级目录代理

2020-11-30 15:59:11

需求:访问 http://xxx.com/pro ,通过nginx代理到服务器等于访问 http://localhost/ .

location /pro/ {
    proxy_pass http://127.0.0.1:9027/;
}

请注意 / 斜杆 , /pro/ 以及 9027/ ,都不可省略。