运维工具

Python 类高级用法梳理

#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/8/20 8:44 # @Author : Ropon # @File : test6.py # class Foo(object): # # def __iter__(self): # # return iter([12, 34...

Ftp 一键安装shell脚本

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top InstallFtp() { pushd $BaseDir # 批量下载并解压所需包 for key in ${!FtpFiles[*]}; do [ ! -f ${FtpFiles[$key]}.tar.gz ] && Dow...

Python 装饰器小结

#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/6/3 13:36 # @Author : Ropon # @File : 12_02.py # 装饰器 # def warpper(fn): # def inner(): # print("装饰函数执行前"...

shell 变量

# 定义普通变量 只能由字母、数字、下划线组成,只能以字母或下划线开头 web_path=/home/wwwroot web_path='/home/wwwroot' web_path="/home/wwwroot" web_path=$(pwd) # 命令执行结果赋给变量 # awk输出 ...

Centos批量绑定IPV6地址

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top eth0f="/etc/sysconfig/network-scripts/ifcfg-eth0" resf="/etc/resolv.conf" ipv6="" ipgw="" restartflag=0 Help() { echo "Usage: ./$(basen...

初识shell

#!/bin/bash # 脚本第一行指定那个解释器来执行 # Date: # Author: # Blog: # Description: # Version: #查看默认shell echo $SHELL grep root /etc/passwd #增加vi别名 alias vi='vim' echo "alias vi=...

Mysql 一键安装shell脚本

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top RunUser=mysql InstallMysql() { pushd $BaseDir [ "${MysqlVer}" == "5.7.25" ] && MysqlModulesOptions="-DWITH_BOOST=boost" #if [ ...

Php 一键安装shell脚本

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top InstallPhp() { pushd $BaseDir # 批量检测并创建所需目录 for key in ${!PhpDirs[*]};do [ ! -d "${PhpDirs[$key]}" ] && mkdir -p ...

Centos7.x 一键优化shell脚本

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top LANG=en_US.UTF-8 Mem=`free -m | awk '/Mem:/{print $2}'` Swap=`free -m | awk '/Swap:/{print $2}'` InitBase() { # 检查是否有wget命令 whic...

Nginx 一键安装shell脚本

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top InstallNginx() { pushd $BaseDir # 批量下载并解压所需包 for key in ${!NgFiles[*]}; do [ ! -f ${NgFiles[$key]}.tar.gz ] && Dow...