![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux
@Guo Peng
这个作者很懒,什么都没留下…
展开
-
strtok_r函数的使用
代码如下:#include <stdio.h>#include <string.h>#define SIZE_16 16int main(int argc, const char *argv[]){ char *buf = NULL; char *savePtr = NULL; char data[SIZE_16] = "1,2,3,4"; buf = strtok_r(data,",", &savePtr); while (buf != NULL)原创 2021-05-22 12:01:45 · 761 阅读 · 0 评论 -
freeradius交叉编译,测试radclient
freeradius 历史源码url: https://ftp.cc.uoc.gr/mirrors/ftp.freeradius.org/old/下载解压freeradius-server-2.2.0.tar.gz(不依赖talloc库,交叉编译方便)内核版本:linux-2.6.36.x交叉编译工具链:buildroot-gcc463/usr/bin/mipsel-linux-编译完成之后(服务器配置略。。。)...原创 2021-04-15 09:25:45 · 352 阅读 · 0 评论 -
dnsmasq官网链接
https://thekelleys.org.uk/dnsmasq/原创 2021-03-16 10:14:11 · 685 阅读 · 0 评论 -
ktest-tool 打印字节码转int
ktest-tool 打印字节码转int为了便于观察,所以将字节码数组转换成 int数组添加的函数如下 def bytesToInt(b, byteorder='little'): return int.from_bytes(b, byteorder=byteorder,signed=True) def bytesArrayToIntArray(b): n = [] for i in range(0,原创 2021-03-13 13:02:43 · 172 阅读 · 0 评论 -
通过文件锁实现脚本互斥
文件锁实现脚本互斥写一个C程序,通过C来运行脚本,也可以用来运行c#include <stdio.h>#include <unistd.h>#include <fcntl.h>#include <sys/types.h>#include <sys/stat.h>#include <stdlib.h>#include <string.h>#include <signal.h>#define r原创 2021-03-13 12:11:50 · 102 阅读 · 0 评论 -
输出进程虚拟内存和物理内存相关信息
输出进程虚拟内存和物理内存相关信息#! /bin/shfileTempPath="/tmp/checkmem.tmp"check_proc(){ echo " check proc info" echo "" > $fileTempPath ps -A | grep -v grep | grep -v PID | awk '{print $1}' > $fileTempPath原创 2020-07-22 11:51:08 · 83 阅读 · 0 评论 -
shell 脚本互斥
shell脚本互斥保证两个脚本同时在后台运行,仍然可以进行互斥,源码如下:#! /bin/bashscript_name=`basename $0 | cut -d '.' -f1`file_pid="/var/run/${script_name}.pid"# check process according to pid file, if the pid file exists and is not emptyif [ -s $file_pid ];then ps -ef | grep -原创 2020-07-08 17:48:36 · 378 阅读 · 0 评论