ytyng.com

Latest Articles

Page 11
2019-02-04 04:15 (7 years ago)
Differences in Behavior with and without Await in Functions that Create and Return Promises Inside JS Promises

Here's an English translation of the summary for the Japanese blog article: "Whether it gets resolved or not: A JavaScript code example." If you need further assistance or more details, feel free to ask!

2018-12-04 12:21 (7 years ago)
Samba AD DC Malfunction -> Stopping slapd Resolved the Issue

System packages (`libmysqlclient-dev` etc.) and env vars needed when Python's MySQLdb fails with `mysql_config not found`.

Python
2018-10-11 12:31 (7 years ago)
Downloading Files with Requests Using Selenium Webdriver Session Cookies

Pass a logged-in session cookie from Selenium WebDriver into `requests` to download files that require a browser-bound session.

2018-09-27 03:26 (7 years ago)
Rebuild Python3.5 to Fix pip install uwsgi Error on Ubuntu18

Override the URL patterns (`urls.py`) in a Django test to inject a test-only view — use `@override_settings(ROOT_URLCONF=...)`.

Django
2018-09-27 02:37 (7 years ago)
Preventing "table already exists" error when canceling migrations in Django tests

Avoid `table already exists` failures in Django tests when running with `--keepdb` after cancelling migrations — how to forcibly reset the test DB migration state.

Django
2018-09-25 10:10 (7 years ago)
Unit Testing Abstract Models in Django

Django: Best way to unit-test an abstract model - Stack Overflowhttps://stackoverflow.com/questions/4281670/django-best-way-to-unit-test-an-abstract-model

2018-09-21 03:37 (8 years ago)
Replacing Version Numbers with Python re (Regex Replacement Only Within Parentheses)

Use a lambda callback with Python's `re.sub` to replace only a captured group (e.g. a version number) inside a larger pattern.

2018-09-19 06:33 (8 years ago)
Apache2 URL without .html returns the content of the html file

MultiViews is enabled

2018-09-04 01:53 (8 years ago)
When Starting AD Domain Controller (samba-ad-dc) on Ubuntu 18 with Samba 4.7, It Fails Due to DNS Errors

When you start samba-ad-dc using the command `$ sudo systemctl start samba-ad-dc`, and check either /var/log/samba/log.smbd or /var/log/samba/%m, it appears that port 53 is unavailable.

2018-09-03 11:11 (8 years ago)
When Apache on Ubuntu 18.04 is Forcefully Terminated

Apache suddenly crashes, and upon checking the logs, I found the following messages: "AH00050: Child 7815 returned a Fatal error... Apache is exiting!" and "AH02818: MPM run failed, exiting."

2018-09-03 08:36 (8 years ago)
What to Do If Your Update to Ubuntu 18.04 Gets Stuck

When `do-release-upgrade` to Ubuntu 18.04 hangs on libnih1 or upstart packages, here is how to unstick and complete the release upgrade.

2018-08-16 06:07 (8 years ago)
Notes on Installing chromedriver

Strip 4-byte characters (emoji, some kanji) from a Python 3 `requests` response — useful when storing into MySQL utf8 (3-byte) columns.

2018-08-14 06:45 (8 years ago)
When python3.6 -m venv Errors Occur on Ubuntu

If `python3.6 -m venv venv` fails on Ubuntu, the `python3.6-venv` package is missing — install it via apt to enable virtual environment creation.

Django
2018-07-12 11:24 (8 years ago)
Issues with Redirect URLs Being HTTP Instead of HTTPS in Python Social Auth Django or AllAuth

One-liner to count upgradable packages with `apt list --upgradable`, plus a shell script to surface the number in the MOTD login banner.

2018-07-11 02:42 (8 years ago)
When a Volume Mounted with Goofys is Not Visible to Other Users

If the volume mounted with Goofys is not visible to other users

Python
2018-07-04 06:08 (8 years ago)
Reading BOM-Included TSV Files with Python

When you download a CSV from Amazon, it might sometimes be a TSV with a BOM.

2018-06-29 12:58 (8 years ago)
Setting Up Site-to-Site VPN with OpenVPN

Notes on installing OpenVPN on an Ubuntu server and setting up a site-to-site VPN.

Python
2018-06-21 02:34 (8 years ago)
Add SSL CA Certificate to Ubuntu and Use It with Python Requests

1. If the certificate is in DER format, convert it to PEM

Django
2018-05-15 03:24 (8 years ago)
Creating a ForeignKey Across Databases in Django 2.0

※ This does not mean creating constraints in an RDB. It simply means creating a ForeignKey field that works for now.

2018-05-11 02:30 (8 years ago)
What to Do When You Can't Update PIP for Python 2.7 in the Default Mac Environment

sudo bash -c "curl -kL https://bootstrap.pypa.io/get-pip.py | python"