Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Simple configuration shell scripts virtual machine environment experiment     - Use smartmontools view the health status of hard disk (Linux)

- Raspberry Pi configuration wireless hotspot (Linux)

- Kali Linux virtualbox rc = Error 1908 workaround (Linux)

- Oracle 11g new features of the collection of multi-column statistics (Database)

- How to use Quagga BGP (Border Gateway Protocol) router to filter BGP routing (Linux)

- ORA-12545: Connection failed because the target host or object does not exist (Database)

- Ansible module Know (Linux)

- Oracle11g build physical standby database (Database)

- Read and write files efficiently from Apache Kafka (Server)

- MySQL Installation Troubleshooting (Database)

- CentOS7 management of systemd (Linux)

- Do you know how to build the Linux kernel (Programming)

- Hazelcast integration with MongoDB (Database)

- Python Django direct implementation of sql statement (Programming)

- Ubuntu 14.04 / Linux Mint 17 How to install the MintMenu 5.5.2 menu (Linux)

- Kali Linux resolve GPG error KEYEXPIRED 1425567400 (Linux)

- How to achieve the MySQL Oracle table associated with the two operations update (Database)

- Android Delete project useless resource file (Programming)

- Database start listening TNS-12537, TNS-12560 error (Database)

- Learning how to teach safety system to prevent your own IP leakage (Linux)

  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"
  echo "1 # The iptables stop failed"
# 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
      mount / dev / cdrom $ mountdir &> / dev / null
      echo "3 # The CD-ROM is mounting successfully"
  echo "3 # The CD-ROM is already mounted"
# 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
  echo "4 # Starting config the source of yum"
    sleep 3
 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
- Git Rebase Tutorial: Using Git Rebase turn back the clock (Linux)
- Oracle RMAN-06023 and ORA-19693 errors (Database)
- Nginx supports user multi-threaded downloads and resume broken (Server)
- Explore Android SQLite3 multithreading (Programming)
- Getting Started with Linux: Nginx Web Server How to Block Specific User Agents (UA) (Server)
- Use calcurse schedule appointments and to-do in the Linux terminal (Linux)
- The several technical presentation Raid under Linux (Linux)
- Vim Common Command Summary (Linux)
- Install Ubuntu 14.04 and Windows 8 / 8.1 dual-boot in UEFI mode (Linux)
- Squid proxy server configuration under Linux (Server)
- Kali Linux virtualbox rc = Error 1908 workaround (Linux)
- IP configuration under Linux (Linux)
- Linux System Getting Started Learning: The Linux log (Linux)
- Linux security settings Notes (Linux)
- Oracle 10g, 11g database silent installation of small differences (Database)
- Sort sql MySQL 5.6 upgrade slow Cause Analysis (Database)
- Linux basic introductory tutorial ---- simple text processing (Linux)
- Monitoring Linux System 7 command-line tool (Linux)
- C # socket udp broadcast (Programming)
- HTTPS and SSH and use the difference between the way: Git User's Manual (Linux)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.