ansible批量更新密码
playbook_PW:- name: 更新密码 hosts: all gather_facts: no vars_files: - host.yml tasks: - name: 修改Root密码...
tar解压指定后缀文件并(不保留路径)
tar -xzvf /home/root/test.tar.gz --wildcards --no-anchored '*.html' --transform 's|.*/||'解释:--wildcards:允许使用通配符匹配。--no-anchored'*.html':匹配所有.html文件(无论它们在压缩包中的路径层次)。--transform&#...
网卡配置备份自动恢复shell脚本
用于备份网卡配置文件后设置一个10分钟后执行的定时任务,自动恢复备份的网卡配置文件并重启网络服务#!/bin/bash# 定义网卡配置文件路径NIC_CONFIG_FILE="/etc/sysconfig/network-scripts/ifcfg-eth0"BACKUP_FILE="/etc/sysconfig/network-scripts/ifcfg-eth0.bak"RESTORE_SCRIPT...
杰奇cms1.7 articlenamepy字段 拼音化脚本
安装必要的依赖:go mod init myprojectgo get github.com/go-sql-driver/mysqlgo get github.com/mozillazg/go-pinyin完整的程序代码:package mainimport ( "database/sql"&nbs...
船说cms修改代码支持mysql持久化
class/Db.phppublic function __construct($dbarr){ $this->dbarr = $dbarr; $tmpstr = $dbarr['pconnect'] ? 'p:' : ''...
php检查nfs目录下文件是否可读
<?phperror_reporting(E_ALL);ini_set('display_errors', 1);function readFileContent($filePath) {// 初始化返回数组$result = array();$result["status"] = "error";$re...
批量删除目录下文件名中的关键字
@echo off@chcp 65001 > nulsetlocal enabledelayedexpansionset "keyword=关键字" REM 替换为你想去除的关键字echo ...
shell普通用户提升权限非交互式嵌套修改root密码
echo "$root_passwd" | su -c "echo '$new_root_passwd' | passwd --stdin root"echo "$weihu_passwd" | sudo -S bash -c &...
macos连接蓝牙音响播放卡顿修复
终端输入下面的命令执行:sudo defaults write bluetoothaudiod "Enable AAC codec" -bool truedefaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editabl...
使用bc简单cpu测压shell
#!/bin/bash# 参数检查if [ $# -ne 3 ]; then echo "Usage: $0 <threads> <duration> <iterations>" exit&n...
Powered By Cheug's Blog
Copyright Cheug Rights Reserved.