enjoy coding, enjoy life.

Code

Adjust Console Resolution on Ubuntu Server 24.04 LTS

Today I installed Ubuntu Server 24.04.2 LTS from the ubuntu-24.04.2-live-server-amd64.iso on a small PC that now sits under my desk.

The monitor is a Dell U2723QX (27", 3840×2160).

After first boot the console characters were barely 1 mm high—fine for 30 cm viewing distance, not for normal use.

Life

Arthur Aron’s 36 questions

TBBT 的 S08E16 中 Sheldon 和 Penny 亲密加速实验有点意思,核心是两个人之间互相坦白自己内心隐藏的脆弱,来达成共同的对生命的理解。不过感觉这个和表白一样,能愿意一起互相坦诚就已经非常亲密了。羡慕。

找到了一个 PDF和另一个介绍,试翻译并存档如下:

第一组(浅层次问题)

  1. Given the choice of anyone in the world, whom would you want as a dinner guest?
    **中文:**如果可以选择世界上任何人作为晚餐客人,你会选择谁?

  2. Would you like to be famous? In what way?
    **中文:**你想出名吗?以什么方式?

  3. Before making a telephone call, do you ever rehearse what you are going to say? Why?
    **中文:**在打电话之前,你是否会预演一下要说的话?为什么?

  4. What would constitute a “perfect” day for you?
    **中文:**对你来说,“完美”的一天是什么样的?

  5. When did you last sing to yourself? To someone else?
    **中文:**你最后一次给自己或别人唱歌是什么时候?

  6. If you were able to live to the age of 90 and retain either the mind or body of a 30-year-old for the last 60 years of your life, which would you want?
    **中文:**如果你能活到90岁,但在之后的60年里,你可以选择保持30岁的身体或30岁的心智,你会选择什么?

  7. Do you have a secret hunch about how you will die?
    **中文:**你有没有一种神秘的直觉,关于你会怎么死?

  8. Name three things you and your partner appear to have in common.
    **中文:**说出三个你和伴侣似乎共同拥有的东西。

  9. For what in your life do you feel most grateful?
    **中文:**你对生活中什么最感激?

  10. If you could change anything about the way you were raised, what would it be?
    **中文:**如果你可以改变你成长过程中的任何一件事,你会改变什么?

  11. Take four minutes and tell your partner your life story in as much detail as possible.
    **中文:**用四分钟的时间,尽可能详细地向你的伴侣讲述你的生活故事。

  12. If you could wake up tomorrow having gained any one quality or ability, what would it be?
    **中文:**如果你明天醒来时获得了一种品质或能力,你会希望是什么?


第二组(中等深度问题)

  1. If a crystal ball could tell you the truth about yourself, your life, the future or anything else, what would you want to know?
    **中文:**如果一个水晶球能告诉你关于你自己、你的生活、未来或任何事情的真相,你想知道什么?

  2. Is there something that you’ve dreamed of doing for a long time? Why haven’t you done it?
    **中文:**有没有什么事是你很久以前就梦想要做的?为什么还没有做?

  3. What is the greatest accomplishment of your life?
    **中文:**你生命中最大的成就是什么?

  4. What do you value most in a friendship?
    **中文:**在友谊中,你最看重什么?

  5. What is your most treasured memory?
    **中文:**你最珍贵的记忆是什么?

  6. What is your most terrible memory?
    **中文:**你最糟糕的记忆是什么?

  7. If you knew that in one year you would die suddenly, would you change anything about the way you are now living? Why?
    **中文:**如果你知道你将在一年后突然死去,你会改变你现在的生活方式吗?为什么?

  8. What does friendship mean to you?
    **中文:**友情对你来说意味着什么?

  9. What roles do love and affection play in your life?
    **中文:**在你的生活中,爱和感情扮演什么角色?

  10. Alternate sharing something you consider a positive characteristic of your partner. Share a total of five items.
    **中文:**交替分享你认为伴侣的一个积极特质。总共分享五个项目。

  11. How close and warm is your family? Do you feel your childhood was happier than most other people’s?
    **中文:**你的家庭亲密温暖吗?你觉得你的童年比其他人的更幸福吗?

  12. How do you feel about your relationship with your mother?
    **中文:**你对你和母亲的关系感觉如何?


第三组(深层次问题)

  1. Make three true “we” statements each. For instance, “We are both in this room feeling … ”
    **中文:**每人说出三个真实的“我们”陈述。例如:“我们都在这个房间里感觉……”

  2. Complete this sentence: “I wish I had someone with whom I could share … ”
    **中文:**完成这个句子:“我希望我能有一个人可以和TA分享……”

  3. If you were going to become a close friend with your partner, please share what would be important for him or her to know.
    **中文:**如果你要和你的伴侣成为亲密的朋友,请分享什么对他们来说是重要的。

  4. Tell your partner what you like about them; be very honest this time, saying things that you might not say to someone you’ve just met.
    **中文:**告诉你的伴侣你对他们的喜欢之处;这次要非常诚实,说出你可能不会对刚认识的人说的话。

  5. Share with your partner an embarrassing moment in your life.
    **中文:**与你的伴侣分享你生命中的一个尴尬时刻。

  6. When did you last cry in front of another person? By yourself?
    **中文:**你最后一次在别人面前哭是什么时候?自己一个人哭是什么时候?

  7. Tell your partner something that you like about them already.
    **中文:**告诉你的伴侣你已经喜欢上他们的什么。

  8. What, if anything, is too serious to be joked about?
    **中文:**有什么事情是太严肃而不能开玩笑的吗?

  9. If you were to die this evening with no opportunity to communicate with anyone, what would you most regret not having told someone? Why haven’t you told them yet?
    **中文:**如果你今晚就要死去,没有机会与任何人交流,你会最遗憾没有告诉某人什么?为什么还没有告诉他们?

  10. Your house, containing everything you own, catches fire. After saving your loved ones and pets, you have time to safely make a final dash to save any one item. What would it be? Why?
    **中文:**你的房子,包含你所有的物品,着火了。在救出你所爱的人和宠物之后,你有时间安全地最后冲进去救一件物品。你会救什么?为什么?

  11. Of all the people in your family, whose death would you find most disturbing? Why?
    **中文:**在你的家人中,谁的死会让你最难受?为什么?

  12. Share a personal problem and ask your partner’s advice on how he or she might handle it. Also, ask your partner to reflect back to you how you seem to be feeling about the problem you have chosen.
    **中文:**分享一个个人问题,并征求伴侣关于他或她如何处理这个问题的建议。同时,要求伴侣反馈你对所选问题的感受。

Life

简单的生活和精神的自由

那年的一个夏日,我背了一个小书包,手提一只 22 寸旅行箱,那就是我的全部。轻轻带上门,走出出租屋,去异国他乡,像只是换一趟地铁,却再也没有返程。

那时的我一无所有,却也一身轻松:一张车票、几件白 T-shirt、一双帆布鞋,就能让我相信——随时可以离开,也随时能够抵达。我以为这份轻盈会伴随我一生。

Code

不使用 docker-desktop 怎么启用 docker 和 docker buildkit

在 macOS 上,Docker Desktop 是一个非常流行的选择,但它并不是唯一的方案。如果你不想使用 Docker Desktop,或者希望寻找一个更轻量级的替代方案,Colima 是一个不错的选择。Colima 是一个用于 macOS 和 Linux 的容器运行时管理工具,它提供了极简的设置流程,同时支持多种容器运行时,包括 Docker 和 Kubernetes。本文将介绍如何使用 Colima 启用 Docker 和 Docker BuildKit,让你在不依赖 Docker Desktop 的情况下,也能高效地进行容器开发。

Snippets

Print All Structures in a Golang Package

The program is designed to traverse and analyze Go language source code within a specified package directory. It utilizes the go/parser and go/token packages to parse the abstract syntax tree (AST) of each Go file. The main functionality includes:

  1. Parsing Package Files: The program reads and parses all Go files within a given directory, creating an AST for each file.

  2. Identifying Struct Definitions: It searches through the AST to find all declarations of struct types.

  3. Preserving Comments: The program retains comments that are associated with the struct definitions and their fields.

  4. Formatting and Printing Structs: The struct types, along with their fields and associated comments, are formatted to resemble the original Go code. The program uses the go/format package to ensure that the output closely matches the syntax and style of handwritten Go code.

  5. Output: The program outputs the struct definitions to the standard output (console), allowing users to see the struct types and associated comments in a readable format.

The program is invoked by running the main.go file with the -path flag set to the path of the Go package directory to be analyzed. The output can be used for documentation purposes, code reviews, or as a reference when working with existing codebases.

Life

该不该和 AI 说谢谢?

我们排除掉所有各种概率和统计方面的讨论,只介绍下现在的 GPT 是怎么构造的吧。

Code

HBase Basic Introduction and Some Practical Principles

Apache HBase is a high-performance, open-source, distributed NoSQL database designed specifically for the Hadoop ecosystem, especially suitable for scenarios that require fast random read and write access to large datasets. This article will introduce the basics of HBase and use business scenarios of Users, Jobs, and their Subtasks to illustrate related concepts.

Code

Vim 的多行编辑功能

在使用 Vim 进行文本编辑时,我们经常需要对多行文本进行统一的操作,比如添加或删除特定的字符。以下是一些实用的 Vim 技巧,帮助我们快速完成这些任务。

Code

MySQL Binary Logs (binlog) Management

The MySQL binary log contains “events” that describe database changes such as table creation operations or changes to table data. It is the oplog of mysql, and we can subscribe the log to follow all the actions.

Life

学习做一个有品味的人

说实话,我现在还是感觉很难接受这样的事实,总有一种不真实的感觉。传说陈皓已经离世。

Life

有个校友

我们中学也有出过不少院士。不过一般就是校史里面列一个数字,名字都不全。但是,学校里面呢,有两个雕像。一个是大门附近的广场上,有个孔子立像。大概但凡是搞教育的,都拿这个形象其实都有点模糊的做个招牌吧。