命令速查

CentOS 7

开机模式

  • 设置开机后以命令模式启动
    systemctl set-default multi-user.target
  • 设置主机名
    hostnamectl set-hostname host-name

防火墙

  • 关闭防火墙
    systemctl stop firewalld.service
  • 禁止防火墙开机自启动
    systemctl disable firewalld.service

时间

  • 设置中国时区
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

网络时间同步

  1. 安装ntpdate工具
    yum -y install ntp ntpdate
  2. 设置系统时间与网络时间同步
    ntpdate cn.pool.ntp.org
  3. 将系统时间写入硬件时间
    hwclock --systohc

SQL

  • 插入随机数
    insert into test values(trunc(random()*1000), 'abcdefg');

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google+ photo

You are commenting using your Google+ account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.