ytyng.com

Latest Articles

Page 4
DjangoPython
2024-03-24 04:53 (2 years ago)
Fix: pipenv install fails with AttributeError: module 'pkgutil' has no attribute 'ImpImporter' (Python 3.12)

pipenv install throws "AttributeError: module 'pkgutil' has no attribute 'ImpImporter'" on Python 3.12. Run `python3 -m ensurepip --upgrade` in both the global and virtualenv, or rebuild the pipenv environment.

kubernetes
2024-02-23 03:38 (2 years ago)
Return Custom Response Headers with Kubernetes Ingress

How to Return Custom Response Headers with Nginx Ingress in Kubernetes This method is useful when you have multiple Ingresses and want to confirm which one is responding.

2024-01-01 04:50 (2 years ago)
Rewrite Paths with Kubernetes Ingress

The element matched by the regular expression in `rules.http.paths.path` within an Ingress configuration is placed into `metadata.annotations.nginx.ingress.kubernetes.io/rewrite-target`.

2023-12-31 06:02 (2 years ago)
Settings to Revert Single Click to Open Files in Folder Tree (Project View) to Double Click in PyCharm (and Other JetBrains Editors)

To revert the behavior of opening files with a single click in the folder tree (Project View) to double-click in PyCharm (and other JetBrains editors), navigate to Preferences → Editor → General → Editor Tabs → Opening policy → Enable preview tabs.

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 (3 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 (3 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 (3 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.