随笔分类 -  Linux

Linux 获取网卡名字列表
摘要:lspci | egrep -i --color 'network|ethernet' 阅读全文

posted @ 2019-11-18 16:38 liujx2019 阅读(3649) 评论(0) 推荐(0)

Linux C语言 检测文件是否存在
摘要:头文件 unistd.h if(access(file_name, F_OK ) != -1 ) { // file exists } else { // file doesn't exist } You can also use R_OK, W_OK, and X_OK in place of F 阅读全文

posted @ 2019-11-08 10:38 liujx2019 阅读(1954) 评论(0) 推荐(0)

Ubuntu parted 命令 写在脚本里时要带 -s 参数
摘要:否则会要求用户输入,造成脚本卡住。 阅读全文

posted @ 2019-10-30 16:42 liujx2019 阅读(254) 评论(0) 推荐(0)

Ubuntu 设置 log 级别
摘要:Linux环境下使用rsyslog管理日志 rsyslog linux运维 linux 22.7k 次阅读 · 读完需要 22 分钟 rsyslog linux运维 linux 在 Linux 系统中,日志文件记录了系统中包括内核、服务和其它应用程序等在内的运行信息。在我们解决问题的时候,日志是非常 阅读全文

posted @ 2019-10-26 13:45 liujx2019 阅读(1799) 评论(0) 推荐(0)

Debugging Under Unix: gdb Tutorial (https://www.cs.cmu.edu/~gilpin/tutorial/)
摘要:Contents Introduction This tutorial was originally written for CS 342 at Washington University. It is still maintained by Andrew Gilpin. Who should re 阅读全文

posted @ 2019-09-11 09:36 liujx2019 阅读(193) 评论(0) 推荐(0)

Makefile: missing separator(did you mean TAB instead of 8 spaces?). Stop.
摘要:通常我们会对vimrc文件加以配置(如将TAB键自动转换为4个空白键)。但正是由于将tab键转换为n个空白键,使得用vim编写的Makefile中不存在tab键(即“\t”)了。恰恰Makefile中以tab键作为命令行的起始标记。所以现在找到了报错的原因,即tab键被替换为空白键了。解决方法是:在 阅读全文

posted @ 2019-08-23 16:44 liujx2019 阅读(3611) 评论(0) 推荐(0)

[Linux] 检查是否已有进程在运行
摘要:出处:sblim-sfcb-1.4.9 / sfcBroker.c 阅读全文

posted @ 2019-08-23 15:18 liujx2019 阅读(431) 评论(0) 推荐(0)

[Ubuntu ] Vim Error E492 - Not an editor command: PluginInstall
摘要:https://stackoverflow.com/questions/30017366/vim-error-e492-not-an-editor-command-plugininstall 阅读全文

posted @ 2019-08-02 10:01 liujx2019 阅读(1490) 评论(0) 推荐(0)

Python 如何写 Ubuntu syslog
摘要:address='/dev/log' 是关键 import logging from logging.handlers import SysLogHandler logger = logging.getLogger() logger.setLevel(logging.INFO) syslog = SysLogHandler(address='/dev/log') formatter = log... 阅读全文

posted @ 2019-07-31 14:58 liujx2019 阅读(185) 评论(0) 推荐(0)

[Python] bytes 转换成 str
摘要:b = b"example" # bytes object s = "example" # str object sb = bytes(s, encoding = "utf8") # str to bytes 或者:sb = str.encode(s) # str to bytes bs = str(b, encoding = "utf... 阅读全文

posted @ 2019-07-29 10:44 liujx2019 阅读(2894) 评论(0) 推荐(0)

Python执行Linux cmd命令,获取输出的一种方法,输出是bytes
摘要:import subprocess p = subprocess.Popen('df -lh', stdout=subprocess.PIPE, shell=True) print(p.stdout.read()) 阅读全文

posted @ 2019-07-29 10:42 liujx2019 阅读(860) 评论(0) 推荐(0)

Openstack Swift 如何查找 slave node 挂载的 VD 的 IP
摘要:1. 在 /etc/swift/container-server.conf 或者 object-server.conf 中的 devices= 一行 可以找到 /srv/node. 在 /srv/node/ 下可发现设备, 如 sdb. 即 /srv/node/sdb 2. 通过命令 cat /et 阅读全文

posted @ 2019-07-26 17:51 liujx2019 阅读(223) 评论(0) 推荐(0)

Linux 如何通过 iscsi target name 获取 ip
摘要:by Mike Andrews 阅读全文

posted @ 2019-07-26 17:10 liujx2019 阅读(573) 评论(0) 推荐(0)

Linux 字符串处理函数
摘要:1 strchr函数原型:extern char *strchr(char *str,char character)参数说明:str为一个字符串的指针,character为一个待查找字符。 所在库名:#include <string.h> 函数功能:从字符串str中寻找字符character第一次出 阅读全文

posted @ 2019-07-26 09:40 liujx2019 阅读(2172) 评论(0) 推荐(0)

为何 UNIX 时间 0, 有时显示是1970年1月1日,有时显示是1969年12月31日
摘要:by Rachael Arnold http://www.rachaelarnold.com/dev/archive/why-is-date-returning-wrong Demystifying 12/31/1969 (or 1/1/1970 for Eastern Hemisphere fol 阅读全文

posted @ 2019-07-24 16:39 liujx2019 阅读(341) 评论(0) 推荐(0)

ifconfig
摘要:https://blog.csdn.net/u011857683/article/details/83758503 阅读全文

posted @ 2019-07-24 14:38 liujx2019 阅读(93) 评论(0) 推荐(0)

Cannot find libcrypto in Ubuntu
摘要:https://stackoverflow.com/questions/13811889/cannot-find-libcrypto-in-ubuntu 阅读全文

posted @ 2019-07-23 09:45 liujx2019 阅读(204) 评论(0) 推荐(0)

Ubuntu 修改 hosts 文件
摘要:sudo vi /etc/hosts sudo /etc/init.d/networking restart 阅读全文

posted @ 2019-07-18 17:08 liujx2019 阅读(963) 评论(0) 推荐(0)

Makefile 简要辅导 【转载】
摘要:A Simple Makefile Tutorial Makefiles are a simple way to organize code compilation. This tutorial does not even scratch the surface of what is possibl 阅读全文

posted @ 2019-07-18 09:50 liujx2019 阅读(173) 评论(0) 推荐(0)

Makefile 中引用多个 include 路径
摘要:LIB=-L/usr/informix/lib/c++ INC=-I/usr/informix/incl/c++ -I/opt/informix/incl/public default: main main: test.cpp gcc -Wall $(LIB) $(INC) -c test.cpp #gcc -Wall $(LIB) $(INC) ... 阅读全文

posted @ 2019-07-18 09:47 liujx2019 阅读(5449) 评论(0) 推荐(0)

导航