![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Liunx / debug
Zpeg
暂无
展开
-
linux下如何查看当前内核的配置?
linux下如何查看当前内核的配置?答: zcat /proc/config.gz 当然有个前提条件,需要打开内核的以下两个选项(CONFIG_IKCONFIG和CONFIG_IKCONFIG_PROC): General setup ---> <*> Kernel .config support [ * ] Enable access to .config through /proc/config.gz...原创 2020-08-04 13:49:50 · 2834 阅读 · 0 评论 -
大文件的python处理
遇到QA测试人员提供的了超大的log文件3.24G,有些无从下手,故写了如下python code,将大文件分割并保存监测出关键字的部分。具体code如下#!/usr/bin/python# AUTHER: ZPEGimport os,sys,shutilfindstr = "CTRL-EVENT-DISCONNECTED"kilobytes = 1024megabytes = 1024 * kilobyteschunksize = int(100*megabytes)#defau原创 2020-07-22 19:51:56 · 172 阅读 · 0 评论 -
Linux API system()安全性问题
Use of the system() function can result in exploitable vulnerabilities, in the worst case allowing execution of arbitrary system commands. Situations in which calls to system()have high risk include the following:When passing an unsanitized or improperly原创 2020-07-07 20:54:39 · 528 阅读 · 0 评论 -
LINUX C 程序异常退出---文件连接数过多
在linux C编程时,会碰到程序异常退出的情况,除了比较经典的段错误、内存溢出之外,本文说一种文件连接过多而导致程序异常退出的情况。 简述一下我遇到的情况,在煲机一段时间之后(大概18小时),进程退出。通过gdb调试和及时保存内存CPU使用情况,基本可以排除内存泄漏和段错误的原因。然后开始排查是否是文件连接过多的原因,即fopen文件没有相应close。 1 ulimit -a 查看最大原创 2017-01-04 11:49:41 · 1097 阅读 · 0 评论 -
粒子群算法(PSO)的C实现
/******************************************************* Copyright(c), 2017 Co.,Ltd.* All rights reserved.** FileName: main.c* Description: 粒子群算法应用(PSO),计算函数 sin(x) 在x 0~3的范围的最大值* Author原创 2017-04-18 14:15:30 · 1207 阅读 · 1 评论 -
Linux 时区
Issue Descriptiondate时区显示是UTC,希望显示CSTAnalysis决定时区的有/etc/localtime 和 /etc/timezone还有TZ宏可以看到 当date时,会读取TZ这个宏标识以及时间偏移Solution添加TZ宏 export TZ=CST-08:00或者 增加/etc/localtime 其实localtime中也同样有...原创 2018-10-24 14:46:56 · 221 阅读 · 0 评论