Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Simple configuration shell scripts virtual machine environment experiment     - Ubuntu U disk do not have write privileges can only read but not write (Linux)

- Ubuntu 12.04 installation instructions under GAMIT10.40 (Linux)

- Experts teach you safety precautions Linux Sniffer (Linux)

- C ++ CBitmap, HBitmap, Bitmap difference and contact (Programming)

- Large site architecture study notes (Server)

- Linux scp remote file copy (Linux)

- Hanoi problem Java Solution (Programming)

- Ubuntu 14.04 installation and configuration environment variable JDK1.8.0_25 (Linux)

- RHEL 5.7 Yum configure local source [Errno 2] No such file or directory (Linux)

- ORA-00020: No more process state objects available (Database)

- The basic method RHEL6 (CentOS6) used in the source package compiled RPM: Upgrade OpenSSH articles (Linux)

- C # function (Programming)

- Linux installation JDK1.6 rpm.bin assembly (Linux)

- MongoDB 3.2 to upgrade from 3.0.7 (Database)

- Lua4.0 interpreter entrance (Programming)

- Android Application Development: an argument between Activity (Programming)

- Change the kernel boot sequence after CentOS 7 kernel upgrade (Linux)

- Java Timer (regular calling, to achieve a fixed time to perform) (Programming)

- C language preprocessor command (Programming)

- Python calls the API interface in several ways (Programming)

 
         
  Simple configuration shell scripts virtual machine environment experiment
     
  Add Date : 2017-01-08      
         
       
         
  Personally wrote a shell script after the discovery, this thing is really convenient when you want to change some trivial details of a small one-time instruction to complete, the script is the best choice, convenient, fast, the key is really lazy essential ah.

As the installation of CentOS6.5 is to minimize installation and experimental environment, that is installed in vmware workstations above, after the initial installation is complete, the configuration information about IP addresses after completion, to do an initial snapshot for the next experiment after, you can quickly restore the system snapshot.

However, due to the requirements of the experimental environment, such as a firewall, SELinux, disc mount, yum source configuration, are most often need to modify the options, and because minimal installation, the system does not vim build tools and man manual query, lead after restoring snapshot, but also to deal with these issues every trivial. To this end, I specifically wrote a small script such, are not complicated, but it is also a learning process, and issued to share with everyone, seek advice by the way ......

#! / Bin / bash
# Config some simple order when the system start
# Create by phoenix
 
# Specify the path
server = / etc / init.d
yum = / etc / yum.repos.d
mountdir = / media / cdrom
selinux = / etc / selinux / config
 
# Stop the iptabes and set it can not start when the system start
$ Server / iptables stop &> / dev / null
if [ "? $" = "0"]; then
  chkconfig iptables off
  chkconfig ip6tables off
  echo "1 # The iptables stop successfully"
else
  echo "1 # The iptables stop failed"
fi
 
# Shutdown the selinxu system
setenforce 0 && sed -e 's / ^ SELINUX = enforcing / SELINUX = disabled / g' $ selinux> $ selinux.bak
mv -f $ selinux.bak $ selinux
echo "2 # The selinux system is disabled"
 
# Mount the CD-ROM
mount | grep sr0 &> / dev / null
if [! "? $" = "0"]; then
  if [! -e $ mountdir]; then
      mkdir -p $ mountdir &> / dev / null
  else
      mount / dev / cdrom $ mountdir &> / dev / null
      echo "3 # The CD-ROM is mounting successfully"
  fi
else
  echo "3 # The CD-ROM is already mounted"
fi
 
# Config the source of yum
if [-e $ yum / CentOS-Base.repo]; then
  mv -f $ yum / CentOS-Base.repo $ yum / CentOS-Base.repo.bak &> / dev / null
else
  echo "4 # Starting config the source of yum"
    sleep 3
fi
 
 sed -e 's / ^ enabled = 0 / enabled = 1 / g' $ yum / CentOS-Media.repo> $ yum / CentOS-Media.repo.bak
 mv -f $ yum / CentOS-Media.repo.bak $ yum / CentOS-Media.repo >> / dev / null
 
yum clean all &> / dev / null && echo "5 # The source of yum configed successfully"
 
# Modify the code of language
echo "# LANG = zh_CN.UTF-8"> / etc / sysconfig / i18n
echo "6 # The language is modify successfully"
 
# Install the tools "VIM" and "MAN"
echo "7 # Starting install vim and man, please wait ......"
sleep 3
yum install vim man -y &> / dev / null
 
# Reboot the system when all the work is done
echo "######### All work is done ########"
sleep 2
echo "Please wait the syatem restart ......"
sleep 2
init 6
     
         
       
         
  More:      
 
- open V switch port mirror in OpenStack neutron (Server)
- Python Flask environment to build (Linux)
- Linux atomic operations and synchronization mechanisms (Programming)
- Linux operating system security can not be ignored (Linux)
- Squid proxy server (Server)
- MySQL uses mysqld_multi to deploy stand-alone multi-instance detail procedures (Database)
- Syncthing: Private Security Synchronization tool to synchronize files between computers / folder (Linux)
- How do I use Linux development environment (Linux)
- count (*) function in MySQL optimization of InnoDB storage engine (Database)
- To install Google Chrome browser under Ubuntu 14.04 LTS (Linux)
- Ubuntu 14.04 to install Blender 2.71 (Linux)
- Build your own Web server under Ubuntu Linux system (Server)
- Vim useful plugin: YouCompleteMe (Linux)
- Vim useful plugin: vundle (Linux)
- To read the Linux ext3 / ext4 format partitions under Windows system software (Linux)
- How to understand the difference between synchronous and asynchronous non-blocking blocking (Programming)
- CentOS 6 Install Linux kernel source (Linux)
- Object-oriented language Java some of the basic features (Programming)
- Java rewrite the hashcode method (Programming)
- MongoDB, Cassandra, HBase transaction design strategy (Database)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.