ubuntu下载当前版本内核源码

1
vi /etc/apt/sources.list

uncomment lines beginning with 'deb-src' and save, then

1
2
apt-get update
apt-get source linux-image-unsigned-$(uname -r)

refer to:
https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel
https://stackoverflow.com/questions/45766719/error-during-ubuntu-kernel-source-download

IPSec备忘录

名词缩写

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
psk: pre-shared key
pki: public key infrastructure
pkcs: the public-key cryptography standards
ah: authentication header
esp: encapsulating security payload
esn: extended sequence number, rfc 4304
spi: security parameter index
ike: internet key exchange
isakmp: internet security association and key management protocol
sa: security association
spd: security policy database
sad: sa database
pad: peer authorization database
dh: diffie-hellman, oakley
gre: general routing encapsulation
nas: network access server
pap: password authentication protocol
chap: challenge-handshake authentication protocol
eap: extensible authentication protocol
leap: lightweight eap
peap: protected eap
tls:transport layer security
ssl: secure socket layer
fast: flexible authentication via secure tunneling
pac: protected authentication credential
pptp: point to point tunneling protocol
l2f: layer 2 forwarding
l2tp: layer 2 tunneling protocol
sstp: secure socket tunneling protocol
vrc: vpn remote client
des: data encryption standard
aes: advanced encryption standard
 ecb: electronic codebook book
 cbc: cipher block chaining
 ctr: counter
 cfb: cipher feedback
 ofb: output feedback
hmac: hash-based message authentication code
sha1: secure hash algorithm 1
prf: pseudo-random function
aead: authenticated encryption with associated data
icv: integrity check value
ocsp: online certificate status protocol
dpd: dead peer detection

rfc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
rfc1994: PPP Challenge Handshake Authentication Protocol (CHAP)
rfc2865: Remote Authentication Dial In User Service (RADIUS)
rfc3579: RADIUS Support For Extensible Authentication Protocol (EAP)
rfc3748: Extensible Authentication Protocol (EAP)
rfc4186: EAP Method for GSM Subscriber Identity Modules (EAP-SIM)
rfc4187: EAP Method for 3rd Generation Authentication and Key Agreement (EAP-AKA)
rfc4301: Security Architecture for the Internet Protocol
rfc4306: Internet Key Exchange (IKEv2) Protocol
rfc4307: Cryptographic Algorithms for Use in IKEv2
rfc4478: Repeated Authentication in Internet Key Exchange (IKEv2) Protocol
rfc4543: The Use of Galois Message Authentication Code (GMAC) in IPsec ESP and AH
rfc4555: IKEv2 Mobility and Multihoming Protocol (MOBIKE)
rfc4718: IKEv2 Clarifications and Implementation Guidelines
rfc4739: Multiple Authentication Exchanges in the Internet Key Exchange (IKEv2) Protocol
rfc4806: Online Certificate Status Protocol (OCSP) Extensions to IKEv2
rfc5996: Internet Key Exchange Protocol Version 2 (IKEv2)
rfc5998: An Extension for EAP-Only Authentication in IKEv2
rfc6479: IPsec Anti-Replay Algorithm without Bit Shifting

ipsec-tools

1
2
setkey: sad, spd
racoon: ike sa, ipsec sa

网络分层

1
2
3
4
5
物理层,也叫第一层
链路层,也叫第二层(MAC)
网络层,也叫第三层(IP)
传输层(TCP)
应用层(HTTP)

TCP术语

1
2
3
4
5
6
7
8
9
10
tos: type of service
ecn: explicit congestion notification
dscp: differentiated services codepoint
rtt: round-trip time
ttl: time to live
tso: tcp segmentation offloading
ufo: udp fragmentation offloading
qdisc: queueing discipline
poe: power over ethernet
toe: tcp offload engine

IPS

1
2
ids: intrusion detection system
ips: intrusion prevention system

