白日依山尽,黄河入海流。欲穷千里目,更上一层楼。 -- 唐·王之涣

Hexo错误集合

整理hexo遇到的各种问题和解决办法


ERROR Deployer not found: git

遇到问题

升级hexo之后,执行`hexo d` 遇到问题如下:
hexo  ERROR Deployer not found: git

解决

npm install hexo-deployer-git --save

hexo next主题博客在本地显示正常,github内容空白的问题

遇到问题

copy原有的hexo项目升级之后,推送最新的代码到github,结果hexo next主题博客在本地显示正常,deploy到github上后只显示框架,内容空白的问题

解决

进入next主题的source目录,将vendors文件的文件名改成任意其他名字,如:lcvendors

vim themes/next/_config.yml
vendors:
  # Internal path prefix. Please do not edit it.
  _internal: lcvendors

然后
    hexo clean
    hexo g
    hexo d

参考

xiangwanpeng的CSDN博客

Error: Cannot find module ‘./build/Release/DTraceProviderBindings

这里提示是DTraceProviderBindings模块没有安装

npm install -g dtrace-provider

之后再执行 Hexo 相关的命令,但是报上面的错误。

解决

执行下面的命令安装,即可解决
install hexo --no-optional

待续…


公众号: DailyJobOps DailyJobOps

Flask的config使用总结

针对项目的不同, flask 可以采用不同配置方式来快速开发

直接配置

app.config['HOST'] = 'www.baidu.com'
app.config.update(
    'HOST' = 'www.baidu.com',
    'PORT' = 3306
)

查看具体的配置 print app.config.get('HOST')

通过环境变量加载

export MyAppConfig='/etc/flask-setting.cfg'

app.config.from_envvar('MyAppConfig')
阅读更多

Nginx - Centos下Nginx报错集合

整理Centos系统下Nginx遇到的问题,一遍后续排查问题方便


[emerg] could not build the server_names_hash…

开始使用nginx只有一个虚拟主机,默认server_name 会使用 localhost, 今天配置nginx的server_name是一个正式存在的域名的时候,报错如下:

root@pts/0 $ nginx -t
nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
nginx: configuration file /etc/nginx/nginx.conf test failed

How to fix

在nginx的配置文件nginx.conf的http段添加如下配置:

# vi /etc/nginx/nginx.conf
...
http {
        ...
        server_names_hash_max_size 512;
        server_names_hash_bucket_size 128;
        ...
}
...

root@pts/0 $ nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

nginx官方对server_name的说明请参考 链接

公众号: DailyJobOps DailyJobOps

python配置tab自动不全

有时候Centos系统默认安装的python进入交互模式下不能使用tab快捷键功能,这个时候需要自己进行相关配置
阅读更多

Hexo配置评论统计搜索

Hexo搭建好之后,可以编写markdown文档,渲染之后就可以生成静态页面博客,如果此时能有评论模块可以增加和同行之间的互动和知识交流,能有访问统计等,只能知道那篇博客的内容更受大家欢迎等等。
阅读更多

Centos下pyenv安装python多版本(增强版)

在学习和利用python开发的很多情况下,需要多版本的Python并存。此时需要在系统中安装多个Python,但又不能影响系统自带的 Python。pyenv 就是这样一个 Python 版本管理器
阅读更多

Centos下python纯净虚拟环境

实际python开发中,可能并行的有多个python项目的开发,他们用到的python版本可能不一样,这个时候就`需要有多个相互不依赖的环境来运行多个python项目`,`virtualenv` 就刚好满足这个需求
阅读更多

一款图形化memcache监控工具

对于memcache监控,一般可以利用memcache自带的`STAT`命令来查看,但是其输出的结果对于开发而言不是很明了,监控的目的是让开发通过监控的结果去调优程序。这里介绍一款形化memcache监控工具 - memcachephp
阅读更多