dpdk备忘录

1
2
3
4
nic: network interface card
kni: kernel nic interface
pmd: poll mode driver
eal: environment abstraction layer

refer to:
http://vinllen.com/tun-tap/

gvim保存配色字体

1
vi /etc/vim/vimrc

加入

1
2
3
4
5
6
7
8
9
10
11
"colorscheme torte
colorscheme koehler
set guifont=Monospace\ 9
set guioptions=aegimLt
set cindent
set number
set hls
let g:SrcExpl_isUpdateTags = 0
if has("autocmd")
  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif

refer to:
https://blog.csdn.net/wu407797466/article/details/7939148?utm_source=blogxgwz0

vim gdb调试可视化

先安装gvim

1
sudo apt install vim-gtk3

再下载最新clewn

1
http://clewn.sourceforge.net

比如clewn-1.15.tar.gz

1
2
3
4
5
6
7
apt install libncurses-dev
apt install libreadline-dev
tar xaf clewn-1.15.tar.gz
cd clewn-1.15
./configure
make
make install

获取要调试程序的pid,比如98747

1
clewn -ga "-p 98747"

在原命令行中打断点再继续,当被调试程序命中断点后,gvim中会同步源码到断点处。

refer to:
http://clewn.sourceforge.net/doc.html

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

UE4 Shader源码编译过程

在主程序里拼成一个文件WorkerInputOnly.in后启动ShaderCompileWorker.exe进程编译shader源码。以下是调试时记录下来的命令行

D:/ue/Engine/Binaries/Win64/ShaderCompileWorker.exe "C:/Users/euhat/AppData/Local/Temp/UnrealShaderWorkingDir/A1AF8D424B2A34C30CE4378EDE6A0EFB/2/" 14492 2 WorkerInputOnly.in WorkerOutputOnly.out -communicatethroughfile  -TimeToLive=20.000000 -Multiprocess

About TLS operation

Here, TLS is the initialism of thread local storage.

pthread

1
2
3
4
5
6
#include <pthread.h>
int pthread_key_create (pthread_key_t *key, void (*destructor)(void *));
int pthread_key_delete (pthread_key_t key);
int pthread_setspecific (pthread_key_t key, const void *value);
void *pthread_getspecific (pthread_key_t key);
int pthread_once(pthread_once_t *once_control, void (*init)(void));

gcc

1
static __thread int buf[MAX_ERROR_LEN];

win32

1
2
3
4
5
6
7
8
9
10
11
12
DWORD TlsAlloc();
BOOL TlsFree(DWORD dwTlsIndex);
LPVOID TlsGetValue(DWORD dwTlsIndex);
BOOL TlsSetValue(DWORD  dwTlsIndex, LPVOID lpTlsValue);
// or
// in header,
__declspec(thread) extern size_t strdupa_len;
// and in c file, 
// as to one variable, __declspec(thread) should be write twice,
// one in prefix of prototype,
// one in prefix of definition
__declspec(thread) size_t strdupa_len;

refer to:
https://blog.csdn.net/vevenlcf/article/details/77882985
https://blog.csdn.net/linyt/article/details/51931737

日语词尾变化


新旧词类名

1
2
3
4
5
6
7
8
9
学校語法		教育语法
形容词			第一类形容词
形容动词		第二类形容词
五段动词		第一类动词
	话す(はなす)、待つ(まつ)、死ぬ(しぬ)、読む(よむ)、笑う(わらう)、泳ぐ(およぐ)
一段动词		第二类动词
	上一段动词	词尾是i+る	満ちる、みる
	下一段动词	词尾是e+る	逃げる
カ、サ变动词		第三类动词	する、くる

特殊五段动词

1
2
3
4
5
6
7
8
9
嘲(あざけ)る		焦(あせ)る		要(い)る
煎(い)る		返(かえ)る		帰(かえ)る
限(かぎ)る		切(き)る		覆(くつがえ)る
蹴(け)る		遮(さえぎ)る		茂(しげ)る
湿(しめ)る		知(し)る		滑(すべ)る
散(ち)る		照(て)る		握(にぎ)る
练(ね)る		骂(ののし)る		入(はい)る
走(はし)る		减(へ)る		参(まい)る
混(ま)じる		涨(みなぎ)る

