自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

逐月

技术博客

  • 博客(132)
  • 资源 (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 760

原创 常用排序查找算法

插入排序: 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 456

原创 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 44

原创 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 26

原创 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 119

原创 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 620

原创 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 203

原创 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 1190

原创 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 538

原创 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 7579

原创 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 1859

原创 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 89

原创 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 377

原创 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 123

原创 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 274

原创 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 509

原创 软件中的脚手架

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 268

原创 带有空格的文件名参数处理。

设置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 415

原创 pread() read only xxxx of yyyy

Refer to pread() read only xxxx of yyyy通常是读取正在修改的文件造成的。

2020-03-04 19:27:41 91

原创 nginx 访问频率限制 (limit_req_zone) 及白名单配置

https://www.nginx.com/blog/rate-limiting-nginx/

2020-03-03 10:08:01 937

原创 在服务器上搭建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 87

原创 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 1938

原创 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 136

原创 使用 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 114

原创 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 50

原创 python数学公式展示

参考Print latex-formula with python

2019-10-22 09:59:49 5863

原创 启用右键查看功能

参考How to re-enable right click so that I can inspect HTML elements in Chrome?

2019-10-21 15:37:03 119

原创 使用 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 1595

原创 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 267

原创 gitlab 403, 502问题解决方案

GitLab issuing temporary IP bans - 403 forbidden502 Gitlab is taking too much time to respond

2019-08-26 21:16:06 223

原创 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 3353

原创 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 9722

原创 对等端的证书有一个无效的签名。 错误代码: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 5405

原创 如何播放或拼接视频 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 2176

原创 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 2089 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 2183

原创 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 5819

原创 命令行艺术 ( the art of commad line )

Github: the-art-of-command-line实例:For web debugging, curl and curl -I are handy, or their wget equivalents, or the more modern httpie.To know current cpu/disk status, the classic tools are top (o...

2019-07-25 18:33:03 238

原创 df 与 du 输出磁盘使用情况不一致

五点多醒了,一看手机,收到了一堆网站磁盘告警信息,显示磁盘的占用情况82%,85%,…92%(每半个小时报警一次)。赶快打开电脑,登上服务器,查看磁盘占用情况。df -hFilesystem Size Used Avail Use% Mounted on/dev/vda1 40G 36G 4G 92% /sudo du -h -x --max-dep...

2019-07-11 09:23:27 186

原创 [Errno 256] No more mirrors to try [Errno 14] HTTP Error 404: Not Found

[Errno 256] No more mirrors to try[Errno 14] HTTP Error 404: Not Found解决方案,网络上大多上给出了方案一和二,但yum 不管执行什么指令都会报上面的错误。这时侯可以采用方案三。solution 1yum clean all or rm -rf /var/cache/yumyum makecacheyum upda...

2018-12-18 11:16:21 518

实时碰撞检测算法

实时碰撞检测算法技术源码。Christer Ericson 3D游戏 教程 碰撞检测

2014-06-06

cuda编程指南

cuda编程指南,GPU多线程技术。并行编程 cuda入门知识

2014-06-05

数据结构,清华大学

清华大学一套很详细数据结构的教程,讲述了常用数据结构,及其代码实现。

2014-06-06

计算机程序设计与艺术

图灵作品,计算机程序设计与艺术一至三卷全。 中文版

2014-06-03

计算机程序设计与艺术一至三册全

计算机程序设计与艺术一至三册全 适合于程序设计者

2014-06-03

ogre基础教程

一套基础的ogre入门教程,适用于初学者。 游戏基础教程 来自ogre3D开放教程

2014-06-01

比特币白皮书中文版(中本聪的论文)

比特币技术白皮书,详细介绍了比特币的原理,区块链的构成,签名的原理等

2018-03-21

gl studio 面板制作教程

gl studio 面板制作简易教程,入门及教程

2015-05-21

glee静态库

glee opengl 扩展库 方便opengl程序的编写

2015-05-20

opengl glee

opengl glee 扩展应用 opengl扩展库 图形绘制

2015-05-16

优酷视频的分辨率,宽度和高度是什么关系?

发表于 2019-12-10 最后回复 2020-04-01

TA创建的收藏夹 TA关注的收藏夹

TA关注的人 TA的粉丝

提示
确定要删除当前文章?
取消 删除