chrony 同步系统时间

chrony 配置文件使用腾讯外网ntp grep tencent /etc/chrony.conf -A 2 -B 2 # Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). server ntp1.tencent.com iburst server ntp2.tencent.com iburst server ntp3.tencent.com iburst server ntp4.tencent.com iburst server ntp5.tencent.com iburst # Record the rate at which the system clock gains/losses time.

Published
Categorized as linux

如何使用nologin用户执行命令

nologin 用户执行命令 [root@node1 ~]# ls -al /tmp/qemu-user-test ls: cannot access ‘/tmp/qemu-user-test’: No such file or directory [root@node1 ~]# su -s /bin/bash -c ‘echo “i am nologin user.” > /tmp/qemu-user-test’ qemu [root@node1 ~]# ls -al /tmp/qemu-user-test -rw-r–r– 1 qemu qemu 19 Jan 31 11:29 /tmp/qemu-user-test [root@node1 ~]# cat /tmp/qemu-user-test i am nologin user.

Published
Categorized as linux

linux原生支持的格式化文件方法

利用python格式json python -m json.tool echo ‘{“list”:[{“a”:”1″},{“b”:”2″}]}’ |python -m json.tool cat x.json {“list”:[{“a”:”1″},{“b”:”2″}]} python -m json.tool x.json { “list”: [ { “a”: “1” }, { “b”: “2” } ] } 利用python计算 python -c ‘print(123+456+7.89)’ xmllint格式化xml文件 xmllint –format pom.xml

Published
Categorized as linux