Skip to content
Keyboard And Me

Journal 2022-07-04

Biking has cured my back pain. I should do it more!

Bought Mi 12s today. Went for the max config. Hope it won’t disappoint me.

Journal 2022-07-02

Weekend. Ate some good lunch w/ family. Long afternoon naps. 20km biking with wyh in the evening. The summer evening breeze is quite enjoyable.

Things to buy:

  • A folding bike. So hard to choose.
  • A phone. Probably Mi 11 in 7/4.

Journal 2022-07-01

So the first half of the year consists of the lockdown, the work-from-home, and the generally slacking of because of my mental status. This should not continue. From the first day of the second half of the year, I will try to do more, like writing useless journals about what I do. This shall be the first, and this is what I did today:

  • Introduced my son to the Chinese version of Hikaru No Go. In fact I’m trying to teach him how to play Go. He’s far less interested in it than for example meteoric events, but this TV drama is good fun.
  • Watched one episode of The Boys. I don’t quite like it.
  • Failed in upgrading Webpack 4 to Webpack 5 for the work project, again. Why does it have to be so complex.
  • Ate some good 馄饨 today, some exotic ingredients. Son says he liked the corn flavored ones.
  • I should plan for what’s going to do next.

Remember to update playwright scripts

We’ve had a repo that uses playwright for testing. The test runs daily with Jenkins and Docker. It’s been quite stable and haven’t been updated for a good year. Yesterday I tried to update playwright to the most recent version, but after updating, CI stopped working:

    ╔════════════════════════════════════════════════════════════╗
    ║ Host system is missing a few dependencies to run browsers. ║
    ║ Please install them with the following command:            ║
    ║                                                            ║
    ║     sudo npx playwright install-deps                       ║
    ║                                                            ║
    ║ <3 Playwright Team                                         ║
    ╚════════════════════════════════════════════════════════════╝

I did feel the love from Playwright team. However, running the command in the Dockerfile solved nothing. It reported that every dependency was ready and up-to-date, and the test still kept failing as before.

After some fiddling, it turned out that all I need to do is update the Docker base image. I was using mcr.microsoft.com/playwright:bionic but the newest is mcr.microsoft.com/playwright:focal. After the change everything worked perfectly again.

SO there you go. We may have several places to put playwright in. The project’s package.json, the global playwright install (perhaps via npx), and the docker environment in which a specific version of playwright and the browsers are installed. A safe practice may be like this:

  • Pin a specific version of playwright in Dockerfile as well as in package.json. In Dockerfile it may be something like FROM mcr.microsoft.com/playwright:v1.19.0-focal. While updating playwright version, remember to update both places.
  • Avoid using a global install of playwright. Load playwright from the project with npm run playwright or another packaging tool such as yarn.

The error message recommends npx. It may work most of the times, but when versions don’t match and things go awry, it might be difficult to find the cause, and the friendly error message might not help.

Cinco de Mayo

Abajo es un hilo de twitter y yo lo exporto aqui.

Cosas sobre el festival del bote del dragón que les quisiera contar:

El nombre fue traducido del cantonés, de 龙舟节 o 龙船节. El primer contacto con el occidente sucedió en Cantón. Con razón el nombre resulta así en lenguas europeas.

El nombre más formal es 端午节, que significa “el quinto día del quinto mes”, 端(duān) es “empiezo”, o sea, la primera década del mes, 午(wǔ) es “mayo” en término cronométrico chino, y también es homónimo de “cinco”. Pues, literalmente, “Cinco de Mayo”. Viva México!

Es que el festival sigue el calendario chino que está basado en el ciclo lunar. El calendario de que el único propósito es marcar los festivales tradicionales, oh, y marcar los cumpleaños de los mileniales.

La leyenda dice que el festival está relacionada con 屈原(Qū Yuán), poeta y ministro del país 楚(Chǔ). Era víctima de una conspiración y fue expulsado del corte real. Luego suicidó después de ver la caída de la monarca. Y la gente lo amaba tanto y así nació el festival.

Laudable es el hombre que muere con alacridad por su propio rey. 忠(zhōng, lealtad) es la cualidad más valorada en la China imperial. Lo entiende hasta el Hollywood.

A mí me queda un poco aburrido.

Otra leyenda del festival es sobre el general 伍子胥(Wǔ Zǐxū), también se llama Yuán(员, homófono de 原, pero qué coincidencia), también del país 楚(de otra época), pero tiene una mejor historia, o así lo creo.

El rey de 楚 mató a su padre y hermano. Él escapó al país 吴(Wú) y se convirtió en general mayor, volvió a 楚 con un ejército y destrozó el reinado. El rey ya murió, pero 伍 lo desterró y le dio trescientos azoteas.

A quién no le gusta una buen historia de venganza?

La historia no acaba aquí. Luego el sucesor rey de 吴 venció al país 越(yuè). 伍 le dijo al nuevo rey que el rey de 越(yuè), 勾践(gōu jiàn), es un tipo peligroso, mejor matarlo ahora. El rey no hizo caso. 伍 dijo entonces estamos jodidos. El rey dijo qué grosero, acaso quieres traicionar? Yo te mato. 伍 dijo qué raro de ti, yo le ayudé a tu viejo y ahora tú quieres que yo muera. Cuelga mis ojos a la puerta de la capital pa que la veremos quemar.

El rey dijo ni lo piensas, te hago el 粽子 y con tu carne alimenta los peces del río. Y así lo hizo.

Luego de verdad el 勾践 derrotó a 吴 y el susodicho rey suicidó. Dijo cubren mi cara con la prenda, no quiero que 伍 me reconozca en el inframundo y se ría de mí.

La gente de 吴 amaba la historia y el carácter de 伍 y lo conmemoraba desde entonces. Luego la conmemoración se convirtió en festival de 端午. Fin de la historia.

La lección es que los homónimos matan. Wu: el nombre del país y el apellido del general. Yuan: el nombre del general y el poeta. Qu/Chu (supongo no puedas distinguir. Qué tan racista de mí): el apellido del poeta y el nombre del país. Si contara con ellos ya estarías perdido…