refer to:
https://blog.csdn.net/jiangwlee/article/details/7395903
https://baike.baidu.com/item/PKCS/1042350?fr=aladdin
https://blog.csdn.net/qq_27969037/article/details/95929199
https://wikitech.wikimedia.org/wiki/IPsec
https://datatracker.ietf.org/doc/html/rfc2401
https://wiki.strongswan.org/projects/strongswan/wiki/IpsecConf

This system (linux-x86_64) is not supported

编译openssl-1.1.0e时,报这个错,主要修改两处

Configure文件

1
2
3
#use if $^O ne "VMS", 'File::Glob' => qw/glob/;
# 修改为
use if $^O ne "VMS", 'File::Glob' => qw/:glob/;

test/build.info文件

1
2
3
use if $^O ne "VMS", 'File::Glob' => qw/glob/;
# 同样进行修改
use if $^O ne "VMS", 'File::Glob' => qw/:glob/;

refer to: https://www.jianshu.com/p/f011a24f2667

属性“NMakeBuildCommandLine”不存在

1
2
1>------ 已启动生成: 项目: Test01, 配置: XXX Win32 ------
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(44,5): warning MSB8005: 属性“NMakeBuildCommandLine”不存在。  正在跳过...

原因是右键工程->属性->NMake->常规->生成命令行是空的。

请仔细审视编译输出日志,看编译对应的是哪种配置平台,如上例日志中对应的是Win32,则再查看Win32配置平台下的“生成命令行”是否为空。

或者发现编译的不是需要的配置平台,可通过“配置管理器”更正。

refer to: https://social.msdn.microsoft.com/Forums/vstudio/en-US/05c02dd5-4470-445f-8131-b993b482ff32/building-a-project-configuration-makefile?forum=vcgeneral

安装程序无法自动安装 Virtual Machine Communication Interface Sockets (VSock)

http://www.catalog.update.microsoft.com/search.aspx?q=kb4474419
下载kb4474419 win7 x64版珍藏!

另外,win7 usb3总线驱动:
http://www.vmware.com/go/dl_intel_usb3_driver

refer to:
https://tieba.baidu.com/p/6031541992
https://kb.vmware.com/s/article/78708
https://support.microsoft.com/en-us/topic/sha-2-code-signing-support-update-for-windows-server-2008-r2-windows-7-and-windows-server-2008-september-23-2019-84a8aad5-d8d9-2d5c-6d78-34f9aa5f8339

5G备忘录

EPS中的PDN连接(搜不到原贴地址)
https://www.txrjy.com/thread-1134059-1-1.html

LTE基础知识概述
https://max.book118.com/html/2016/0706/47457520.shtm

MR数据应用
https://www.txrjy.com/thread-926805-1-1.html

LTEMR分析经验共享
https://www.docin.com/p-1543277673.html

FDD LTE无线网PCI和TA的设计
https://wenku.baidu.com/view/3a6903712e3f5727a5e96299.html

5G系统——5G QoS
https://blog.csdn.net/u010178611/article/details/81746532

5G边缘计算之会话及业务连续性(SSC)介绍
https://blog.csdn.net/openinfra/article/details/109812315

https://www.toutiao.com/article/7098596919232102949

Terms,

1
2
3
Turbo码
LDPC码
Polar code极化码,Erdal Arıkan

OpenCV备忘录

mat的遍历方法
refer to: https://blog.csdn.net/koibiki/article/details/85954121

如何使用opencv给视频添加水印并保存
refer to: https://blog.csdn.net/weixin_44903147/article/details/102969715

bool solvePnP(InputArray objectPoints, InputArray imagePoints, InputArray cameraMatrix, InputArray distCoeffs, OutputArray rvec, OutputArray tvec, bool useExtrinsicGuess=false, int flags=ITERATIVE )

