ytyng.com

Latest Articles

Page 4
2023-08-17 09:31 (2 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 (2 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 (2 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 (2 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 (2 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 (2 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)
対応方法 for failing to install mysqlclient on m2 Mac with ld: library not found for -lzlib

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.

PHP
2023-04-01 02:27 (3 years ago)
Code to Validate Check Digits of JAN Codes in PHP

Here is an overview in English of the Japanese blog article: "The blog article introduces a PHP function that checks if a given JAN code is valid. If the JAN code is valid, the function returns true; if it is invalid, it returns false and an error message."

Python
2023-03-29 05:31 (3 years ago)
Trying to Install npm install fibers (node-fibers) Results in ValueError: invalid mode: 'rU' While Trying to Load binding.gyp

Fix `npm install fibers` (node-fibers) failing with `ValueError: invalid mode: 'rU'` — its `setup.py` uses a deprecated flag, so install with Python 3.10 or older.

2023-03-11 05:47 (3 years ago)
Using the ChatGPT API

Step-by-step guide to the OpenAI ChatGPT API: account, credit card, billing limit, and API key issuance, with screenshots.

2023-03-11 01:01 (3 years ago)
Mounting Files with ConfigMap in Kubernetes

Confirm the 'Editing in progress' state when modifying a Mezzanine BlogPost — how to check locks and edit state in the Admin.

Python
2023-03-06 07:01 (3 years ago)
Remove 4-byte Characters from Strings in Python

Configure a macOS Service (Quick Action) that copies the absolute path of the file or folder open in Finder to the clipboard.

2023-02-11 12:21 (3 years ago)
Displaying Serial Console Output (Viewing Standard Output When Installing CircuitPython on Raspberry Pi Pico)

Here's an overview of a blog post detailing how to view the standard output of a serial console connected to a Mac. This method is useful when you need to monitor the output from CircuitPython, among other uses.

Docker
2023-01-30 06:54 (3 years ago)
Order of Arguments in docker-compose run (Incorrect Order Prevents Launch and Makes Errors Hard to Identify)

Here's an example to illustrate how docker-compose commands can fail and produce confusing error messages if the arguments are not provided in the correct order.

Shellscript(Bash/Zsh)
2023-01-25 00:13 (3 years ago)
When Setting the Path for mysql-client Installed via Homebrew on macOS, It Automatically Follows Version Changes

Glossary of real-time pub/sub protocols (MQTT/STOMP/Redis Pub-Sub) and a comparison of Python clients to connect to each.