1. 年月日时间
    current_timestamp
  2. 时间
    current_time

3.年月日
current_data

  1. 年月日时间
    now()
  2. 年月日
    curdate()

6.时间
curtime()

7.
将当前时间插入数据库

insert into t_login(user_id,login_time) values (1,CURRENT_TIMESTAMP);

8.日期差值计算
select datediff(日期1,current_timestamp)

set @dt2 = '2010-10-10 10:10:10.123456';
set @dt1 = '2011-12-13 14:15:16.223456';

select datediff(@dt1,@dt2); -- 429(返回天数)
select timediff(@dt1,@dt2); -- 838:59:59.000000(返回日期类型,返回time差值)
select period_diff(@dt1,@dt2); -- 1 (返回月数)

select timestampdiff(unit,datetime_expr1,datetime_expr2)
eg:
select timestampdiff(year,@dt1,@dt2); -- -1
select timestampdiff(day ,@dt1,@dt2); -- -429
select timestampdiff(hour,@dt1,@dt2); -- -10300

9.format 格式化标识
%W 星期名字(Sunday……Saturday)
%D 有英语前缀的月份的日期(1st, 2nd, 3rd, 等等。)
%Y 年,数字, 4 位
%y 年, 数字, 2 位
%a 缩写的星期名字(Sun……Sat)
%d 月份中的天数, 数字(00……31)
%e 月份中的天数, 数字(0……31)
%m 月, 数字(01……12)
%c 月, 数字(1……12)
%b 缩写的月份名字(Jan……Dec)
%j 一年中的天数(001……366)
%H 小时(00……23) %k 小时(0……23)
%h 小时(01……12) %I 小时(01……12)
%l 小时(1……12) %i 分钟, 数字(00……59)
%r 时间,12 小时(hh:mm:ss [AP]M)
%T 时间,24 小时(hh:mm:ss)
%S 秒(00……59)
%s 秒(00……59)
%p AM或PM
%w 一个星期中的天数(0=Sunday ……6=Saturday )
%U 星期(0……52), 这里星期天是星期的第一天
%u 星期(0……52), 这里星期一是星期的第一天

Windows 10 / Windows 8 / Windows 7 / Server 2008 / Vista:
在这几个系统版本中,我们可以用 netsh advfirewall 命令来配置防火墙。三种网络(域,专用,公共)的防火墙设置都不相同。因此,根据要启用/禁用的网络防火墙,命令将有所不同。

请在管理员模式的CMD命令提示符中输入下列命令
为当前网络配置防火墙(与域/专用/公用网络无关)

打开当前网络防火墙
netsh advfirewall set currentprofile state on

关闭当前网络防火墙
netsh advfirewall set currentprofile state off
域网络

打开域网络防火墙
netsh advfirewall set domainprofile state on

关闭域网络防火墙
netsh advfirewall set domainprofile state off
专用网络

打开专用网络防火墙
netsh advfirewall set privateprofile state on

关闭专用网络防火墙
netsh advfirewall set privateprofile state off
公用网络

打开公用网络防火墙
netsh advfirewall set publicprofile state on

关闭公用网络防火墙
netsh advfirewall set publicprofile state off
所有网络

打开所有网络防火墙
netsh advfirewall set allprofiles state on

关闭所有网络防火墙
netsh advfirewall set allprofiles state off
较旧的Windows版本 – XP / Server 2003

启用防火墙
netsh firewall set opmode mode=ENABLE

禁用防火墙
netsh firewall set opmode mode=DISABLE

https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/

ubuntu18版本:

默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

预发布软件源,不建议启用

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

  1. 安装ssh server

sudo apt-get install openssh-server

  1. 修改端口

vim /etc/ssh/sshd_config

port 22

3.允许ROOT登录
vim /etc/ssh/sshd_config

PermitRootLogin yes
PermitEmptyPasswords no

4.重启ssh守护进程

sudo service ssh restart