how to turn off fans in linux

after running 'sensors-detect' command, kernel modules controlling fan speed will be loaded.

here is an occasion with 'Nuvoton NCT6102D/NCT6104D/NCT6106D Super IO Sensors' detected.

as nct6775 document said:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#/sys/class/hwmon/hwmon4
pwm[1-7]
    - this file stores PWM duty cycle or DC value (fan speed) in range:
	   0 (lowest speed) to 255 (full)
 
pwm[1-7]_enable
    - this file controls mode of fan/temperature control:
	* 0 Fan control disabled (fans set to maximum speed)
	* 1 Manual mode, write to pwm[0-5] any value 0-255
	* 2 "Thermal Cruise" mode
	* 3 "Fan Speed Cruise" mode
	* 4 "Smart Fan III" mode (NCT6775F only)
	* 5 "Smart Fan IV" mode
...

ps1. if set pwm[1-7]_enable to 0, you will not be able to change it to other value, unless reboot linux.
ps2. I still can't find a common way to turn off fans using ipmitool.

IPMI: Intelligent Platform Management Interface
BMC: Baseboard Management Controller
FRU: Field Replaceable Unit

refer to:
[linux-kernel-src-root]/Documentation/hwmon/nct6775.rst
https://bbs.archlinux.org/viewtopic.php?id=225349

AF-1020 ipsec

问题一:第三方对接都配置好了,实时抓包却未见AF-1020发isakmp或esp包。
1,第一阶段里要配线路出口,网络接口要选对接口并指定同样的线路出口。
2,VPN接口设置里要选择另一个网络接口为内网接口。
3,线路出口对应的网络接口与内网对应的网络接口不能相同网段。
问题二:第一阶段过后不进行第二阶段。
有可能在第二阶段设置中,出站策略与入站策略的源IP子网相同了。
问题三:同一个连接中无法生成多个ESP通道。
比如,同一个连接对应的第二阶段设置中,出站策略两个,入站策略两个,在AF-1020主动发起quick mode协商时,会一股脑儿向对端发2X2=4个esp sa isakmp包。
但根据ike协议的要求,每个包取hash需要的iv是放在ike sa的上下文中,这样其中3个esp sa isakmp包会被对端认为hash payload不正确而被抛弃。
而AF-1020 DLAN运行状态中却显示第二个通信连接成功了,其实是个BUG。
但是AF-1020在被动quick mode协商中,可以正确生成多个ESP通道。

refer to:
http://blog.itpub.net/81227/viewspace-2670399/

成为上帝玩转Chrome禁止图片显示

比如禁止微信公众号里的文章显示图片,经F12分析,图片来源为包含两种字符串的网址:

mmbiz.qpic.cn/mmbiz
mmbiz.qlogo.cn/mmbiz

把这两个字符串分两条规则加到BlockSitePlugin插件的strFrom里,strTo都置空,再在Chrome设置中的历史记录里,清空图片缓存,这点很重要。

再刷新微信公众号文章,图片就没有了。

成为上帝玩转Chrome之指定阻止访问的网站

send packet through nmap nping

nping in nmap suite can simulate sending packet on Windows platform.

this is an example of sending s7comm "Write Var" packet:

nping --dest-mac 00:50:56:32:5f:82 --source-mac 00:0c:29:29:15:30 --tcp -p 102 --dest-ip 10.2.0.10 -c 1 --data-length 37 --data 0300002502f080320100009378000e00060501120a1001000100018400001a000300010100

ps. on win7 platform, you should select "Install older Npcap 1.31 driver", maybe npcap 1.50 doesn't work in acquiring net card interface thereby.

refer to:
https://nmap.org/download.html

vmware mac big sur has no boot.efi in recovery selection

Make a bootable disk.

  1. create a vmdk with enough capacity, like 40G, add it to the guest vm.
  2. start up the vm, format the vmdk to HFS+(MAC OS扩展 日志式), name as MyVolume.
  3. download macos from app store, when installing dialog appears, leave it.
  4. open a terminal, type command below:
1
sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

Reboot the guest vm from this bootable disk.

1
BIOS -> EFI VMware Virtual SATA Hard Drive (2.0)

In recovery mode, you can switch off virtual memory.

1
2
3
4
5
csrutil disable
#after reboot
cd /System/Volumes/VM/
sudo mkdir swapfile0 swapfile1 swapfile2 swapfile3 swapfile4 swapfile5
sysctl vm.swapusage

refer to:
chrisleat
https://communities.vmware.com/t5/VMware-Fusion-Discussions/Can-t-boot-into-recovery-partition-on-macOS-11-Big-Sur/m-p/2298420#M139994
https://support.apple.com/en-us/HT201372
https://www.dazhuanlan.com/cossacks/topics/1189622

tmux config

Choose tmux because screen cmd has no function like C-b + z.

First, ensure tmux server is down by cmd

1
tmux ls

~/.tmux.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#for copying to sys clipboard
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
 
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
 
#general other stuff
set -g default-terminal "xterm-256color"
set-window-option -g mode-keys vi
#set -g mouse on

install xclip

1
apt install xclip

refer to:
https://unix.stackexchange.com/questions/131011/use-system-clipboard-in-vi-copy-mode-in-tmux
https://jdhao.github.io/2018/09/30/tmux_settings_for_vim_users/

How to capture full content of a web page

When a web page content is very long, using "Capture node screenshot" menu function of F12 tools in Chrome or FireFox will lost the bottom part of its image. Who knows why? maybe it's a memory reservation technology!

Well, follow these steps to save the entire content as an image:

  1. Open Firefox.
  2. Click "Addon" menu item, search "screen".
  3. Install "Full Web Page Screenshots" tool made by susbox whose app name is "FireShot" and icon is a big S.
  4. Use FireShot to capture the whole web page content.