西维蜀黍

【IoT】Home Assistant 集成 Aqara 空调伴侣

Model ID Model number Product name Shape
acpartner.v3 KTBL11LM Aqara Air Conditioning Companion square
lumi.acpartner.mcn02 KTBL03LM Xiaomi Air Conditioning Companion 2 square

Aqara Air Conditioning Companion

米家 App 中设置

  • 约克空调,ID 3203,第3个设置
  ...


【TrueNAS】ZFS 管理

列出当前所有所有的 Pool

$ zpool list
NAME        SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
SWPool     16.4T  2.35T  14.0T        -         -     0%    14%  1.00x    ONLINE  /mnt
SWPoolSSD  1.86T   142G  1.72T        -         -     0%     7%  1.00x    ONLINE  /mnt
boot-pool   103G  1.18G   102G        -         -     0%     1%  1.00x    ONLINE  -
  ...


【OpenWrt】树莓派上使用 AX88179 USB 网卡

安装 AX88179 Driver

AX88189驱动

opkg update && opkg install kmod-usb-net-asix-ax88179 
reboot

After next reboot, you should see your USB Ethernet interface initialized:

1...
2[    7.159985] usbcore: registered new interface driver r8152
3[    7.370114] r8152 2-2:1.0 eth1: v1.10.11
4[   10.665622] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
5[   10.673312] r8152 2-2:1.0 eth1: carrier on
6...
  ...


【OpenWrt】树莓派安装OpenWrt

  ...


【TrueNAS】读写性能测试

可以测试

  • 物理 disk 的读写速度
  • ZFS 的读写速度(内存会作为ARC,因此内存越大,自然速度越快)
    • 在 TrueNAS 主机上进行测试
    • 在 client端 进行测试(会被ARC和网络影响)

Disk

  • 海康威视 C2000Pro 2TB
    • 官方标速:最大顺序读 3400MB/S,最大顺序写 3100MB/S

diskinfo

$ diskinfo -tv nvd0
...
Transfer rates:
	outside:       102400 kbytes in   0.037547 sec =  2727249 kbytes/sec
	middle:        102400 kbytes in   0.036066 sec =  2839239 kbytes/sec
	inside:        102400 kbytes in   0.097002 sec =  1055648 kbytes/sec

$ diskinfo -tv nvd0
...
Transfer rates:
	outside:       102400 kbytes in   0.037414 sec =  2736943 kbytes/sec
	middle:        102400 kbytes in   0.035900 sec =  2852368 kbytes/sec
	inside:        102400 kbytes in   0.212731 sec =   481359 kbytes/sec

SSD

  • 2.73GB/s

dd

SSD

Read

海康威视 SSD

# 1GB, block 1KB
$ dd if=/dev/nvd0 of=speed_test_temp_file bs=1024 count=1000000
1000000+0 records in
1000000+0 records out
1024000000 bytes transferred in 12.824254 secs (79848702 bytes/sec)

# 1GB, block 1MB
$ dd if=/dev/nvd0 of=speed_test_temp_file bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 0.705722 secs (1485820772 bytes/sec)
$ dd if=/dev/nvd0 of=speed_test_temp_file bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 0.657703 secs (1594300718 bytes/sec)
$ dd if=/dev/nvd0 of=speed_test_temp_file bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 0.660621 secs (1587257485 bytes/sec)
$ dd if=/dev/nvd0 of=speed_test_temp_file bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 0.662474 secs (1582817905 bytes/sec)

# 10GB, block 1MB
➜  ~ dd if=/dev/nvd0 of=speed_test_temp_file bs=1M count=10000
10000+0 records in
10000+0 records out
10485760000 bytes transferred in 26.722108 secs (392400185 bytes/sec)
➜  ~ dd if=/dev/nvd0 of=speed_test_temp_file bs=1M count=10000
10000+0 records in
10000+0 records out
10485760000 bytes transferred in 29.718711 secs (352833610 bytes/sec)
➜  ~ dd if=/dev/nvd0 of=speed_test_temp_file bs=1M count=10000
10000+0 records in
10000+0 records out
10485760000 bytes transferred in 31.348440 secs (334,490,644 bytes/sec)
  ...


【Linux】命令 - dd

dd Command

dd is a command-line utility for Unix and Unix-like operating systems, the primary purpose of which is to convert and copy files.

On Unix, device drivers for hardware (such as hard disk drives) and special device files (such as /dev/zero and /dev/random) appear in the file system just like normal files; dd can also read and/or write from/to these files, provided that function is implemented in their respective driver.

As a result, dd can be used for tasks such as backing up the boot sector of a hard drive, and obtaining a fixed amount of random data.

  ...


【FreeBSD】显示磁盘信息

geom - List Disks

# List all disks
$ geom disk list

# List a specific disk
$ diskinfo -v nvd0
nvd0
	512         	# sectorsize
	2048408248320	# mediasize in bytes (1.9T)
	4000797360  	# mediasize in sectors
	0           	# stripesize
	0           	# stripeoffset
	HS-SSD-C2000Pro 2048G	# Disk descr.
	30027331913 	# Disk ident.
	Yes         	# TRIM/UNMAP support
	0           	# Rotation rate in RPM
	
$ diskinfo -v ada1
ada1
	512         	# sectorsize
	6001175126016	# mediasize in bytes (5.5T)
	11721045168 	# mediasize in sectors
	4096        	# stripesize
	0           	# stripeoffset
	11628021    	# Cylinders according to firmware.
	16          	# Heads according to firmware.
	63          	# Sectors according to firmware.
	WDC WD60EFRX-68L0BN1	# Disk descr.
	WD-WX32D404LT1P	# Disk ident.
	id1,enc@n3061686369656d30/type@0/slot@2/elmdesc@Slot_01	# Physical path
	No          	# TRIM/UNMAP support
	5700        	# Rotation rate in RPM
	Not_Zoned   	# Zone Mode
  ...


【FreeBSD】磁盘速度测试

geom - List Disks

# List all disks
$ geom disk list

# List a specific disk
$ geom disk list ada5
$ geom disk list ada2
  ...


【FreeBSD】搭建DHCP服务器

  ...


【Hackintosh】macOS 下制作 OpenCore 引导 U 盘

制作 OpenCore 引导 U 盘

Setting up the installer

Now we’ll be formatting the USB to prep for OpenCore. We’ll want to use macOS Extended (HFS+) with a GUID partition map. This will create two partitions: the main MyVolume and a second called EFI which is used as a boot partition where your firmware will check for boot files.

  • Note: By default, Disk Utility only shows partitions – press Cmd/Win+2 to show all devices (alternatively you can press the View button)

  ...