随笔分类 -  Linux

Linux 下的操作技巧
关于正则表达式的一些技巧
摘要:正则真是个蛮有意思的东西,但要完全掌握还是要理解的比较透。 1、找一句话里面同时存在多个关键词,位置先后无关 (?=.*词1)(?=.*词2) 2、获取一句话中有特殊标识的关键词 (?<=#@)(\w+)(?=@#) 也可以用: (#@)(.*?)(@#) 而取 $2 3、找一句话中包含xxx 但不 阅读全文

posted @ 2023-01-06 15:41 震撼起飞 阅读(58) 评论(0) 推荐(0)

一句话统计发票总额
摘要:SUM=0;COUNT=0;for i in `find . -name "*.pdf"`;do NUM=${i##*-};NUM=${NUM%*.pdf};SUM=$SUM+$NUM;let COUNT++; done; echo $SUM|bc; echo '总数据'$COUNT'张'; 阅读全文

posted @ 2022-12-06 12:39 震撼起飞 阅读(50) 评论(0) 推荐(0)

群晖6.x安装 python3、pip3 并安装 supervisor 自运行
摘要:1、安装套件 python3 2、将 python3 作为默认 python mv /usr/bin/python /usr/bin/python.bak ln -s /usr/local/bin/python3 /usr/bin/python ln -s /var/packages/py3k/ta 阅读全文

posted @ 2022-11-12 10:42 震撼起飞 阅读(530) 评论(0) 推荐(0)

关于 bind 和 dns(二)
摘要:进一步,bind 自编译,带 GeoIP 支持,针对不同地区客户端提供不同 view 编译后,环境安装 安装必要组件 #wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm#rpm -Uvh epel- 阅读全文

posted @ 2022-11-07 17:36 震撼起飞 阅读(43) 评论(0) 推荐(0)

linux 下使用 bash 发邮件
摘要:1、开启postfix邮件服务systemctl start postfix 2、设置/etc/mail.rc set from=84631xxxx@qq.com #设置发件人set smtp=smtp.qq.com #设置smtp服务器地址set smtp-auth-user=84631xxxx 阅读全文

posted @ 2022-10-31 10:08 震撼起飞 阅读(205) 评论(0) 推荐(0)

Linux 搭建 rsync 后台服务
摘要:步骤1: 安装:yum install rsync -y 步骤2:编辑 /etc/rsyncd.conf 特别注意: 1、这是安装后默认带的,如果你其他另建一个,默认先搜索到这个位置配置文件 2、配置文件内,参数后不要带注释, 例如“ uid = root #这是啥啥啥 ” 这种可能产生意想不到错误 阅读全文

posted @ 2022-10-27 09:22 震撼起飞 阅读(302) 评论(0) 推荐(0)

利用 IPTABLES 防范同ip一个时间段内多包的轰炸
摘要:开始前,iptables 的基本参数解释:https://www.cnblogs.com/zclzhao/p/5081590.html 方法1:利用 limit 模块 这个匹配操作必须由-m limit明确指定才能使用 例如:你指定了--limit 3/minute --limit-burst 5  阅读全文

posted @ 2022-10-23 08:46 震撼起飞 阅读(119) 评论(0) 推荐(0)

带提示删除目录下的每个子目录
摘要:ls -l |awk '/^d/ {print "start rm "$NF;system("rm -rf "$NF);print "done!"}' 遍历2层目录并删除 for i in `ls -d *`; do for j in `ls -d $i/*`; do echo "rm -rf $j 阅读全文

posted @ 2022-10-21 14:23 震撼起飞 阅读(17) 评论(0) 推荐(0)

xfs系统根目录满扩展
摘要:增加物理磁盘,虚拟机则直接扩展空间即可 1、增加分区 fdisk -l 查看当时分区表,得到新扩展的设备名例如 /dev/sda3 fdisk /dev/sda n 新增加分区 p 主分区 3 选择分区编号 按默认扩展所有空间 t 更改分区标志 8e 更改为 uninx LVM w 保存退出 2、格 阅读全文

posted @ 2021-07-17 12:44 震撼起飞 阅读(237) 评论(0) 推荐(0)

find 语句过滤掉某个目录搜索
摘要:查找/data/web/ssy/online路径下除tmp目录之外的目录,并统计目录大小,以G位单位进行排序(默认为降序),并统计前10个大小的目录。命令如下 # find /data/web/ssy/online/* -path /data/web/ssy/online/tmp -prune -o 阅读全文

posted @ 2021-06-20 18:14 震撼起飞 阅读(411) 评论(0) 推荐(0)

ubuntu 读取群晖 nas 盘
摘要:apt-get updateapt-get install -y mdadm lvm2mdadm -Asf && vgchange -ay 如果提示类似 ...array that is already active: /dev/md/2 则运行命令停止 mdadm -S /dev/md/2 后再运 阅读全文

posted @ 2020-12-19 11:57 震撼起飞 阅读(3243) 评论(0) 推荐(0)

关于 bind 和 dns(一)
摘要:1、安装 yum install -y bind bind-utils 2、配置 1)/etc/named.conf 修改监听端口 listen-on port 53 { any; }; 2)/etc/named.rfc1912.zones 添加一个区域 zone "dns.xxxxxxx.com" 阅读全文

