1. Common DNS record types

1.1 A record (default)

$ dig nonabyte.com

; <<>> DiG 9.10.6 <<>> nonabyte.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48959
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;nonabyte.com.          IN  A

;; ANSWER SECTION:
nonabyte.com.       273 IN  A   43.128.0.111

;; Query time: 80 msec
;; SERVER: 192.168.31.1#53(192.168.31.1)
;; WHEN: Sun Mar 21 20:34:11 CST 2021
;; MSG SIZE  rcvd: 57

1.2 MX(mail exchange)

$ dig nonabyte.com mx

; <<>> DiG 9.10.6 <<>> nonabyte.com mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4641
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 6

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;nonabyte.com.          IN  MX

;; ANSWER SECTION:
nonabyte.com.       3600    IN  MX  0 smtp.asia.secureserver.net.
nonabyte.com.       3600    IN  MX  10 mailstore1.asia.secureserver.net.

;; AUTHORITY SECTION:
nonabyte.com.       3600    IN  NS  ns08.domaincontrol.com.
nonabyte.com.       3600    IN  NS  ns07.domaincontrol.com.

;; ADDITIONAL SECTION:
mailstore1.asia.secureserver.net. 3265 IN A 182.50.144.67
ns08.domaincontrol.com. 171653  IN  A   173.201.71.4
ns07.domaincontrol.com. 172440  IN  A   97.74.103.4
ns08.domaincontrol.com. 161262  IN  AAAA    2603:5:2270::4
ns07.domaincontrol.com. 161204  IN  AAAA    2603:5:2170::4

;; Query time: 2167 msec
;; SERVER: 192.168.31.1#53(192.168.31.1)
;; WHEN: Sun Mar 21 20:35:24 CST 2021
;; MSG SIZE  rcvd: 266```

> The record of querying MX is

> ;; ANSWER SECTION:
> nonabyte.com.     3600    IN  MX  0 smtp.asia.secureserver.net.
> nonabyte.com.     3600    IN  MX  10 mailstore1.asia.secureserver.net.
Of course, you can query it in a shorter way.



```bash
$ dig +nocmd nonabyte.com mx +noall +answer
nonabyte.com.       3519    IN  MX  0 smtp.asia.secureserver.net.
nonabyte.com.       3519    IN  MX  10 mailstore1.asia.secureserver.net.

1.3 TXT

To verify the ownership of a domain name, DNS is often used to parse TXT records, such as when applying for SSL certificate or Google or Baidu webmaster authentication.

$ dig +nocmd nonabyte.com txt +noall +answer
nonabyte.com.       600 IN  TXT "google-site-verification=-yQ17uMOlK-wdRz0bgS-32Nat2loTzq9uR2Bj9OLdI8"

1.4 CNAME

$ dig cloud.tencent.com CNAME

; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7_5.1 <<>> cloud.tencent.com CNAME
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3408
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;cloud.tencent.com.             IN      CNAME

;; ANSWER SECTION:
cloud.tencent.com.      2574    IN      CNAME   cloud.tencent-cloud.com.

;; Query time: 0 msec
;; SERVER: 183.60.83.19#53(183.60.83.19)
;; WHEN: Fri Jul 26 11:18:27 CST 2019
;; MSG SIZE  rcvd: 80

2. Other queries.

2.1 reverse query.

If you query a domain name through IP, you will generally convert the IP of the mail server into a domain name, thus reducing the possibility of being treated as spam.

$ dig -x 114.114.114.114 +short
public1.114dns.com.

reference


Recently, macOS will automatically crash soon after it is used, and then shut down. Finally, it is found that the mds process caused the system to crash.

OS: macOS Catalina 10.15.7 (19H2)
Model:MacBook Pro (Retina, 15-inch, Mid 2014)
CPU:2.2 GHz Intel Core i7

Shortly after turning on, the fan rotates wildly, the temperature rises, and then it crashes and shuts down.

1. Use Apple Diagnostics to test Mac.

First see if there is a problem at the hardware level.

Use Apple Diagnostics to test Mac.

The Mac processor is Intel. Turn on Mac, and press and hold the D key on the keyboard immediately when Mac starts.

No hardware problems were found in the Mac after detection.

Then, see if there is a problem at the system level.

Find the console in the launchpad, and you can see that system.log, has found that some processes have been KILL on the left side of the console.

Com.apple.xpc.launchd [1] (com.apple.mdworker.shared.01000000-0300-0000-0000-000000000000 [5605]): Service exited due to SIGKILL | sent by mds [151l].

3. View system resource usage.

Check the activity monitor and find that mds and mds_ stores occupy a high utilization rate of CPU. If you check the data, you can see that this is focused (spotlight) creating an index, which makes it easy to quickly search for files, configuration and other information.

Do not know whether the current operating system version of the bug,CPU utilization is too high, causing the system to crash.

From this point of view, it is estimated that the focus takes up a lot of resources when creating the index, causing the system to crash.

In order to solve this problem temporarily, it is necessary to stop the process, make a trade-off, give up the focus function, and ensure that the system works. As for what version has fixed this bug, we'll see later.

4. disable mds

$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Password:
/System/Library/LaunchDaemons/com.apple.metadata.mds.plist: Operation now in progress

if there is an error in (Operation not permitted while System Integrity Protection is engaged), please disable the system integrity protection (SIP) of Mac OS X.

After rebooting the operating system, the probability of the system crashing is greatly reduced, which used to be several times a day, but now it can be encountered occasionally in a few weeks.

