在 VMware(VMware Fusion M1) vm 中,使用 chrony 配置时钟同步,但将 vm suspend 一段时间再 resume,时间不会同步,还是此前的时间。这可能是 VMware 本身的 bug,在折腾了不少时间后,终于可以正常运行,以下是配置(/etc/chrony/chrony.conf):
# Welcome to the chrony configuration file. See chrony.conf(5) for more
# information about usable directives.
# Include configuration files found in /etc/chrony/conf.d.
confdir /etc/chrony/conf.d
# This will use (up to):
# - 4 sources from ntp.ubuntu.com which some are ipv6 enabled
# - 2 sources from 2.ubuntu.pool.ntp.org which is ipv6 enabled as well
# - 1 source from [01].ubuntu.pool.ntp.org each (ipv4 only atm)
# This means by default, up to 6 dual-stack and up to 2 additional IPv4-only
# sources will be used.
# At the same time it retains some protection against one of the entries being
# down (compare to just using one of the lines). See (LP: #1754358) for the
# discussion.
#
# About using servers from the NTP Pool Project in general see (LP: #104525).
# Approved by Ubuntu Technical Board on 2011-02-08.
# See http://www.pool.ntp.org/join.html for more information.
# modify by demon, 2023.02.08
pool ntp.aliyun.com iburst minpoll 1 maxpoll 2
pool ntp1.aliyun.com iburst minpoll 1 maxpoll 2
pool ntp2.aliyun.com iburst minpoll 1 maxpoll 2
pool time1.cloud.tencent.com iburst minpoll 1 maxpoll 2
pool time2.cloud.tencent.com iburst minpoll 1 maxpoll 2
pool time3.cloud.tencent.com iburst minpoll 1 maxpoll 2
pool ntp.tuna.tsinghua.edu.cn iburst minpoll 1 maxpoll 2
pool ntp.ntsc.ac.cn iburst minpoll 1 maxpoll 2
# Use time sources from DHCP.
sourcedir /run/chrony-dhcp
# Use NTP sources found in /etc/chrony/sources.d.
sourcedir /etc/chrony/sources.d
# This directive specify the location of the file containing ID/key pairs for
# NTP authentication.
keyfile /etc/chrony/chrony.keys
# This directive specify the file into which chronyd will store the rate
# information.
driftfile /var/lib/chrony/chrony.drift
# Save NTS keys and cookies.
ntsdumpdir /var/lib/chrony
# Uncomment the following line to turn logging on.
#log tracking measurements statistics
# Log files location.
logdir /var/log/chrony
# Stop bad estimates upsetting machine clock.
maxupdateskew 100.0
# This directive enables kernel synchronisation (every 11 minutes) of the
# real-time clock. Note that it can’t be used along with the 'rtcfile' directive.
rtcsync
# Step the system clock instead of slewing it if the adjustment is larger than
# one second, but only in the first three clock updates.
#makestep 1 3
makestep 1 -1
# Get TAI-UTC offset and leap seconds from the system tz database.
# This directive must be commented out when using time sources serving
# leap-smeared time.
leapsectz right/UTC
主要改动点:
1、ntp 服务器地址,如 pool ntp.aliyun.com iburst minpoll 1 maxpoll 2 ;
2、强制 chronyd 步进系统时钟:makestep 1 -1。
其中起主要作用的是第 2 点。关于这些参数的含义,请参考官方文档。
P.S. 预操作(如安装 chrony 等),以下基于 Ubuntu 22.04:
1、移除可能已经默认安装的 ntp 服务:
sudo apt remove ntp -y;
2、安装 chrony 服务:sudo apt install chrony -y;
3、启用并启动 chrony 服务:sudo systemctl enable chrony.service && sudo systemctl start chrony.service;
4、配置时间同步:sudo timedatectl set-ntp trueubuntu-2204% timedatectl Local time: Fri 2023-02-10 10:45:47 CST Universal time: Fri 2023-02-10 02:45:47 UTC RTC time: Fri 2023-02-10 02:45:48 Time zone: Asia/Shanghai (CST, +0800) System clock synchronized: yes NTP service: active RTC in local TZ: no ubuntu-2204%相关逻辑可以通过
man timedatectl和man systemd-timedated.service了解。
买电子书会员的好处之一,就是可以把书库当做字典来用。
当你想了解某个方面的知识时,可以直接打开相关的书籍学习,这可能要比看各类博客更靠谱,因为那些内容的质量没有保障,参差不齐。
你可以只翻一翻,或者看看目录,对整个知识体系有一个粗略的了解;
你也可以深入阅读某个章节,对标工作时遇到的一个难题。
同样,在某个平台上买很多网络课程,也可以这么用。
一个平台就是一个知识库,记得多用,多搜索。
1、对一种事物的上瘾,是对另一种事物的逃避。
2、《断舍离》中提到三种扔不掉东西的人:
- 逃避现实型
- 执着过去型
- 担忧未来型
3、我们要断舍离的不仅仅是物质垃圾,还有精神垃圾。
4、当我们想逃避现实的时候,正是空虚、孤独、无聊的时候,这些时候有一个共同点——意志力不足。这就导致我们很容易被“奶头乐”产品所吸引。一方面你的空虚寂寞冷产生了市场需求,另一方面奶头乐制造商给予你及时满足,这是一场合谋。如果我们不给自己及时干预,就会被算法操控。
5、那些我本该去阅读、跑步、陪伴家人、睡觉的时间,统统被短视频占据。猛然发现,短视频上的知识,根本不是真正的知识,它本质上是用知识拿来娱乐。当知识仅仅起到了娱乐的作用,那么它本质上和搞笑段子没有区别。
6、最容易被廉价快感吸引的人,是没有思想体系和内在秩序的人。因为不独立思考,所以就会被他人教唆;因为内心不平静,所以就会被奶头乐撩拨。
7、使用这些创造型APP的时候,你是在「主动」地使用手机,手机只是你的工具。而当你使用消费型APP的时候,你是在「被动」地接收信息,你容易被手机操控。
摘录自「楠子破圈」《手机上的廉价快感,真的得戒掉》
99% 的人都在被手机 APP 消费,只有 1% 的人在创作,这就是我们为啥平庸的原因。
告诉自己,不只是当个看客,而是躬身入局,动起手来:
Internet 可能是最有效率的信息工具,但同时也是最险恶的网络环境。
摘录自《Linux 网络管理员指南》
人活在这个世上,每一日都有每一日的麻烦,每一日都有每一日的烦恼。当你站在每一天里面对它们,心境会随之起伏不定。但是只要把时间稍微放得长久一点,所有的细节,所有的波动都会被抚平。这两年间,我亲身经历过短视频对阅读的掠夺,眼见着阅读量一天比一天跌下去,眼见着赞赏金额去掉一半,去掉四分之三,直到公众号全盛时代的十分之一。
…
如果一个人有一件自己喜欢做的事,再加上自己比较傻一点,世间的纷纷扰扰,每一个当下的困难和烦恼就不会构成多大的问题—时间会像熨斗一样,把一切都熨平整。
…
这件事整体上就跟坚持无关,和毅力无关,只和一个人如何与他自己相处有关,如何看待时间和生命有关,如何对付困难和烦恼有关。人生中的诸多问题,哪里是可以靠坚持和毅力就能解决的?
…
大家各自也都在自己的路上,有些人走起来热闹,有些人走起来孤独,但是每一个人所面临的课题都是一致的,那就是应该拥有怎样的一颗心才能走远路。我说这样走就可以,这是我的走法。那么,在你知道一种可能之后,你也需要找到你自己的走法。
摘自和菜头·《连更两年》。
别说日更,我连周更都做不到,膜拜。
还是那句话,要想拥有更多的同理心,去写作,去做事,去行动。
通过 awk 来分割字符串:docker images|awk '{print $1}'
但如果要对分割的字符串进行拼接呢?使用方式如下:
docker images|awk '{print $1 ":"$2}'
劳东燕教授:
强调努力学习与认真做事,不是为了追求世俗意义上的成功,而是为了你们将来有更多的选择自由。倘若有一天,你们觉得周遭的环境不适合自己,有一点防身的本领,至少让你们不至于失去“仰天大笑出门去”的豪气,无需一味地忍耐或者委屈自己,仰人鼻息地过上一辈子。
服务网格的由来:
容器编排系统管理的最细粒度只能到达容器层次,在此粒度之下的技术细节,仍然只能依赖程序员自己来管理,编排系统很难提供有效的支持。
一开始,Google 拒绝将 istio 捐献给 CNCF,但我看官网最近的公告:CNCF 已正式接受 Istio 成为孵化项目(2022-09-28)。
这背后应该又有很多故事吧。
服务网格中流量劫持的三种方式:
Who am I ?
Where did I come from ?
Where do I go to find out ?