posted @ 2020-06-05 00:22 震撼起飞 阅读(285) 评论(0) 推荐(0)

Macos下制作可启动的u盘(转)
摘要:Download the desired file Open the Terminal (in /Applications/Utilities/ or query Terminal in Spotlight) Convert the .iso file to .img using the conve 阅读全文

posted @ 2020-04-19 00:28 震撼起飞 阅读(268) 评论(0) 推荐(0)

mac book 安装brew
摘要:下载编译最新版 mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew cd bin 目录下 ./brew install 你要的 阅读全文

posted @ 2020-02-02 21:54 震撼起飞 阅读(436) 评论(0) 推荐(0)

ssh 与服务器保持连接
摘要:直接改客户端,服务器端不应该更改。sudo vi /etc/ssh/ssh_config # 或 ~/.ssh/config TCPKeepAlive=yes # Client每隔 60 秒发送一次请求给 Server,然后 Server响应,从而保持连接 ServerAliveInterval 6 阅读全文

posted @ 2019-12-21 08:20 震撼起飞 阅读(1176) 评论(0) 推荐(0)

centos7 安装 python3
摘要:sudo yum -y updatesudo yum -y install openssl-devel libffi-devel bzip2-develsudo yum -y groupinstall "Development Tools"#安装 Python 3.10 必需的 openssl >= 阅读全文

posted @ 2019-10-01 21:57 震撼起飞 阅读(177) 评论(0) 推荐(0)

关于 ros
摘要:1、https://mikrotik.com/download 下载 x86 架构的 cd image (当日这是试用版,特殊版下载后道理一样) 2、exsi 上传,并新建 linux 的 其他linux 64位 虚拟机, 添加所有网卡(至少 lan 、 wan),注意: 硬盘必须使用 ide , 阅读全文

posted @ 2019-08-11 23:31 震撼起飞 阅读(289) 评论(0) 推荐(0)

vmware centos 扩容
摘要:1、停止后vmware 扩容 2、centos 增加分区 3、创建 pv 设备,并加入 vg 阅读全文

posted @ 2019-07-28 17:13 震撼起飞 阅读(151) 评论(0) 推荐(0)

linux 最新化安装后安卓 KDE 桌面
摘要:安装汉字字符集支持 安装拼音收入法 阅读全文

posted @ 2019-02-23 20:33 震撼起飞 阅读(185) 评论(0) 推荐(0)

solusvm 主控端迁移
摘要:难点在于solusvm被控端已经开了小鸡的情况。 备份数据库: 新主动端恢复数据库: 注意恢复数据库后,重新到界面对node,更新其key password。 顺便改进下,做个快键键登录连接数据库: 阅读全文

posted @ 2019-02-23 13:06 震撼起飞 阅读(416) 评论(0) 推荐(0)

导航