Posts in category “Essays”

书摘:《斯通纳》

作者:约翰·威廉斯

我当时的点评:

2016/9/2 认为好看 一本真实的不能再真实的书。这是作者的自传吗?如果是我,死前会去见她一面的。

注:当时我一口气读完了这本书,花了五个小时。

他辛苦追求的宁静,当意识到自己生活中的时间那么少,而要读的东西那么多,要知道的事情那么多,这份宁静开始破碎了。

你必须记着自己是什么人,你选择要成为什么人,记住你正在从事的东西的重要意义。有很多人类的战争、失败和胜利,很多并非军事之争,历史著作中也没有记载。要记住这个,当你试图决定要做什么的时候。

当他在打造书房的时候,他打算定义的是他自己。当他为做书架打磨这些旧木板的时候,当他看着表面的粗糙消失,灰色的风雨侵蚀消失,露出基本的木质,最终露出花纹和质地华丽的纯粹时,他逐渐打造成形的是他自己,他要置于某种有序状态的是他自己,他想创造某种可能性的是他自己。

他跟母亲谈到未来的事儿,他想让她跟自己回哥伦比亚。房间多得很,而且(他对这个谎言感到痛心)伊迪丝也会欢迎她来做伴。

当他想到伊迪丝必然还要回来,反而感到非常难过,这点没有必要再对自己掩饰了。

他备受鼓舞,继续发挥自己从来没有被教过要做的东西。对文学、语言以及心智神秘性的热爱,在字母和词语的细腻、奇妙、出其不意的组合中,在最漆黑和冰冷的印刷文字中自动呈现出来——这种爱,他曾经深藏不露,好像那是非法和危险的,现在开始表现这种爱了,起先还是试探性的,接着大胆勇敢,最后就完全是自豪地表现了。

他知道这话是真心的,她是爱着孩子。这种真切的顿悟几乎让他要哭出来。

他发现生活下去不仅是可能的,甚至偶尔有些欢乐也是可能的。
2016/9/1 注: 糟糕的开始,糟糕的持续,不出意外的话,该是糟糕的结束了。

我可能会成为一个很烂的系主任。我既不期待,也不想要这项任命。
2016/9/1 注:他那么真实的活着。我几乎以为他是一个圣人。

他已经到了年岁的这种时刻:经常会想到,而且日益强烈,想到一个如此简单的问题,简单得他都没有办法去面对。他发现自己有些迷茫,自己的生活是否值得过下去,是否有过生活。他认为,这是在某个时候所有人都会想的问

他已经四十二岁,往前,看不到任何自己渴望享受的东西,往后,看不到任何值得费心记住的事物。

你最初爱的那个人并不是你最终爱的那个人,爱不是最终目标而是一个过程,借助这个过程,一个人想去了解另一个人。

他们从激情中萌发,再到情欲,再到深情,这种深情在时时刻刻不断自我翻新着。
2016/9/1 注:不枉人生走一遭

经过这些年,他知道,教学绝对不要重样。

他从阅读的内容中看到了她本人,他想。斯通纳很惊讶,此刻看着她竟如此逼真。忽然,好像她就在隔壁房间,他把她的样子定了好一会儿才消失。他双手刺痒,好像刚刚触摸过她。他的失落感,内心藏了很久的失落感,喷涌而出,彻底将他吞没,他任由这股洪流裹挟着,意志已失去控制。他不想搭救自己。接着他又亲切地笑了,好像是冲着某个记忆而笑。他忽然想到,他都快到六十岁了,应该能够不受这种激情和这种爱的力量左右。

我从来不在乎你认为可以‘给’我的东西,或者你认为可以为我‘做’的东西,或者别的什么玩意儿。”

你是个好人,我想。你肯定也是个好教师。但在好多方面,你是个无知的杂种。”他又停顿了下。“我不知道你究竟盼着什么。可我不想退休——不会在今年退,也不会在明年退。”他缓缓地站起来,站了会儿,好像在积蓄力量。“两位先生抱歉,我有些累了。我得留待你们去讨论你们不得不讨论的事儿了。”

他让服务员移掉妻子的名卡,重新安排了主桌位,这样就不会有个空缺出来。
2022/3/10 注:做事周全滴水不漏已经成了骨子里的习惯

他们已经原谅了曾经对彼此的伤害,他们一心一意想着对曾经一起生活的敬重。

把博客的中文字体改成了汇文明朝体

这个博客使用了 Chyrp-lite 项目,当初之所以选择它,一方面觉得看上去还行,另一方面是因为它是 PHP 写的,而我曾经是一个老PHP程序员,这样万一遇到点什么小毛病可以自己改。我最近知道了一种新字体:汇文明朝体。怎么说呢,这个字体在八十年代相当流行。我那个时候读过的书,多是这种这种印刷体。不知道什么人把它搬到了互联网上,我先是把它用到了我最喜欢的读书app 多看阅读上,今天又琢磨把它移植到我的博客上。闲话少绪,说干就干, 在ChatGPT的帮助之下,把字体转成woff2格式,再改一个CSS文件,不到半小时就整好了。