objectPoints为特征点的世界坐标,特征点通常为4个,坐标值需为float型,不能为double型,可以输入mat类型,也可以直接输入vector
imagePoints为特征点在图像中的坐标,需要与前面的输入一一对应。同样可以输入mat类型,也可以直接输入vector
cameraMatrix为相机内参数矩阵,大小为3×3。事先通过OpenCV自带例程求出相机标定参数。
distCoeffs输入为相机的畸变参数,为1×5的矩阵。事先通过OpenCV自带例程求出相机标定参数。
rvec输出解得的旋转向量。
tvec输出平移向量。
useExtrinsicGuess为true后似乎会对输出进行优化。
flags:
CV_ITERATIVE,默认值,它通过迭代求出重投影误差最小的解作为问题的最优解。
CV_P3P则是使用非常经典的Gao的P3P问题求解算法。
CV_EPNP使用文章《EPnP: Efficient Perspective-n-Point Camera Pose Estimation》中的方法求解。

//最小二乘法,解A*X=B中的X
bool cv::solve(InputArray A, InputArray B, OutputArray X, int flags = DECOMP_LU)

refer to:
https://www.cnblogs.com/singlex/p/pose_estimation_1.html
https://www.csdn.net/tags/NtTakgysNTA0NDQtYmxvZwO0O0OO0O0O.html

vmware linux共享文件夹未启动

1
2
3
sudo dnf install open-vm-tools-desktop
umount /mnt/hgfs
sudo /usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other -o uid=1000 -o gid=1000 -o umask=022

如果还不行,比如更新内核后,就要重新安装open-vm-tools。

refer to:
https://blog.csdn.net/xcyja/article/details/117328301

Windows平台下新的文件才拷贝

Linux下的cp -u能实现只在源文件比目标文件新时才拷贝,但此命令在MinGW下不好使,我通过在网上查方法,写了以下同样功能的脚本:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
clearBinary()
{
	local destDir=$1
	local fileName=$2
	local ext=$3
 
	rm "${destDir}/${fileName}.${ext}" 1>/dev/null 2>&1
 
	for ((j = 1; j <= 20; j++)); do
		if [ -f "${destDir}/${fileName}_$j.${ext}" ] ; then
			rm "${destDir}/${fileName}_$j.${ext}"
		fi
	done
 
	for ((j = 1; j <= 20; j++)); do
		if [ -f "${destDir}/${fileName}.${ext}" ] ; then
			mv "${destDir}/${fileName}.${ext}" "${destDir}/${fileName}_$j.${ext}"
		fi
	done
}
 
copyFile()
{
	local srcDir=$1
	local destDir=$2
	local fileName=$3
	local ext=$4
 
	local srcPath=${srcDir}/${fileName}.${ext}
	local destPath=${destDir}/${fileName}.${ext}
 
	if [ ! -f "${srcPath}" ] ; then
		return
	fi
 
	local timeFrom=`stat -c %Y "${srcPath}"`
	local timeTo=`stat -c %Y "${destPath}"`
	if [ "$timeFrom" = "$timeTo" -a "x$forceReplace" != "xforce" ]; then
		return
	fi
 
	clearBinary "${destDir}" ${fileName} ${ext}
 
	cp "${srcPath}" "${destPath}"
 
	local timeFromStr=`date -d "@$timeFrom" "+%Y-%m-%d %H:%M:%S"`
	touch -m -d "$timeFromStr" "${destPath}"
 
	echo "[${srcPath}]->[${destPath}] copied."
}
 
copyFile /e/source /c/dest hello docx

ntoskrnl.ExiAcquireFastMutex HAL.dll

在32位Win7操作系统里,运行引用我们编的动态库的应用程序,报如下错误:

无法定位程序输入点 ntoskrnl.ExiAcquireFastMutex 于动态链接库 HAL.dll 上。

用Dependency Walker查看我们编的动态库,发现引用了ntoskrnl.exe,猜测在旧有的32位win32环境中是不会从dll中去引用别的exe的。只有在64位win32环境中才会存在从dll中去引用ntoskrnl.exe。

32位动态库编译的解决办法:
链接器->输入->附加依赖项去除ucrt.lib和wdm.lib。
链接器->输入->忽略所有默认库设为否。
链接器->高级->入口点清空。