小记: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再安装一遍。漫长的等待之后,成了!

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

Ubuntu 22.04 setup chyrp lite environment and more

You must have known that I just migrated this blog site to a VPS hosted on oracle cloud, while this wiki page is too brief to get a workable environment easily.

Here is the note for this migration.

  1. sudo -i
  2. Install packages that chyrp will need
    apt install php8.1 php8.1-xml php8.1-fpm php8.1-mysql php8.1-mbstring mysql-server nginx certbot python3-certbot-nginx
  1. Set a password for 'root'@'localhost' account on this new mysql server
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_new_password';
    FLUSH PRIVILEGES;
  1. Run mysql_secure_installation to
  • Remove anonymous users
  • Disallow root login remotely
  • Remove test database and access to it
  1. Create a common user for the blog database, and the blog database
    CREATE USER 'blog'@'localhost' IDENTIFIED BY 'superdifficultpassword';
    GRANT ALL PRIVILEGES ON blog.* To 'blog'@'localhost' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
    CREATE DATABASE `blog` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
  1. Put .my.cnf with the following content in home directory
[client]
user=blog
password=yoursuperdifficultpassword
host=localhost
  1. Restore the database backup
    mysql blog < blog_20230408-030501.sql
  1. Setup nginx and https certificate with certbot
  2. Setup renew the certificate by crontab
SHELL=/usr/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
15 0 * * * /usr/bin/certbot --nginx renew > /dev/null
  1. Restore previous installation, overwrite with the latest version, do the upgrade, that's it!

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 still 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.

Tailscale on Ubuntu put too many logs into /var/log/syslog

answer:

  1. Edit the file /etc/systemd/system/multi-user.target.wants/tailscaled.service,
  2. Add the line "LogLevelMax=3" in the [Service] section.
  3. systemctl daemon-reload
  4. systemctl restart tailscaled

Reference

Power shell: Start-Transcript and Stop-Transcript help you log a session.