随笔分类 -  linux

关于linux 环境/命令/软件等
shell的文件锁操作
摘要:flock { flock -n 3 [ $? -eq 1 ] && echo "anoter prossess is running" && exit 1 sleep 10 echo helloworld11 sleep 3 echo helloworld22 } 3>/root/1.lock 阅读全文

posted @ 2021-08-15 19:25 思此狂 阅读(609) 评论(0) 推荐(0)

关于网络中断
摘要:阿里云ECS 配置网卡多队列 提升中断处理性能 https://help.aliyun.com/document_detail/52559.html?spm=a2c4g.11174283.6.990.b2e552fekaIQx9 关于亲和性设置 https://www.cnblogs.com/bam 阅读全文

posted @ 2021-01-17 21:49 思此狂 阅读(203) 评论(0) 推荐(0)

systemd
摘要:systemd-cgls 指令,根据 cgroup 将运行的进程分组来同时实现两者。 要显示您系统中的全部 cgroup 层级systemd-cgls 查看 memory 资源管控器的 cgroup 树systemd-cgls memorysystemd-cgls cpusystemd-cgls d 阅读全文

posted @ 2020-11-20 20:15 思此狂 阅读(262) 评论(0) 推荐(1)

构建rpm包
摘要:使用rpmbuild 构建rpm包 相关资料: https://fedoraproject.org/wiki/How_to_create_an_RPM_package/zh-cn How to create an RPM package/zh-cn https://blog.csdn.net/get 阅读全文

posted @ 2020-08-08 17:12 思此狂 阅读(189) 评论(0) 推荐(0)

dhcp
摘要:leases 文件 /var/lib/dhclient/dhclient.leases RUN="yes"if [ "$RUN" = "yes" ]; then echo "$(date): entering ${1%/*}, dumping variables." \ >> /tmp/dhclie 阅读全文

posted @ 2020-08-05 20:14 思此狂 阅读(214) 评论(0) 推荐(0)

Makefile
摘要:语法规范 <target> : <prerequisites> [tab] <commands> target 是一个目标,一般是一个文件,指明要构建的对象 也可以是一个操作的名字,这称为"伪目标"(phony target)。比如 make clean 要删除一些文件,如果在当前目录中正好有个文件 阅读全文

posted @ 2020-07-14 20:48 思此狂 阅读(151) 评论(0) 推荐(0)

legacy/uefi 双启动
摘要:分区要求: 1 biosboot 2 EFi 分区 3 根分区 分区顺序 根分区要求必须是最后一个,不然根分区没法扩展 大致步骤 1 安装vm 从uefi 启动。 2 安装bios 的grub、 grub2-install grub2-mkconfig sed linuxefi/linux grub 阅读全文

posted @ 2020-05-30 12:18 思此狂 阅读(1272) 评论(0) 推荐(0)

selinux
摘要:selinux 的配置文件 /etc/sysconfig/selinux SELinux=enforcing 为 SELinux 总开关,有效值可以是 enforcing、permissive 或 disabled。disabled 代表禁用 SELinux 功能,由于 SELinux 是内核模块功 阅读全文

posted @ 2020-01-29 20:45 思此狂 阅读(427) 评论(0) 推荐(0)

SUSE自动化安装应答文件
摘要:SUSE Linux Enterprise Server 15 SP1的 常规安装在单个阶段中执行。但是,自动安装过程分为两个阶段。在安装基本系统之后,系统将引导进入第二阶段,在第二阶段完成系统配置。 必须安装 软件包autoyast2和 autoyast2-installation才能在已安装系统 阅读全文

posted @ 2019-12-31 00:00 思此狂 阅读(886) 评论(0) 推荐(0)

libvirt创建KVM虚拟机
摘要:1 安装虚拟化相关组件 2 启动libvirt服务 3 配置xml,创建空镜像 4 定义启动虚拟机 阅读全文

posted @ 2019-11-24 18:57 思此狂 阅读(910) 评论(0) 推荐(0)

