• CentOS-7基础配置脚本


    #!/bin/bash
    
    currentTime=$(date +"%Y-%m-%d_%H:%M:%S")
    
    echo "blacklist i2c_piix4"  >> /etc/modprobe.d/blacklist.conf
    echo "blacklist pcspkr" >> /etc/modprobe.d/blacklist.conf
    
    sed -i '/SELINUX=enforcing/s/^/#/'  /etc/selinux/config
    sed -i '/#SELINUX=enforcing/a SELinux=disabled'  /etc/selinux/config
    
    sed -i '/UseDNS yes/s/^/#/' /etc/ssh/sshd_config
    sed -i '/#UseDNS yes/a UseDNS no' /etc/ssh/sshd_config
    sed -i '/#UseDNS no/a UseDNS no' /etc/ssh/sshd_config
    
    # firewall-cmd --zone=public --add-port=5432/tcp --permanent
    firewall-cmd --reload
    
    systemctl stop postfix
    systemctl disable postfix
    yum -y remove postfix
    mariadb_rpm=$(yum list installed | grep mariadb | awk '{print $1}')
    yum -y remove $mariadb_rpm
    
    ###yum_conf
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup$currentTime
    
    cat > /etc/yum.repos.d/CentOS-Base.repo << EOF
    [base]
    name=CentOS-$releasever - Base
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    
    #released updates
    [updates]
    name=CentOS-$releasever - Updates
    # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
    baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
    baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$releasever - Plus
    # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    EOF
    
    yum makecache
    yum -y install java-1.8.0-openjdk
    yum -y groupinstall "Development Tools"
    
    
  • 相关阅读:
    枚举代码(待更新)
    数据类型
    char
    opencv中读写视频
    数据获取与存储
    Mat 与 IplImage 和 CvMat 的转换
    Mat类的输出格式
    Mat 类的内存管理
    Mat_类
    Mat表达式
  • 原文地址:https://www.cnblogs.com/javaite/p/10558217.html
Copyright © 2020-2023  润新知