西维蜀黍

【Linux】查看一个运行进程的环境变量

A quick mental dump in case I forget it again next time. First, check your PID:

$ ps faux | grep 'your_process'
508   28818  0.0  0.3  44704  3584 ?  Sl   10:10   0:00  \_ /path/to/your/script.sh

Now, using that PID (in this case, 28818), check the environment variables in /proc/$PID/environ.

$ cat /proc/28818/environ
TERM=linuxPATH=/sbin:/usr/sbin:/bin:/usr/binrunlevel=3RUNLEVEL=3SUPERVISOR_GROUP_NAME=xxxPWD=/path/to/your/homedirLANGSH_SOURCED=1LANG=en_US.UTF-8previous=NPREVLEVEL=N

Now to get that output more readable, you can do two things. Either parse the null character (\0) and replace them by new lines (\n) or use the strings tool that does this for you.

  ...


【Network】反向 DNS 查询(Reverse DNS Lookup)

  ...


【Linux】信号(Signal)

信号(Signal)

Signals are a limited form of inter-process communication (IPC), typically used in Unix, Unix-like, and other POSIX-compliant operating systems. A signal is an asynchronous notification sent to a process or to a specific thread within the same process to notify it of an event. Signals originated in 1970s Bell Labs Unix and were later specified in the POSIX standard.

When a signal is sent, the operating system interrupts the target process’ normal flow of execution to deliver the signal. Execution can be interrupted during any non-atomic instruction. If the process has previously registered a signal handler, that routine is executed. Otherwise, the default signal handler is executed.

  ...


【Linux】命令 - cp

复制文件

# Copy a file to another location:
$ cp path/to/source_file.ext path/to/target_file.ext

# Copy a file into another directory, keeping the filename:
$ cp path/to/source_file.ext path/to/target_parent_directory
  ...


【IoT】Home Assistant 集成 Tuya(涂鸦) 设备

(depreciated) Install the old Tuya Home Assistant Integration

Adding Tuya to your Home Assistant instance can be done via the user interface, by taking the following steps:

After completing, the Tuya integration will be immediately available for use.

During configuration, be careful to select the country code and the platform corresponding to those used by you in the app. Once configuration flow is completed, the devices configured in your app will be automatically discovered.

Additionally, if your username or e-mail address isn’t accepted, please try using your phone number (minus the country code) as your username.

  ...