2016年7月26日星期二

proc的pc里面,注释里面不要放引号

比如
// if zhangshan's xxx
这样的注释,编译老报莫名其妙的错误
PCC-S-02010, found end-of-file while scanning string literal
Error at line 0, column 0 in file transtp1.pc
PCC-F-02102, Fatal error while doing C preprocessing

2016年7月11日星期一

rhel dmesg加上时间

http://gabrieleg.altervista.org/enabling-timestamps-for-dmesg-kernel-ring-buffer/

临时的,只需要执行
echo Y > /sys/module/printk/parameters/time
就可以
永久的,
可以修改/boot/grub/grub.conf
追加上printk.time=1,注意等号两边不要与空格。

这样dmesg的前面就有了Unix Timestamp,要转换为我们可以读取的,还需要转换一下。
https://linuxaria.com/article/how-to-make-dmesg-timestamp-human-readable
https://gist.github.com/saghul/542780

2016年5月20日星期五

system cpu high

今天又9:20~9:38发生了 system cpu占用很高的情况,逮到100%的core,看到进程基本都堵在了_spin_lock_irq的系统调用。根据这个_spin_lock_irq,外加system cpu搞,google到了。 rhel 6.3里的内核参数, vm.zone_reclaim_mode目前1,需要修改为0,在减少这个现象。
vm.zone_reclaim_mode=1,表示即宁肯回收自己zone的page cache,也不去申请其它zone的free pages
vm.zone_reclaim_mode=0,表示只要其它zone有free pages就去其它zone里申请


# sysctl -a | grep zone_reclaim_mode
vm.zone_reclaim_mode = 0

# sysctl -w vm.zone_reclaim_mode=1
vm.zone_reclaim_mode = 1

参考了网站
http://blog.phpdba.com/post/473
http://mogu.io/156-156
http://eratostennis.hatenablog.com/entry/2015/12/12/201319
http://www.databasesoup.com/2012/08/wrong-defaults-for-zonereclaimmode-on.html
http://blog.etsukata.com/2015/09/hadoop-cpu-system-zonereclaimmode-1.html

2016年5月6日星期五

tomcat gzip enable

https://tomcat.apache.org/tomcat-8.0-doc/config/http.html#HTTP/1.1_and_HTTP/1.0_Support

$CATALINA_HOME/conf/server.xml を以下の様に設定する。

<Server port="8005" shutdown="SHUTDOWN">
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" 
               useBodyEncodingForURI="true" 
               compression="on"/>
</Server>

2016年4月29日星期五

SecureFX文件名乱码的解决

连接到aws的ec2服务器,sftp却是乱码,折腾了时间。

修改法子为,修改securefx的session 配置文件的
D:"Filenames Always Use UTF8"=00000000
为 00000001,表示一直使用utf8,不要是作用本地的编码。

2016年4月22日星期五

windows 10用久了关机关不下来

开机,用上1个小时,关机,没问题,可以彻底关掉。
开机,用上1天,关机,一直关不下去。

解决法子,将默认的Intel Management Engine Interface是11,降级到9.5就可以了。只是去掉mei的电源睡眠,也好像不管用。