西维蜀黍

【Ubuntu】升级Python3至指定版本

Check the current python version

Run below command to test the current version installed of python.

$ python3 --version
python 3.6.8

Install python3.7

Install python by typing:

$ sudo apt update -y
$ sudo apt install python3.7
  ...


【Ubuntu】从控制台使用默认软件打开文件

Modify your ~/.bashrc

alias open=xdg-open
  ...


【Network】MTU(Maximum Transmission Unit)最佳设置

MTU (Maximum Transmission Unit)

In computer networking, the maximum transmission unit (MTU) is the size of the largest protocol data unit (PDU) that can be communicated in a single network layer transaction. The MTU relates to, but is not identical to the maximum frame size that can be transported on the data link layer, e.g. Ethernet frame.

Larger MTU is associated with reduced overhead. Smaller MTU values can reduce network delay. In many cases, MTU is dependent on underlying network capabilities and must be adjusted manually or automatically so as to not exceed these capabilities. MTU parameters may appear in association with a communications interface or standard. Some systems may decide MTU at connect time.

  ...


【Python】pip 使用

Install pip

Install pip for Python 3

Ubuntu

Ubuntu 18.04 ships with Python 3, as the default Python installation. Complete the following steps to install pip (pip3) for Python 3:

Start by updating the package list using the following command:

$ sudo apt update

Use the following command to install pip for Python 3:

$ sudo apt install python3-pip

The command above will also install all the dependencies required for building Python modules.

Once the installation is complete, verify the installation by checking the pip version:

$ pip3 --version

The version number may vary, but it will look something like this:

$ pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
  ...


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

procstat

$ procstat -e <pid>


$ procstat -e 1906
  PID COMM             ENVIRONMENT
 1906 smbd             LANG=en_US.UTF-8 PATH=/sbin:/bin:/usr/sbin:/usr/bin PWD=/ HOME=/ RC_PID=1899
  ...


【TrueNAS】SMB 折腾

SMB Config

$ cat /usr/local/etc/smb4.confb
[global]
        workgroup = WORKGROUP
        server string = Samba Server Version %v
        netbios name = Samba
        log file = /var/log/samba/samba_log.%m
        max log size = 50
        security = user
        passdb backend = tdbsam
        smb ports = 6727
        include = /etc/samba/user/%U.smb.conf
  ...


【FreeBSD】查看端口占用

Find Used Ports

An example of the netstat command with flags:

## Show listening sockets ##
sockstat -l
 
## Show listening sockets for IPv4 only ##
sockstat -4 -l
 
## Show listening sockets for IPv6 only ##
sockstat -6 -l
  ...


【TrueNAS】OpenVPN Setup

Approach 1 - via UI

Config CA, Server Certificate and Client Certificate

  ...


【Hackintosh】黑苹果 - PCIE4 M2 SSD 支持

SSD

官方标速

  • Samsung 990 PRO SSD 1T - 安装 macOS

    • PCIe 4.0 x4
    • 7450读,6900写
    • 1400K IOPS Read, 1550K IOPS Write
  • WD SN850 1TB (m.2 slot 1) - 安装 macOS

    • PCIe 4.0
    • 读7000,写5300
    • 1000K IOPS Read, 720K IOPS Write
  • WD SN770 2T

    • PCIe 4.0
    • 读5150,写4850
    • 800/740K IOPS
  • Samsung 970 EVO PLUS 1T (m.2 slot 2) - 安装 Windows 10 Pro

    • PCIe 3.0
    • 读3500,写3300
    • 600K IOPS Read, 550K IOPS Write
  • 海康威视 C2000 Pro 2T

    • PCIe 3.0
    • 读 3400,写3100
    • 420/420K IOPS
  ...


【macOS】Comfast Aquantia AQC107 驱动配置 - Big Sur 11.6.7

Spec

  ...