随笔分类 - Linux系统
摘要:以下来结论自tcpcopy & gryphon讨论群经过试验测试得出,不保证肯定正确。net.ipv4.tcp_tw_recyclenet.ipv4.tcp_tw_reusenet.ipv4.tcp_timestamps1) recycle和reuse参数必须在客户端和服务端都开启timestamp...
阅读全文
摘要:正则匹配:grep -E "[a-z]+"只输出匹配到的文本:echo this is a line. | grep -o -E "[a-z]+\."统计匹配到的行数:grep -c匹配之外的行:grep -v多级目录中递归搜索:grep "text" . -R -n忽略大小写:grep -i匹配多个样式:grep -e "this" -e "line"grep中包括货排除文件:grep "main()" . -r --include *.{c,cpp}grep "
阅读全文
摘要:在linux下使用动态库时,经常会发现明明编译时指定的是libA.so,可是程序运行时或通过ldd查看依赖却是libA.so.XXX,原因跟linux下so库的soname有关,查看so库的soname可以通过命令:readelf -d libXXX.so看到;具体使用见下面的例子。编译命令:g++ -fPIC -shared -Wl,-soname,libhello.so.1 -o libhello.so.1.1 hello.cppreadelf -d libhello.so.1.1g++ test.cpp -L. libhello.so.1.1 -o test
阅读全文
摘要:最近公司redis服务出现了异常,记录下教训:redis异常后:观察redis服务,可以看到redis cpu占用100%用strace命令查看redis进程,显示如下:open("/var/log/redis/redis.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EMFILE (Too many open files)epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 10240, 88) = 1accept(4, 0x7fff9864c840, [883955190649061392]) =
阅读全文
摘要:find . ! -name "*.txt" | xargs -i cp {} ../desc;find . ! -name "*.tmp" -exec mv {} ../desc \;
阅读全文
摘要:在终端里运行sudo modprobe psmouse 启动触控板sudo modprobe -r psmouse 关闭触控板 good90参考:http://zhidao.baidu.com/question/332519741.html
阅读全文
浙公网安备 33010602011771号