![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux
kevin_darkelf
这个作者很懒,什么都没留下…
展开
-
查看gpu使用情况
命令行方式 查询gpu设备使用情况。原创 2023-04-13 13:13:21 · 349 阅读 · 0 评论 -
linux bash 常用操作
找到失效的符号链接并删除find . -xtype l -exec rm {} \;find -xtype l:We’ll use the l flag with xtype, to tell it to search for links, return broken links:参考文章原创 2022-01-14 15:42:58 · 281 阅读 · 0 评论 -
linux 证书有效期查看
查看本地证书有效日期openssl x509 -in ${cer-path} -noout -datesopenssl 参数x509 : Run certificate display and signing utility.-noout : Prevents output of the encoded version of the certificate.-dates : Prints out the start and expiry dates of a TLS or SSL cert原创 2021-10-05 17:05:01 · 6495 阅读 · 0 评论 -
rpm 安装解压
下载rpm工具 yumdownloader安装:yum install yum-utils示例:yumdownloader --resolve --destdir /root/mypackages/ httpd查看、解压rpm里的文件查看rpm -qpl httpd.rpm 解压rpm2cpio httpd.rpm | cpio -div 指定安装目录使用prefixrpm -i –prefix=/home/admin httpd.rpm 注:不是所有的r原创 2021-05-06 09:57:39 · 895 阅读 · 0 评论 -
性能调优
Linux perf: http://www.brendangregg.com/perf.html原创 2020-08-04 19:43:50 · 93 阅读 · 0 评论 -
netstat & lsof
netstatmacnetstat -anvp tcpnetstat -anvp udplinuxlsofmaclsof -nP -iTCP -sTCP:LISTEN原创 2020-01-06 22:03:09 · 133 阅读 · 0 评论 -
压缩工具/算法
gzip, bzip2, xz 工具比较原文:https://www.rootusers.com/gzip-vs-bzip2-vs-xz-performance-comparisonConclusionIf you are interactively compressing files on the fly then you may want to do this quickly wi...原创 2019-12-04 15:30:52 · 193 阅读 · 0 评论 -
Linux 命令行Shell快捷键
from: http://www.cnblogs.com/thinksasa/p/3507714.htmlCtrl+R快速搜索historyCtrl+P显示上一条命令快速执行一条history命令:!!/!-number ========================================= 快速进入某些目录转载 2015-08-19 18:55:10 · 565 阅读 · 0 评论 -
iperf 使用
from: http://blog.163.com/hlz_2599/blog/static/142378474201341341339314/Iperf是一个网络性能测试工具。Iperf可以测试TCP和UDP带宽质量。Iperf可以测量最大TCP带宽,具有多种参数和UDP特性。Iperf可以报告带宽,延迟抖动和数据包丢失。利用Iperf这一特性,可以用来测试一些网络设备如路由器,防火墙,转载 2015-08-17 21:47:29 · 1129 阅读 · 0 评论 -
yum 变量
http://www.opstool.com/article/294 新机器使用yum出现了报错,发现本来应该替换的$releasever变量变成了%24releaseverhttp://mirrors.aliyun.com/centos/%24releasever/addons/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not转载 2015-08-27 23:44:51 · 2663 阅读 · 0 评论 -
linux 打开文件句柄数
首先可以通过ulimit –a 命令来查看如下:Redhat系统[root@120lg_3 ut]# ulimit -acore file size (blocks, -c) 0data seg size (kbytes, -d) unlimitedfile size (blocks, -f) u转载 2015-06-04 10:08:33 · 4710 阅读 · 0 评论 -
linux 查看运行进程所在目录
通过ps及top命令查看进程信息时,只能查到相对路径,查不到的进程的详细信息,如绝对路径等。这时,我们需要通过以下的方法来查看进程的详细信息:Linux在启动一个进程时,系统会在/proc下创建一个以PID命名的文件夹,在该文件夹下会有我们的进程的信息,其中包括一个名为exe的文件即记录了绝对路径,通过ll或ls –l命令即可查看。ll /proc/PIDcwd符号转载 2015-05-27 09:51:07 · 34012 阅读 · 1 评论 -
netstat
netstat 常用操作:[root@localhost ~]# netstat -nlpnetstat命令各个参数说明如下: -t : 指明显示TCP端口 -u : 指明显示UDP端口 -l : 仅显示监听套接字(所谓套接字就是使应用程序能够读写与收发通讯协议(protocol)与资料的程序) -p : 显示进程标识符和程序名称,每一个套接字/端口都属于一个程序。 -转载 2015-02-16 13:34:58 · 445 阅读 · 0 评论 -
非root账号sudo免密码设置
chmod u+w /etc/sudoersvi /etc/sudoers如下修改, 使admin这个组的账号sudo无密码## Same thing without a password# %wheel ALL=(ALL) NOPASSWD: ALL%admin ALL=(ALL) NOPASSWD: ALLchmod u-w /e原创 2015-02-10 22:36:41 · 1634 阅读 · 0 评论 -
ssh 登录免密码设置
A机登录用户admin# 连续三次回车,即在本地生成了公钥和私钥,不设置密码ssh-keygen -t rsa # 需要输入密码, 注:必须将.ssh的权限设为755 ssh 10.0.0.1 "mkdir ~/.ssh; chmod 755 ~/.ssh" scp ~/.ssh/id_rsa.pub root@172.24.253.2:.ssh/id_rsa.pub原创 2015-02-10 21:25:33 · 622 阅读 · 0 评论 -
curl
Curl是Linux下一个很强大的http命令行工具,其功能十分强大。获取网页html内容, 结果会输出到屏幕$ curl http://www.linuxidc.com保存html页$ curl http://www.linuxidc.com > page.html用curl的内置option: -o$ curl -o page.html http://www.linuxidc.com网转载 2015-02-16 14:14:39 · 482 阅读 · 0 评论 -
linux 系统常用命令
Linux 版本$uname -a Linux zmysdumper-70-50 2.6.32-220.23.2.ali878.el6.x86_64 #1 SMP Mon Jan 28 17:12:52 CST 2013 x86_64 x86_64 x86_64 GNU/Linuxx86_64:64位系统 i386: 32 位系统 OS信息$head -n 1 /etc/issue R原创 2015-10-29 16:42:47 · 346 阅读 · 0 评论 -
Linux signal
from: http://blog.chinaunix.net/uid-20528014-id-333569.html 1. 信号基本概念信号(signal)是linux进程通讯中唯一的异步通讯方式。信号从软件层次上看是对中断机制的一种模拟。一个进程收到信号时的处理方式与CPU收到中断请求时的处理方式一样。收到信号的进程会跳入信号处理函数,执行完后再跳回原来的位置继续执行。信号转载 2016-04-03 20:23:54 · 481 阅读 · 0 评论 -
tcp数据重传时间细节探秘及数据中心优化
KW: 对于RTO部分的理解可以关注from: http://blog.sina.com.cn/s/blog_5374d6e30102vhnu.html在数据中心网络内,机器之间数据传输的往返时间(rtt)一般在10ms以内,为此调内部服务的超时时间一般会设置成50ms、200ms、500ms等,如果在传输过程中出现丢包,这样的服务超时时间,tcp层有机会发现并重传一次数据么?如果设置成2...转载 2019-07-21 16:30:33 · 1073 阅读 · 0 评论 -
nginx反向代理
Refhttp://www.nginx.cn/927.htmlhttp://nginx.org/en/docs/http://tengine.taobao.org/原创 2019-07-18 16:47:43 · 83 阅读 · 0 评论 -
linux boost 安装
sh ./bootstrap.sh --prefix=/home/admin/usr/local/ ./b2 variant=release cxxflags='-fPIC' cflags='-fPIC' ./b2 install原创 2018-07-16 18:47:27 · 248 阅读 · 0 评论 -
linux library
静态库查看静态库对象$ar -tv libeasy_http_server.a rw-rw-r-- 59881/59881 2640480 May 28 16:56 2018 http_server_base.orw-rw-r-- 59881/59881 907200 May 29 13:29 2018 http_server_base_main.orw-rw-r-- 59881...原创 2018-05-29 14:04:47 · 559 阅读 · 0 评论 -
Nginx code 状态码说明
From: https://www.cnblogs.com/kevingrace/p/7205623.html 最近了解下Nginx的Code状态码,在此简单总结下。一个http请求处理流程:一个普通的http请求处理流程,如上图所示:A -> client端发起请求给nginxB -> nginx处理后,将请求转发到uwsgi,并等待结果C -> uwsgi处理完请求后,返回数...转载 2018-06-11 11:14:44 · 3449 阅读 · 0 评论 -
cmake 简单使用
cmake 构建的C++ demo 工程 工程结构./project |---- my_demo/ | |---- demo.cpp | `---- others.cpp |---- test/ | |---- test.cpp | `---- CMakeLists.txt |---- CMakeLists.txt ...原创 2018-06-02 18:00:22 · 1023 阅读 · 2 评论 -
Linux查看物理CPU个数、核数、逻辑CPU个数
from: https://www.cnblogs.com/bugutian/p/6138880.html CPU总核数 = 物理CPU个数 * 每颗物理CPU的核数 总逻辑CPU数 = 物理CPU个数 * 每颗物理CPU的核数 * 超线程数查看CPU信息(型号)[root@AAA ~]# cat /proc/cpuinfo | grep name | cu转载 2018-04-17 14:35:12 · 273 阅读 · 0 评论 -
`GLIBC_2.14' not found
from http://blog.csdn.net/force_eagle/article/details/8684669 version `GLIBC_2.14' not found 解决方法.一般出现类似次问题是当前运行系统Glibc版本低于编译环境Glibc版本造成Glibc版本兼容性造成的. 通常可以使用-static链接成静态程序即可解决.不过经过goo转载 2017-02-20 10:59:14 · 719 阅读 · 0 评论 -
使用PSSH批量SSH操作Linux服务器
from: http://www.opstool.com/article/266服务器多了,有一个烦恼就是如何批量快速操作一堆服务器。这里我推荐一下经常使用利器pssh。这个工具给我的工作带来了莫大的帮助。简介pssh是一款开源的软件,使用python实现。用于批量ssh操作大批量机器。pssh的项目地址 https://code.google.com/p/parallel-s转载 2015-02-10 22:38:53 · 901 阅读 · 0 评论 -
add user in linux
useradd user_name原创 2014-06-16 16:48:15 · 676 阅读 · 0 评论 -
rpath添加依赖库搜索路径
from: http://blog.csdn.net/ibingow/article/details/7882098windows 下一个程序的dll搜索路径首先是程序目录,然后是一些系统目录。linux 下的可以通过设置 LD_LIBRARY_PATH 等方法来添加搜索路径,但是这些路径是定死的,如果要实现程序目录,就要使用链接时的rpath选项。rpath 适用于 elf 文件,不适用 p转载 2014-11-07 13:13:28 · 3793 阅读 · 1 评论 -
inode
Inode 结构inode 在Linux里 算是一个蛮大的结构, 跟super_block比起来可是不惶多让,基本上, 跟super_block结构一样, 我们一样可以把inode结构分成几部分来看: 串行管理栏位, 基本资料, 用来做inode synchronization的资料, 跟记忆体管理有关的资料, Quota管理栏位, 跟file lock有关的栏位, 以及一组用来操作inode转载 2013-08-17 16:34:11 · 920 阅读 · 0 评论 -
gdb tips
1, output the stack info of all threads into a local file. set logging file ./local.txtset logging onthread apply all bt set logging off 2, output the all stack info into a file automati原创 2012-11-05 21:25:48 · 618 阅读 · 0 评论 -
nm and elf
sth. about nm http://bbs.chinaunix.net/thread-3610411-1-1.html----sth. about elf structure http://blog.csdn.net/gongweijiao/article/details/8207333http://simohayha.iteye.com/blog/291原创 2013-05-28 21:21:41 · 631 阅读 · 0 评论 -
linux 中解析命令行参数 (getopt_long用法)
from : http://blog.csdn.net/ast_224/article/details/3861625getopt_long支持长选项的命令行解析,使用man getopt_long,得到其声明如下: #include int getopt_long(int argc, char * const argv[],转载 2012-06-15 16:01:49 · 510 阅读 · 0 评论 -
Linux进程控制
good blog for linux process , from http://www.cnblogs.com/feisky/archive/2009/10/25/1589613.html 进程是程序的一次执行, 是运行在自己的虚拟地址空间的一个具有独立功能的程序. 进程是分配和释放资源的基本单位, 当程序执行时, 系统创建进程, 分配内存和 CPU 等资源; 进程转载 2012-06-09 22:25:21 · 450 阅读 · 0 评论 -
struct dirent
struct dirent {ino_t d_ino;off_t d_off;unsigned short d_reclen;unsigned char d_type;char d_name[256];};Unix环境高级编转载 2011-08-12 20:50:33 · 7138 阅读 · 0 评论 -
Linux 进程状态
Linux进程状态解析之T、Z、X上面一篇文章中我们介绍了Linux进程的R、S、D三种状态,这里接着上面的文章介绍另外三个状态。Linux进程状态:T (TASK_STOPPED or TASK_TRACED),暂停状态或跟踪状态。向进程发送一个SIGSTOP信号,转载 2011-08-12 14:45:13 · 709 阅读 · 0 评论 -
ltrace, strace
ltrace能够跟踪进程的库函数调用,它会显现出哪个库函数被调用,而strace则是跟踪程序的每个系统调用.下面是一个ltrace与strace的对比1)系统调用的输出对比我们用输出hello world的程序做如下测试:#include in转载 2011-08-06 17:48:35 · 4511 阅读 · 0 评论 -
Linux上程序调试的基石(1)--ptrace
ref: http://javadino.blog.sohu.com/101228695.html引子: 1.在Linux系统中,进程状态除了我们所熟知的TASK_RUNNING,TASK_INTERRUPTIBLE,TASK_STOPPED等,还有一个TASK_TRAC转载 2011-08-06 17:08:55 · 632 阅读 · 0 评论 -
strace
strace 简介strace 命令是一种强大的工具, 能够显示任何由用户空间程式发出的系统调用. strace 显示这些调用的参数并返回符号形式的值. strace 从内核接收信息, 而且无需以任何特别的方式来构建内核. strace 的每一行输出包括系统调用名称, 然后是转载 2011-08-06 17:11:17 · 1143 阅读 · 0 评论 -
crontab
<br />基本格式 :<br />* * * * * command<br />分 时 日 月 周 命令 <br />第1列表示分钟1~59 每分钟用*或者 */1表示<br />第2列表示小时1~23(0表示0点)<br />第3列表示日期1~31<br />第4列表示月份1~12<br />第5列标识号星期0~6(0表示星期天)<br />第6列要运行的命令<br />crontab文件的一些例子:<br />30 21 * * * /usr/local/etc/rc.d/lighttpd原创 2011-02-19 18:52:00 · 403 阅读 · 0 评论