也谈轻量云自动快照备份

之前在轻量云进行快照备份都是手工处理的,一般是升级系统或者版本发布的时候进行备份。但是这个备份机制有个比较麻烦的问题在于快照并不是非常及时。例如用户上传的头像文件,这些是存在服务器上的,手工备份就有点麻烦。

Continue Reading

由srv引发的智障bug

昨天晚上闲着没事,想着把moe counter的数据库从sqlite换成mongodb。最开始的安装还算顺利,找个教程照着也就装上了,不过比较坑爹的是按照教程的方法安装libssl之后还是提示错误,最终通过命令行提示的sudo apt –fix-broken install 解决了这个问题。

Continue Reading

ubuntu下php扩展的曲线救国计划

每次更换服务器,后续都会有很多的事情需要去处理。有的是服务器本身的问题,有的是各种配置问题。所以不到万不得已实在是不想更换服务器,下午看到杜老师的留言提到了litespeed cache,于是登录后台看了一眼,发现原来的redis缓存配置没有生效。问题也很容易定位,那就是没有安装php的redis扩展。正常的话通过apt就可以安装,但是问题出现了,工控机上php 和php-fpm不是同一个版本。

Continue Reading

ubuntu性能监视工具glances

Glances is a cross-platform monitoring tool which aims to present a maximum of information in a minimum of space through a curses or Web based interface. It can adapt dynamically the displayed information depending on the terminal size.

It can also work in client/server mode. Remote monitoring could be done via terminal, Web interface or API (XMLRPC and RESTful).

Glances is written in Python and uses the psutil library to get information from your system.

Stats can also be exported to external time/value databases.

Continue Reading

树莓派UPS自定义关机脚本(NUT)

NUT 树莓派自定义关机逻辑,上一篇文章太长了,拉出来一些:

默认关机逻辑貌似是:nut服务会在UPS发送LOWBATT时通知机器关机,触发时机默认为ups电量剩余20%

如果要自定义关机设置需要进行如下设置(因为群辉提供的ups服务器在ups断电之前就关闭了,不清楚服务器在关机之前是不是会发送lowbatt消息)

1.编辑upsmon.conf,添加以下内容:

vim /etc/nut/upsmon.conf
NOTIFYCMD /sbin/upssched
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC

Continue Reading