- 博客(135)
- 资源 (10)
- 论坛 (1)
- 问答 (4)
- 收藏
- 关注

原创 markdown special symbols(特殊字符)
markdown 下公式中特殊字符的输入 $\Theta(nlgn)$ 对应 Θ(nlgn)Θ(nlgn)\Theta(nlgn)更多请参考: http://www.math.harvard.edu Special Symbols
2018-05-26 16:53:54
787

原创 常用排序查找算法
插入排序: 1. 从第二个数开始,依次跟左边的数进行比较,直到找到不大于正在插入的数字或者到达序列头部时,进行插入。 2. 原址排序 def insertion_sort(arr): for i in range(1, len(arr)): k = arr[i] j = i - 1 while j > -1...
2018-05-26 16:44:53
468
原创 gitlab安装,备份,使用自建服务器,以及常见问题的解决方案。
参考Gitlab Docinstall-and-configure-gitlab-on-centos-7如果全新的安装会很容易,再已安装的机器上再次安装时,会有很多莫名奇妙的问题。这时可以通过安装时的提示,以及参考/var/log/gitlab下的日志来定位问题安装前一定要清理完之前的版本(好多问题可以清理重新从头安装来解决)使用yum info gitlab-ce确认,使用yum remove gitlab-ce移除使用rpm -qa | grep gitlab确认,使用rpm -e gitl
2020-12-31 18:45:42
71
原创 不中断服务在线平滑升级nginx (CentOS)
在对网站服务器进行漏洞扫描时,发现了一个较严重的漏洞 SSL/TLS协议信息泄露漏洞(CVE-2016-2183)查看下同的openssl 版本$ openssl versionOpenSSL 1.0.2k-fips 26 Jan 2017系统使用的 nginx, 查看nginx编译用的OpenSSL版本$nginx -Vnginx version: nginx/1.16.1built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)built
2020-12-25 18:56:15
879
2
原创 worker_connections are not enough
在nginx的配置文件中/etc/nginx/nginx.conf修改worker_connections, 参考worker_connections are not enoughevents { worker_connections 20000;}
2020-09-29 20:57:33
105
原创 nginx accept() failed (24: Too many open files)
在nginx的配置文件中/etc/nginx/nginx.conf修改worker_rlimit_nofile,参考nginx loadbalancer Too many open files 和Too many open files with nginx, can’t seem to raise limitworker_rlimit_nofile 30000;可以切换到nginx用户下(比如nginx,nobody,www等), 使用ulimit查看是否生效su - nobodyulimit
2020-09-29 20:56:56
49
原创 MongoDB: ERROR: child process failed, exited with error number
参考:SO: MongoDB: ERROR: child process failed, exited with error numberCheck if the mongod is running with pgrep mongod or ps -aef | grep mongod or systemctl status mongodStop and restart it to check if the issue goneif you start mongod with mongod -f /et
2020-07-30 14:42:15
131
原创 SSH passwordless login(免密登陆)
linux,windows 都一样。下面以windows为例:生成密钥对$ ssh-keygenGenerating public/private rsa key pair.Enter file in which to save the key (/c/Users/user/.ssh/id_rsa): ./id_rsa_ss1Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identifi
2020-07-24 17:03:42
860
原创 Why is this rsync connection unexpectedly closed on Windows?
参考:SO: Why is this rsync connection unexpectedly closed on Windows?rsync.exe -avz -e 'ssh -p 22' user@example.com:/home/user/testfileuser@example.com's password:rsync: connection unexpectedly closed (0 bytes received so far) [sender]rsync error: error
2020-07-24 14:34:02
258
原创 nginx: [emerg] “proxy_pass“ cannot have URI part in location given by regular expression, or inside
参考SO: nginx ‘proxy_pass’ cannot have URI part in location?使用下面的配置会出现上面的问题location ~ ^/web/(project1|project2|project3)/$ { proxy_pass https://example.com/h5/;}原因:nginx cannot process your desired URI part in the proxy_pass directivebecause you’re
2020-07-24 09:49:56
1523
原创 nginx 路径替换
下面使用一个简单的例子来说明路径替换,配置了两个路径指向同一个项目。location ^~ /internal/project/ {allow 127.0.0.1;allow 172.16.0.0/16;allow 172.17.93.0/24;deny all;proxy_pass https://example.com/external/project/;}location ~ /external/ {root /var/www/html;index index.html;}Pr
2020-07-24 09:40:17
797
原创 auditd Unregistered Authentication Agent for unix-process
sudo systemctl restart auditd> Failed to restart auditd.service: Operation refused, unit> auditd.service may be requested by dependency only (it is configured> to refuse manual start/stop). See system logs and 'systemctl status> auditd.ser
2020-07-08 20:56:18
10514
原创 pam_succeed_if(sshd:auth): requirement “uid 」= 1000“ not met by user “root“
有下面两种情形:cat /etc/shadow | grep root 查看root用户是否被锁定。如果出现 root:!!$6$CG (注意其中的!!)则说明root用户被锁定,不能登陆。解决方案:passwd -u root 解除用户锁定。查看PAM配置文件/etc/pam.d/login, /etc/pam.d/sshd /etc/pam.d/system-auth中是否有 auth required pam_succeed_if.so uid >= 1000;修改或者注释该
2020-07-07 15:34:13
2531
原创 Centos setting password for user, but still can‘t log in on it
Refer to : Centos setting password for user, but still can’t log in on itUse another to check the log by with sudo tail -f /var/log/secureIt shows something like this,Jul 4 16:24:06 iz2ze86eplnjdk8exdjimjz sshd[17288]: pam_tally2(sshd:auth): user lv (1
2020-07-07 15:19:54
99
原创 Error response from daemon: OCI runtime create failed
Refer to StackOverflow:docker: Error response from daemon: OCI runtime create failed: unable to retrieve OCI runtime errorTo check the issue by run docker in the debug mode.1: stop docker with systemctl stop docker2: run docker in debug mode dockerd -
2020-07-07 15:18:23
631
原创 mysql查询各组最近一条记录
select max(record_id),record_name,user_id from sc_records group by user_id order by null.SQL Show most recent record in GROUP BY?Retrieving the last record in each group - MySQL
2020-06-06 09:39:25
130
原创 mysql计算累加和
使用变量来计算累加和set @csum := 0;select id, count, (@csum := @csum + count) as cumulative_sumfrom YourTableorder by id;参考 Create a Cumulative Sum Column in MySQL
2020-05-07 10:50:29
339
原创 nginx: [emerg] a duplicate default server for
StackOverflow: nginx: [emerg] a duplicate default server forGithub: Error: duplicate listen options for [::]:443 #5550
2020-04-22 16:20:31
641
原创 软件中的脚手架
Scaffolding generally refers to a quickly set up skeleton for an app. It’s not rails-only since other platforms have it as well. It’s also not generally meant to be a “final” system;简单描述为:脚手架是用来快速搭建一...
2020-04-14 18:30:04
308
原创 带有空格的文件名参数处理。
设置IFS为\n(IFS=$'\n'; ffmpeg -i $file) 处理文件名为my video.mp4的视频文件。FFmpeg Error ( no such file or directory error)Bash and filenames with spacesLooping through files with spaces in the names? [duplic...
2020-04-11 10:07:35
460
原创 pread() read only xxxx of yyyy
Refer to pread() read only xxxx of yyyy通常是读取正在修改的文件造成的。
2020-03-04 19:27:41
100
原创 nginx 访问频率限制 (limit_req_zone) 及白名单配置
https://www.nginx.com/blog/rate-limiting-nginx/
2020-03-03 10:08:01
1057
原创 在服务器上搭建git仓库
在本地项目中导出裸仓库 git clone --bare ./ ../project_name.git上传到服务器上pscp -r ../project_name.git user_name@ip_or_hostname:/git_path/在本地仓库中设置服务端的git地址git remote add origin user_name@ip_or_hostname:/git_path/pr...
2019-12-26 15:28:09
98
原创 elasticsearch 7 批量删除文档。
参考 StackOverflow 问题Delete all documents from index/type without deleting type 的 回答curl -XPOST 'localhost:9200/materials/_delete_by_query?conflicts=proceed&pretty' -H 'Content-Type: application/j...
2019-12-12 20:31:29
2237
原创 com.mysql.jdbc.Driver not loaded 或者 com.mariadb.jdbc.Driver not loaded
logstash Error: com.mariadb.jdbc.Driver not loadedCannot load driver class: com.mysql.jdbc.Driver Spring
2019-12-06 18:20:54
152
原创 使用 SQL 进行排名搜索
参考 Ranked search with SQL计算term的出现次数。SELECT SUM(((LENGTH(Body) - LENGTH(REPLACE(Body, 'term', '')))/4)) AS Occurrences以次数进行排序。SELECT SUM(((LENGTH(Body) - LENGTH(REPLACE(Body, 'term', '')))/4) ...
2019-11-09 17:20:21
119
原创 PHP从周数创建DateTime
参考:How to create datetime from week number$date = (new DateTime())->setISODate($year,$week,$day)->setTime($hour,$minute,$second,$microseconds);
2019-11-09 17:08:58
57
原创 启用右键查看功能
参考How to re-enable right click so that I can inspect HTML elements in Chrome?
2019-10-21 15:37:03
125
原创 使用 let's encrypt, certbot 生成 https 证书常见问题
sudo certbot certonly --cert-name example.com1.Problem binding to port 80: Could not bind to IPv4 or IPv6.停止nginx等服务, Refer to Letencrypt renewal fails: Could not bind to IPv4 or IPv6… Skipping2.Fa...
2019-09-03 12:05:21
1741
原创 mysql主从复制,server 或 Docker容器
mysql set up replication refer to Mysql docOn master check if logging binary enabled:show variables like 'log_bin', refer to how to know if mysql binary log is enable through sql command?1.Config m...
2019-09-03 10:26:42
274
原创 gitlab 403, 502问题解决方案
GitLab issuing temporary IP bans - 403 forbidden502 Gitlab is taking too much time to respond
2019-08-26 21:16:06
237
原创 Filebeat 日志不输出
Config logging[WARNING] When Filebeat is running on a Linux system with systemd, it uses by default the -e command line option, that makes it write all the logging output to stderr so it can be captu...
2019-08-26 11:18:11
3586
原创 Filebeat 连接 Logstash 常见问题。
Failed to connect to backoff(async(tcp://ip:5044)): dial tcp ip:5044: i/o timeoutFailed to connect to backoff(async(tcp://ip:5044)): dial tcp ip:5044: connect: connection refusedFailed to publish e...
2019-08-26 11:12:50
10591
原创 对等端的证书有一个无效的签名。 错误代码:SEC_ERROR_BAD_SIGNATURE
配置 Fiddler 抓取 Https 请求时遇到了这个问题。cmd 下输入 certmgr.msc > 操作 > 查找证书,然后输入 Fiddler 搜索,选中所有搜索出的证书;清空 C:\Users\Dell\AppData\Roaming\Microsoft\Crypto\RSA 下的文件;卸载 Fiddler;火狐 选项 > 隐私与安全 > 证书 > ...
2019-08-13 10:58:00
5837
原创 如何播放或拼接视频 ts
对于文件名有序的 ts 文件如 xxxxx_1.ts, xxxxx_2.ts,… 就很容易处理。使用如下指令就可以 cat *.ts | ffmpeg -i pipe: -c:a copy -c:v copy out.mp4 ,可以参考我对这个 Use ffmpeg copy codec to combine *.ts files into a single mp4 问题的回答。对于无序的 ts...
2019-08-06 08:59:42
2362
原创 git查看函数修改历史
追踪一个函数的变更历史可以使用 I want to view the commit history for a specific functiongit log -L :FunctionName:FilePath这条指令可能对类似C语言适用,对于其他语言git也提供了相应的支持,需要配置一下。参考:generating diff textGit - how do I view the ...
2019-07-30 20:11:09
2266
9
原创 如何将多个指令的输出合并到一行输出?
有时候为了清晰会将多个指令的结果合并在一行中显示,比如查看文件及属性的命令 ls 和 file,单独使用时ls --full-time -h-rwxr-xr-x 1 lufei www 7.5M 2019-07-09 14:23:48.041432487 +0800 1.mp4-rw-r--r-- 1 lufei www 3.1M 2019-07-09 14:24:17.872506355...
2019-07-27 09:12:43
2358
原创 Moov itom not found 详解及修复。
moov atom 是什么?understanding the mpeg4 movie atom (moov atom)怎么修复?Untrunc(better than recover_mp4_to_h264) SORestore a damaged (truncated) mp4, m4v, mov, 3gp video. Provided you have a similar ...
2019-07-27 08:35:21
6334
优酷视频的分辨率,宽度和高度是什么关系?
发表于 2019-12-10 最后回复 2020-04-01
TA创建的收藏夹 TA关注的收藏夹
TA关注的人 TA的粉丝