awk全集
摘要:NF(number of field)表示一行中的区域(列)数量,$NF取最后一个区域。表示最后一列$符号表示取某个列(区域),$1,$2,$NFNR (number of record) 行号,awk对每一行的记录号都有一个内置变量NR来保存,每处理完一条记录NR的值就会自动+1FS(-F)fie 阅读全文

posted @ 2019-11-14 22:32 思此狂 阅读(299) 评论(0) 推荐(0)

expect 示例
摘要:#!/usr/bin/expect set timeout 30 set IP [lindex $argv 0] set USER [lindex $argv 1] spawn ssh $USER@$IP expect { "Are you sure you want to continue con 阅读全文

posted @ 2019-02-13 21:58 思此狂 阅读(134) 评论(0) 推荐(0)

Linux设备开机卡主
摘要:1 linux 设备开机卡主 卡在了执行 /etc/rc.d/rc.local 中设置的开机启动命令中了。 解决方法 参考这篇文档修改grub https://m.linuxidc.com/Linux/2017-02/140653.htm 1 重启设备,当启动至选择内核界面(1, 正常内核 2 re 阅读全文

posted @ 2019-01-06 20:43 思此狂 阅读(824) 评论(0) 推荐(0)

systemd
摘要:1 关于自定义的一个service,以nginx为例 相关参数解释 https://www.cnblogs.com/wjb10000/p/5566801.html https://blog.csdn.net/comprel/article/details/82750288 http://www.ru 阅读全文

posted @ 2018-12-01 00:07 思此狂 阅读(133) 评论(0) 推荐(0)

rsyslog
摘要:1 自定义一个rsyslog服务配置项 使用 logger -it jkktest "loginfo" 就能向 jkktest 的日志/var/log/jkktest.log 中写入日志信息了 丰富相关配置项,例如日志转储等 阅读全文

posted @ 2018-11-28 23:09 思此狂 阅读(128) 评论(0) 推荐(0)

rpm 校验
摘要:rpm 校验rpm包文件的完整性/正确性 [root@jinkk mysql]# rpm --checksig mysql-community-release-el7-5.noarch.rpm mysql-community-release-el7-5.noarch.rpm: sha1 md5 gp 阅读全文

posted @ 2018-10-28 17:27 思此狂 阅读(201) 评论(0) 推荐(0)

linux 上解析JSON
摘要:Linux 上解析 json的有效工具 jq https://stedolan.github.io/jq/manual/ [root@jinkk ~]# cat test.json { "name": "zhangsan", "skill":{ "a":"good", "b":"nice" } } 阅读全文

posted @ 2018-05-31 22:10 思此狂 阅读(1034) 评论(0) 推荐(0)

虚拟化技术
摘要:关于 libvirt https://wiki.archlinux.org/index.php/Libvirt_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87) 关于 qume https://wiki.archlinux.org/index.php/QEMU_(%E7% 阅读全文

posted @ 2018-02-01 00:05 思此狂 阅读(135) 评论(0) 推荐(0)

shell分割IFS
摘要:一个文件file,内容: 如果这是读取文件,输出每行 输出内容会是这样的 要想按行输出,要在脚本前面加上这句,重新定义IFS变量 IFS=‘\n’ //将字符n作为IFS的换行符。 IFS=$"\n" //这里\n确实通过$转化为了换行符,但仅当被解释时(或被执行时)才被转化为换行符。 IFS=$' 阅读全文

posted @ 2018-01-03 22:09 思此狂 阅读(253) 评论(0) 推荐(0)

Vagrant
摘要:Vagrant 虚拟机管理工具 使用 ruby编写 跟 Virtual box结合起来 ,为开发人员 构造一致可移植的开发环境 参考链接 使用参考 http://blog.csdn.net/yjk13703623757/article/details/70040797 官网链接 https://ww 阅读全文

posted @ 2017-12-07 00:08 思此狂 阅读(108) 评论(0) 推荐(0)

导航