特殊一段动词

1
2
3
4
見る		着る		干(ひ)る	居(い)る
似(に)る	煮(に)る	率(い)る	嚏(ひ)る
簸(ひ)る	射(い)る	铸(い)る	寝る
出る		得る

连用形(ます形)

1
2
3
4
5
6
7
8
五段	う段		い段
	行く		行き
一段	去掉る
	寝る		寝
カ变
	来る		来(き)
サ变
	する		し

未然形(ない形)

1
2
3
4
5
6
7
8
9
10
11
12
13
五段	う段		あ段+ない
	行く		行かない
	以う结尾
	う		わ+ない
	言う		言わない
一段	去掉る		ない
	寝る		寝ない
カ变
	来る		来ない(こない)
サ变
	する		しない
	勉強する	勉強しない    
特殊	ある		ない

意志形((よ)う形)

1
2
3
4
5
6
7
8
9
五段	う段		お段+う
	行く		行こう
一段	去掉る+よう
	寝る		寝よう
カ变
	来る		来よう(こよう)
サ变
	する		しよう
	勉強する	勉強しよう

假定形(ば形)

1
2
3
4
5
6
7
8
9
10
11
12
13
五段			最后一个音变成相应的え段上的音
	いう		いえば
	飛ぶ		飛べば
二类动词		る变成れば
	食べる		食べれば
三类动词
	来る		来れば
	する		すれば
一类形容词		去掉词尾的い变成ければ
	ない		なければ
	悲しい		悲しければ
二类形容词和名词	词干+なら(ば)
	鳥		鳥ならば

命令形

1
2
3
4
5
6
7
8
9
五段	う段		え段
	行く		行け
一段	る		ろ
	寝る		寝ろ
カ变
	来る		来い(こい)
サ变
	する		せよ或しろ
	勉強する	勉強しろ

て形、た形

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
い形容词		去掉词尾的い+かった
	ない		なかった
な形容词		词干+だった
	綺麗		綺麗だった
名词			だった是だ的过去式
	卵		卵だった
一段动词		词尾る去掉之后接た
	起きる		起きた
サ变动词		する去掉之后接した
	勉強する	勉強した
カ变动词
	来(く)る	来(き)た
五段动词
	うつる		った
	ぶぬむ		んだ
	く		いた
	ぐ		いだ
	す		した
	行く		行った

可能态

1
2
3
4
5
6
7
8
五段	う段		え段+る
	行く		行ける
一段	去掉る+られる
	寝る		寝られる
カ变	来る		来られる(こられる)
サ变	する		できる
	勉強する	勉強できる    
特点	vt.和宾语之间的を→が

被动态

1
2
3
4
5
6
7
8
9
10
11
五段	う段		あ段+れる
	書く		書かれる 
	う		わ+れる
	言う		言われる
一段	去掉る+られる
	寝る		寝られる
カ变
	来る		来られる(こられる)
サ变	する		される
	勉強する	勉強される
特点	自动词和对象之间的が→に

使役态

1
2
3
4
5
6
7
8
9
10
五段	う段		あ段+せる
	書く		書かせる
	う		わ+せる
	言う		言わせる
一段	去掉る+させる
	寝る		寝させる
カ变	来る		来させる(こさせる)
サ变	する		させる
	勉強する	勉強させる    
特点	自动词和对象执行者之间的に→を
1
2
3
4
5
6
7
8
9
10
vi.			vt.
あ段+る:掛かる	え段+る:掛ける
い段+る:落ちる		す:落とす
え段+る:壊れる		す:壊す
く:届く		え段+る:届ける
く:片付く		え段+る:片づける
く:乾く		す:乾かす
焼ける			焼く
割れる			割る
休む			休む

refer to:
https://zhuanlan.zhihu.com/p/379864257
碳酸氢镭、教日语的青禾君
wangwenwen
日语学习之路
https://jingyan.baidu.com/article/8275fc86d7b44407a13cf602.html
https://jingyan.baidu.com/article/c33e3f48ec171aab15cbb5a9.html