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

重新安装msi center

之前因为性能问题卸载了dragon center,这个是msi center的前身可以认为。官方是这么介绍的:

DragonCenter是微星的一款集系统监测,LED灯光调节,系统环境设置。Dragon Center可以看作是Dragon Gaming Center的升级版,除了在UI界面上 进行了修改之外,在功能上也由原来的系统监测功能基础上增加了超频,灯光控制

不过这个破软件,做的那是真烂。上次见到这么烂的软件还是三星的kies客户端,感兴趣的可以搜一下。作为一个软件能做到这么烂,我觉得没有几个人能做到了。今天看杜老师发了篇文章,说设置灯光,于是又想起来这个破软件了。不过这次没从官网下直接从微软商店下载的。

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

是UPS吖(三)–-树莓派

装ups的另外一个目的就是为了保证树莓派的存储卡不会因为意外断电而出现问题。其实要解决这个问题个人觉得也简单,毕竟也是个linux啊。可以基于nut实现。

The primary goal of the Network UPS Tools (NUT) project is to provide support for Power Devices, such as Uninterruptible Power Supplies, Power Distribution Units, Automatic Transfer Switches, Power Supply Units and Solar Controllers. NUT provides a common protocol and set of tools to monitor and manage such devices, and to consistently name equivalent features and data points, across a vast range of vendor-specific protocols and connection media types.

NUT provides many control and monitoring features, with a uniform control and management interface. If you are just getting acquainted with NUT, that page also explains the technical design and some possible set-ups.

More than 170 different manufacturers, and several thousands of models are compatible.

https://networkupstools.org/index.html
Continue Reading

是UPS吖(二)–-群晖

开篇当然还是最喜欢的小姐姐啊。其实ups的安装还是非常简单的,不过后面的插孔都是3插,机柜上就安装了一排机柜插座,导致出现一个问题就是机柜内很多双口插头没地方插,本来想把边上的插排撤掉的,但是明显不行啊,两个光纤转换器插头+路由器+交换机的插头都没地方插,于是就把插排又给按上了。安装之后的效果就是下面这个样子啦。

Continue Reading

PyCharm 代码自动补全插件体验

代码自动补全这个功能还是比较需要的,尤其是大项目。在其他模块内定义的数据类型,如果没有代码自动补全写起来太麻烦了。比如django的model中定义的属性,写查询filter的时候,没有代码自动完成,就需要去找各个属性,更恶心的是外键的关联查询直接没有__补全的功能,就得去找对应关系。数据结构复杂了之后这个工作就变成了灾难。

目前使用过的主要有下面几个:

1.kite

Kite 是一家成立于 2014 年的创业公司,主要从事于开发同名的人工智能编程助手,就类似于大家熟悉的 GitHub Copilot。Kite 最初仅支持 Python 和 JavaScript 这两种编程语言,在 2020 年年底,Kite 额外支持了 TypeScript、Java、Go、C、C#、Kotlin 等编程语言,支持的编程语言一下上升到 13 种。Kite 还支持 16 种编辑器 / IDE,其中包括 VS Code、IntelliJ、Vim、Sublime Text 等,在这一点上支持的范围要高于 GitHub Copilot。

Continue Reading