ytyng.com

Latest Articles

Page 6
2022-09-08 00:44 (3 years ago)
Analyzing Apache Access Logs with GoAccess Instead of Webalizer or Analog

Workaround when PyCharm Python 3.6 Run/Debug Configurations fail to load native extensions like `fibers`.

Python
2022-09-05 00:49 (3 years ago)
If "pipenv install" Results in RuntimeError: location not created nor specified

Fix `pipenv install` failing with `RuntimeError: location not created nor specified` — remove the venv with `pipenv --rm` and let pipenv recreate it.

DjangoDockerPython
2022-09-03 11:03 (3 years ago)
Changed Django's Docker Environment from Alpine + uWSGI to Debian + Daphne → Ended up with uvicorn After All

Why switch a Django Docker image from Alpine + uWSGI to Debian + Daphne (ASGI), with example Dockerfile and Kubernetes manifest changes.

kubernetes
2022-08-19 10:51 (3 years ago)
Items to Check to Prevent Timeout for Slow Responses in Kubernetes Ingress + Uwsgi Configuration

Checklist of timeout settings (Ingress, uWSGI, Django, nginx) to verify so slow responses don't get cut off in a Kubernetes + uWSGI stack.

Python
2022-08-11 15:06 (3 years ago)
Three Workarounds for Failing to Install cryptography When Setting Up a Python Environment in an Alpine Linux Docker Image

Packages required (`apk add ...`) to `pip install cryptography` in an Alpine Linux Docker image, and how to handle common build errors.

Django
2022-08-06 02:09 (3 years ago)
Display a Warning When Attempting to Navigate Away with Unsaved Changes in Django Mezzanine's TinyMCE

If you are using version 4 of tinyMCE, you can add an onChange event in the setup option of tinyMCE.init.

2022-07-24 08:46 (3 years ago)
Creating a Terminal Menu Controlled by Arrow Keys in Python (Utilizing Escape Sequences)

Information on creating a terminal menu that can be navigated using arrow keys without using curses. There were many uncertainties, so I wrote this while referencing other sites. Thank you.

2022-07-20 04:10 (3 years ago)
Extracting Hard Bounce Email Addresses from Postfix Mail Logs with a One-liner

Extracting email addresses that have hard bounced from Postfix logs using a one-liner. Email sending must be stopped for addresses that have hard bounced.

kubernetes
2022-06-19 14:42 (3 years ago)
How We Managed to Retrieve Remote IP Addresses via Kubernetes Ingress

Make `X-Forwarded-For` / `X-Real-IP` reflect the real client IP through Kubernetes nginx-ingress instead of the cluster-internal IP.

kubernetes
2022-06-19 11:51 (3 years ago)
How to Load a Local Docker Image into the MicroK8s Repository on a Remote Server

Deploy a locally built Docker image directly to a remote microk8s cluster via `ctr` (containerd CLI), without going through a registry.

kubernetes
2022-06-19 11:32 (3 years ago)
Updating Kubernetes Ingress from extensions/v1beta1 to networking.k8s.io/v1

Migrate a Kubernetes Ingress from `extensions/v1beta1` to `networking.k8s.io/v1`, with YAML examples. The `backend` field structure must be rewritten.

DockerLinux
2022-06-12 02:55 (3 years ago)
When Running Docker via SSH and Encountering "the input device is not a TTY" Error, Add the -t Option

When trying to use the `docker run` command with SSH arguments and encountering the message "ssh docker run the input device is not a TTY," you can resolve the issue by adding the `-t` option to the SSH command.

Shellscript(Bash/Zsh)
2022-05-28 07:29 (3 years ago)
If the File is Older Than the Specified Date, Do Something in Shell Script

How to use the `date` command to retrieve the timestamp of a file's last modification date. This article was written to determine tasks that have not been processed for a certain period and to issue an alert when opening the terminal on a Mac.

kubernetes
2022-04-22 13:24 (4 years ago)
Writing Host Aliases in Kubernetes Manifests

Bottle's SimpleTemplate basics, plus how to switch to Jinja2 / Mako templates inside Python's bottle framework.

PHP
2022-04-20 00:34 (4 years ago)
Posting XML with PHP using Zend Framework HTTP Client

Build XML with SimpleXML in PHP and POST it via Zend Framework's HTTP Client, with a complete code sample.

Python
2022-04-02 05:32 (4 years ago)
Digital Signage: Python Selenium Script to Launch Chrome in Kiosk Mode

A script to open a website and log in to Google using Python Selenium

Django
2022-03-21 08:57 (4 years ago)
To Create a Request in Django Unit Tests, Retrieving the wsgi_request from the Response is Convenient

When creating unit tests in Django, there are times when you need a Request (WSGIRequest).

2022-02-04 07:45 (4 years ago)
When Installing reportlab in Python on Alpine, It Results in "Not a directory: '/dev/null/.reportlab_mods'"

Include something like `ENV HOME=/var/app` in the Dockerfile. The directory should be an appropriate one with the necessary permissions.

kubernetes
2022-01-26 03:43 (4 years ago)
Setting Timeout Period for Kubernetes Nginx Ingress

Notes on using `pipenv install --system --skip-lock` to install dev versions without strict locking, and how to run without a Pipfile.lock.

Pythonmac
2022-01-03 11:15 (4 years ago)
When pipenv lock Fails on M1 Mac

Fix `pipenv lock` failures on M1 (Apple Silicon) Macs — wheels for `grpcio` / `cryptography` may not exist on arm64, so use Rosetta or pin compatible versions.