ytyng.com

Latest Articles

Page 4
PythonMicrocontrollers
2023-12-24 09:20 (2 years ago)
Using CircuitPython on the HW-394 ESP-WROOM-32 (ESP32) Development Board

A memo about purchasing a development board featuring the ESP-WROOM-32 module, which appears when searching for "ESP32" on AliExpress, and has "HW-394" written on the board.

mac
2023-12-12 00:22 (2 years ago)
How to Open a Specific URL with Chrome in a Specified Window Size from the Command Line on Mac

Here is how to open Chrome with a specified window size from the command line on a Mac.

PythonRaspberry-Pi
2023-11-21 02:51 (2 years ago)
When Copying Files to Raspberry PI Pico or RP2040 on Mac OS Sonoma Results in Input/Output Error

Here is the solution for resolving Input/output errors or Error code -36 that may occur when trying to copy files to an RP2040 microcontroller board or Raspberry Pi Pico while developing on Mac OS Sonoma.

DjangoPython
2023-11-09 03:39 (2 years ago)
Fix: symbol not found in flat namespace '_mysql_affected_rows' when importing MySQLdb on Apple Silicon

Fix `symbol not found in flat namespace '_mysql_affected_rows'` when importing MySQLdb in Python — rebuild mysqlclient against the right MySQL client library.

Django
2023-10-12 12:41 (2 years ago)
Switching the Logged-in User in Django Using the Django Shell

Here's an overview in English: How to change the user of an already established session using the Django shell. Please do not attempt this in a production environment as it can be dangerous.

2023-10-07 09:46 (2 years ago)
Communicating with Other Pods in Kubernetes

If within the same namespace, name resolution can be performed using the metadata.name of the Service.

kubernetes
2023-09-28 00:31 (2 years ago)
Fix: no matches for kind "CronJob" in version "batch/v1beta1" on Kubernetes 1.25 — switch to batch/v1

If you encounter the error "no matches for kind 'CronJob' in version 'batch/v1beta1'" when registering a Kubernetes CronJob, you can resolve it by changing batch/v1beta1 to batch/v1.

2023-08-21 01:08 (3 years ago)
How to Renew SSL Certificates When They Expire in Microk8s

This article covers how to handle error messages related to server certificate expiration when attempting to operate Microk8s (Kubernetes).

2023-08-17 09:31 (3 years ago)
When Using Selenium + Chrome on Mac and Chrome Version is 115 or Higher, and Chromedriver Cannot Be Installed

Extend an LVM Logical Volume to absorb all remaining free space — `lvextend -l +100%FREE` and the resize2fs / xfs_growfs follow-up.

2023-08-08 11:52 (3 years ago)
Check Model Permissions within Templates in Django

Here is an example of using Django's template language to check if a logged-in user has permissions for a model. The template variable `perms` is available by default, and you can use it to make this determination.

2023-07-20 11:48 (3 years ago)
Sleep after the second loop in a shell script

When processing redundant items one by one in sequence, to ensure not to process everything at once, you can use a sleep function after the second loop iteration and onwards.

cssiOS
2023-07-16 11:02 (3 years ago)
Get the Effective Height and Width of the Browser When the Software Keyboard Appears in iOS Safari and Adjust the Layout

When compiling a Python C extension (.pyd / .so) fails due to a Python version mismatch, how to detect and switch to a compatible interpreter.

kubernetes
2023-07-03 02:04 (3 years ago)
I reinstalled the DNS plugin because name resolution stopped working in Kubernetes (Microk8s)

When `docker run -it` over an `ssh` connection errors `the input device is not a TTY`, drop `-t` or invoke ssh with `-t` to allocate a TTY.

2023-06-16 04:09 (3 years ago)
How to Set Docker Image Tags Based on the Build Commit Count

Assigning Version Numbers Using Commit Counts for Simplicity

2023-05-23 09:55 (3 years ago)
Using Host SSH Key in Docker Build

Use the host SSH key in Docker build to access private repos. Combine `DOCKER_BUILDKIT=1` and `--mount=type=ssh` with `StrictHostKeyChecking=no`.

2023-05-18 00:31 (3 years ago)
Setting and Retrieving AUTO_INCREMENT Values in MySQL

When setting or retrieving the auto_increment value for a table in MySQL, starting from MySQL 8, information_schema is cached. As a result, retrieving AUTO_INCREMENT consecutively may yield outdated values. This article discusses countermeasures for such situations.

2023-05-14 03:09 (3 years ago)
Since BitLocker decryption key files are in UTF-16, they cannot be searched with grep -R, so use a script to search.

Build a Chromium kiosk for web signage on an OrangePi Zero 2W — OS install, Wayland setup, and auto-start configuration.

2023-05-11 10:37 (3 years ago)
Fix: pip install mysqlclient fails with ld: library not found for -lzlib on M2 Mac (MYSQLCLIENT_LDFLAGS)

When you encounter the error "library not found for -lzlib" while trying to run `pip install mysqlclient` on an M2 Mac, setting the environment variables `MYSQLCLIENT_LDFLAGS` and `MYSQLCLIENT_CFLAGS` can help resolve the issue.

2023-05-03 02:47 (3 years ago)
Writing TextToSpeech in Browser Using Async Function

Run a web signage kiosk on a Raspberry Pi with Playwright + Chromium — Python script and systemd unit example.

2023-04-28 03:40 (3 years ago)
How to Handle the Suspension of an Account Used for Twitter API Integration

Due to changes in Twitter's developer program specifications, only one app is allowed under the free plan. If you have multiple API accounts, they will be forcibly disabled (with the API accounts entering a SUSPENDED status). Here are the methods to address this situation.