reference


Prerequisites

1. installation environment preparation

1.1 environment preparation

$ mkdir airflow
$ cd airflow
$ curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.0.1/docker-compose.yaml'
$ mkdir ./dags ./logs ./plugins
$ chmod 777 ../airflow/ -R

Don't create .env file mentioned in official documents, perhaps its deployment scripts have some problems.

1.2 program init

$ docker-compose up airflow-init

2. start airflow

$ docker-compose up

3. view airflow

Visit localhost:8080 via browser

FAQ

ModuleNotFoundError: No module named 'airflow'

Init airflow failed, it tips ModuleNotFoundError: No module named 'airflow'.

# docker-compose up airflow-init
Removing airflow_airflow-init_1
airflow_postgres_1 is up-to-date
airflow_redis_1 is up-to-date
Recreating cebf6e7abfc9_airflow_airflow-init_1 ... done
Attaching to airflow_airflow-init_1
airflow-init_1       | BACKEND=postgresql+psycopg2
airflow-init_1       | DB_HOST=postgres
airflow-init_1       | DB_PORT=5432
airflow-init_1       |
airflow-init_1       | Traceback (most recent call last):
airflow-init_1       |   File "/home/airflow/.local/bin/airflow", line 5, in <module>
airflow-init_1       |     from airflow.__main__ import main
airflow-init_1       | ModuleNotFoundError: No module named 'airflow'
airflow-init_1       | Traceback (most recent call last):
airflow-init_1       |   File "/home/airflow/.local/bin/airflow", line 5, in <module>
airflow-init_1       |     from airflow.__main__ import main
airflow-init_1       | ModuleNotFoundError: No module named 'airflow'
airflow-init_1       | Traceback (most recent call last):
airflow-init_1       |   File "/home/airflow/.local/bin/airflow", line 5, in <module>
airflow-init_1       |     from airflow.__main__ import main
airflow-init_1       | ModuleNotFoundError: No module named 'airflow'
airflow-init_1       | Traceback (most recent call last):
airflow-init_1       |   File "/home/airflow/.local/bin/airflow", line 5, in <module>
airflow-init_1       |     from airflow.__main__ import main
airflow-init_1       | ModuleNotFoundError: No module named 'airflow'
airflow-init_1       | Traceback (most recent call last):
airflow-init_1       |   File "/home/airflow/.local/bin/airflow", line 5, in <module>
airflow-init_1       |     from airflow.__main__ import main
airflow-init_1       | ModuleNotFoundError: No module named 'airflow'
airflow_airflow-init_1 exited with code 1

When I delete .env file mentioned in official documents, it tips
Permission denied: '/opt/airflow/logs/scheduler.

# rm -f .env
# docker-compose up airflow-init
airflow_redis_1 is up-to-date
airflow_postgres_1 is up-to-date
Recreating airflow_airflow-init_1 ... done
Attaching to airflow_airflow-init_1
airflow-init_1       | BACKEND=postgresql+psycopg2
airflow-init_1       | DB_HOST=postgres
airflow-init_1       | DB_PORT=5432
airflow-init_1       |
airflow-init_1       | Unable to load the config, contains a configuration error.
airflow-init_1       | Traceback (most recent call last):
airflow-init_1       |   File "/usr/local/lib/python3.6/pathlib.py", line 1248, in mkdir
airflow-init_1       |     self._accessor.mkdir(self, mode)
airflow-init_1       |   File "/usr/local/lib/python3.6/pathlib.py", line 387, in wrapped
airflow-init_1       |     return strfunc(str(pathobj), *args)
airflow-init_1       | FileNotFoundError: [Errno 2] No such file or directory: '/opt/airflow/logs/scheduler/2021-03-20'
airflow-init_1       |
airflow-init_1       | During handling of the above exception, another exception occurred:
airflow-init_1       |
airflow-init_1       | Traceback (most recent call last):
airflow-init_1       |   File "/usr/local/lib/python3.6/logging/config.py", line 565, in configure
airflow-init_1       |     handler = self.configure_handler(handlers[name])
airflow-init_1       |   File "/usr/local/lib/python3.6/logging/config.py", line 738, in configure_handler
airflow-init_1       |     result = factory(**kwargs)
airflow-init_1       |   File "/home/airflow/.local/lib/python3.6/site-packages/airflow/utils/log/file_processor_handler.py", line 46, in __init__
airflow-init_1       |     Path(self._get_log_directory()).mkdir(parents=True, exist_ok=True)
airflow-init_1       |   File "/usr/local/lib/python3.6/pathlib.py", line 1252, in mkdir
airflow-init_1       |     self.parent.mkdir(parents=True, exist_ok=True)
airflow-init_1       |   File "/usr/local/lib/python3.6/pathlib.py", line 1248, in mkdir
airflow-init_1       |     self._accessor.mkdir(self, mode)
airflow-init_1       |   File "/usr/local/lib/python3.6/pathlib.py", line 387, in wrapped
airflow-init_1       |     return strfunc(str(pathobj), *args)
airflow-init_1       | PermissionError: [Errno 13] Permission denied: '/opt/airflow/logs/scheduler'

It turns out that it is a permission problem. It is solved by setting the permission to 777.

# chmod 777 airflow/ -R
# docker-compose up airflow-init
......
airflow-init_1       | Admin user airflow created
airflow-init_1       | 2.0.1
airflow_airflow-init_1 exited with code 0

reference