--- a/themes/blossom/stylesheets/all.css
+++ b/themes/blossom/stylesheets/all.css
@@ -1,8 +1,16 @@
+@font-face {
+    font-family: 'Huiwen Mingchao font';
+    src: url('../../../fonts/汇文明朝体.woff2') format('woff');
+    font-weight: normal;
+    font-style: normal;
+    unicode-range: U+4E00-9FFF;
+}
 @font-face {
     font-family: 'Open Sans webfont';
     src: url('../../../fonts/OpenSans-Regular.woff') format('woff');
     font-weight: normal;
     font-style: normal;
+    unicode-range: U+0020-007E;
 }
 @font-face {
     font-family: 'Open Sans webfont';
@@ -58,8 +66,8 @@ html[lang="he"] {
     background-color: #208448;
 }
 body {
-    font-family: "Open Sans webfont", sans-serif;
-    font-size: 1rem;
+    font-family: "Huiwen Mingchao font", "Open Sans webfont", sans-serif;
+    font-size: 1.2rem;
     color: #1f1f23;
     line-height: 1.5;
     background-color: #f7f5ed;

小记:MacBook Pro Mid 2010 升级 512G 杂牌 SSD

最近 temu (拼多多海外版)很火,老是鼓动着我花钱。这不,满$150刀减$40的优惠券就在那儿晃啊晃,你说我是买啊还是买啊?当然是买买买了!正巧我的老MacBook Pro (Mid 2010) 硬盘才128G,而我的次老MacBook Pro(Mid 2015)硬盘也才256G,都该换了。但我并不想出太多血,所以下单了杂牌 Derlar 512G 和 1T硬盘各一支,又加了一个type-c接口的sd卡读卡器拼单,优惠后 $112.74 包邮。4月8号下的单,今天收到货,爽呆呆。

然而升级过程并非一帆风顺,中间冷汗也是流了不少。

我的这台机器,上次光驱换成128G SSD不久之后,老硬盘就不能识别了。我那会就把老硬盘拆掉当外置硬盘使用。

这次我打算先试试双硬盘,把新盘放到原来的硬盘位置,结果系统不认,小汗,不过因为之前老硬盘也出过时认时不认的问题,我并没有很担心。也许就是线坏了。把新盘换光驱位置,认出来了,开心!

但装系统仍然是个麻烦事。我的次老MacBook Pro是最新系统,而这台老MacBook Pro只支持到 High Sierra,我只好又把老SSD接回去,制作好USB引导盘。再把新硬盘装回去,眼看着顺利进入了系统安装界面,我就放心的出门散步去了。然而...

等我散步回来,机器是关机状态。不对啊。哦,其实不是关机状态,是无限重启状态。这可不是什么好现象。网上搜了一下,说啥的都有。最悲观的说法是硬盘不兼容。可别呀!

Option+Command+Shift+R 进去看了看,咦?新盘的文件系统我怎么用的是 Mac OS Extended (Journaled),记得从 High Sierra起改用APFS了不是?于是重新格式成APFS再安装一遍。漫长的等待之后,成了!

哼!想搞我,没那么容易。不过还是出了一身冷汗。毕竟退货啥的怪麻烦。

This site just moved to Oracle Cloud and upgrated to the latest chyrp-lite version (2023.01)

If you found anything unusal or incorrect, please press Ctrl+Shift+R to reload the page first. If you stil found something wrong, please leave a comment here or contact me at telegram https://t.me/shukebeta

Many thanks

Why did I decide to move/upgrade?

Previously, this site is hosted at my home, on an old dell laptop (4G ram/250G hdd). In general, it works great. However, sometimes, housewife displug this laptop and forget to plug it back. It didn't happen often but it happened several times. Two days ago, we went camping and my wife turned off the whole wiring board to avoid some danger in her mind!

As wife is always right, I decided to move this site to one of the free VM on oracle cloud. And, it is done today! By the way, I upgraded this site to a most recent release. Hope you guys love it.

ChatGPT 帮我发布书摘

我更喜欢用 多看阅读 来读电子书。一方面阅读体验好,另一方面它支持扫描pdf重排。另外,多看的书摘格式即使导出到Email也挺赏心悦目的。许是已经年老的缘故,我最近在收集一些旧文,以及把我历年的读书书摘集中发布在我的blog上。我的blog的编辑器是一个比较简陋的 markdown编辑器,为了确保发布后能有相对美观的格式,我总要手工编辑一下,怪累的。

今天闲来无事,复制粘贴手工发布了几篇书摘后我想,哎,何不让chatGPT帮我写个脚本来简化我的工作。说干就干,于是花了一两个小时,让chatGPT给我写了以下两个脚本:

第一个,负责整理书摘的格式,我给取了个名字就叫 shuzhai

#!/bin/bash

# Check if filename is provided as parameter
if [ $# -ne 1 ]; then
  echo "Usage: $0 filename"
  exit 1
fi

filename="$1"

sed -i '/^$/d' "$filename"
# Add "书摘:" prefix to the first line
sed -i '1s/^/书摘:/' "$filename"
# Add "作者:" prefix to the second line
sed -i '2s/^/作者:/' "$filename"

# Insert an extra empty line before the last non-empty line of the file
sed -i -e ':a' -e '$!{N;ba}' -e 's/\(\S.*\)\n/\1\n\n/' "$filename"

# Run the first sed command to add an extra empty line before the date time
sed -i 's/\([0-9]\{4\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\) [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}/\n&/' "$filename"

# Run the second sed command to add two spaces at the end of each non-empty line
sed -i '/^$/!s/$/  /' "$filename"

第二个脚本,我叫它 publish_shuzhai_to_blog, 它调用前面的 shuzhai脚本,并自动将书摘内容发到我的blog站点。

#!/bin/bash

# Check if filename is provided as parameter
if [ $# -ne 1 ]; then
  echo "Usage: $0 filename"
  exit 1
fi

filename="$1"

if [ ! -f "$filename" ]; then
  echo "File not found: $filename"
  exit 1
fi

if ! [ -r "$filename" ]; then
  echo "File not readable: $filename"
  exit 1
fi

# Check that the file is a text file
if ! file "$filename" | grep -q "text"; then
  echo "Not a text file: $filename"
  exit 1
fi

# Create the logs directory if it doesn't exist
LOG_DIR=~/logs
if [ ! -d "$LOG_DIR" ]; then
  mkdir "$LOG_DIR"
fi

# Create an empty log file if it doesn't exist
LOG_FILE="$LOG_DIR/$(basename "$0").log"
if [ ! -f "$LOG_FILE" ]; then
  touch "$LOG_FILE"
fi

# read the text file and extract the first line as the POST_TITLE
POST_TITLE=$(head -n 1 $1)

# Check if the new file's title is the same as the last processed title
if [ -s "$LOG_FILE" ]; then
  LAST_TITLE=$(tail -n 1 "$LOG_FILE")
  if [ "$LAST_TITLE" = "$POST_TITLE" ]; then
    echo "Error: Duplicate title detected: $POST_TITLE"
    exit 1
  fi
fi

# format the file first
~/bin/shuzhai "$filename"

# re-read the first line as title, as we add "书摘:" as a prefix to the title
POST_TITLE=$(head -n 1 $1)

# Log the new title
echo "$POST_TITLE" >> "$LOG_FILE"

# set the URL of the blog site
BLOG_URL='https://blog.shukebeta.com/admin/add_post/'

# read the rest as the POST_BODY
POST_BODY=$(tail -n +2 $filename)

# build the data for the curl request
DATA=$(cat <<EOF
------WebKitFormBoundaryEznVwciBsbYrRkwB
Content-Disposition: form-data; name="title"

${POST_TITLE}
------WebKitFormBoundaryEznVwciBsbYrRkwB
Content-Disposition: form-data; name="body"

${POST_BODY}
------WebKitFormBoundaryEznVwciBsbYrRkwB
Content-Disposition: form-data; name="status"

public
------WebKitFormBoundaryEznVwciBsbYrRkwB
Content-Disposition: form-data; name="slug"


------WebKitFormBoundaryEznVwciBsbYrRkwB
Content-Disposition: form-data; name="created_at"

$(date +"%Y-%m-%d %H:%M:%S")
------WebKitFormBoundaryEznVwciBsbYrRkwB
Content-Disposition: form-data; name="option[comment_status]"

open
------WebKitFormBoundaryEznVwciBsbYrRkwB
Content-Disposition: form-data; name="tags"

中文, 书摘
------WebKitFormBoundaryEznVwciBsbYrRkwB
Content-Disposition: form-data; name="option[category_id]"

3
------WebKitFormBoundaryEznVwciBsbYrRkwB
Content-Disposition: form-data; name="feather"

text
------WebKitFormBoundaryEznVwciBsbYrRkwB
Content-Disposition: form-data; name="hash"

28ccc1f365e2781c9b0877badb3349cc5ce9945a
------WebKitFormBoundaryEznVwciBsbYrRkwB--
EOF
)

# send the curl request
curl -X POST "${BLOG_URL}" \
     -H 'origin: https://blog.shukebeta.com' \
     -H 'referer: https://blog.shukebeta.com/admin/' \
     -H 'cookie: there is only a place-holder, hahahaha' \
     -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryEznVwciBsbYrRkwB" \
     -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36" \
     --data "${DATA}"

这两个脚本要是我自己来写,怕是要花一整天。感叹!