sysctl.conf 系统参数详解

vim /etc/sysctl.conf

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
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#

#kernel.domainname = example.com

# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3

##############################################################3
# Functions previously found in netbase
#

# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1

# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1

# Uncomment the next line to enable packet forwarding for IPv4
# 爽哥于2019.10.31修改,为了能搭建k8s
net.ipv4.ip_forward=1

# Uncomment the next line to enable packet forwarding for IPv6
# Enabling this option disables Stateless Address Autoconfiguration
# based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1

###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
kernel.sysrq = 1
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
kernel.printk = 5

https://blog.csdn.net/weixin_40901788/article/details/83586965

Wireshark抓包手机

https://www.baidu.com/s?tn=50000021_hao_pg&ie=utf-8&sc=UWd1pgw-pA7EnHc1FMfqnHmzPW6Ln1fsn1n3rauW5y99U1Dznzu9m1Ydn1fzP1c4P1T&ssl_sample=normal&srcqid=5482817894475453453&H123Tmp=nunew7&word=wireshark%E6%80%8E%E4%B9%88%E6%8A%93%E5%8C%85%E6%89%8B%E6%9C%BA

https://www.google.com/search?q=mac+wireshark%E6%80%8E%E4%B9%88%E6%8A%93%E5%8C%85%E6%89%8B%E6%9C%BA&oq=mac+wireshark%E6%80%8E%E4%B9%88%E6%8A%93%E5%8C%85%E6%89%8B%E6%9C%BA&aqs=chrome..69i57.192j0j1&sourceid=chrome&ie=UTF-8

https://www.jianshu.com/p/82bcdb1decf7

MySQL中的WAL(Write-Ahead-Logging)

数据库IO简介

IO有四种类型:连续读,随机读,随机写和连续写,连续读写的IO size通常比较大(128KB-1MB),主要衡量吞吐量,而随机读写的IO size比较小(小于8KB),主要衡量IOPS和响应时间。数据库中的全表扫描是连续读IO,索引访问则是典型的随机读IO,日志文件是连续写IO,而数据文件则是随机写IO。

  数据库系统基于传统磁盘访问特性来设计,最大特点是日志文件采用sequential logging,数据库中的日志文件,要求必须在事务提交时写入到磁盘,对响应时间的要求很高,所以设计为顺序写入的方式,可以有效降低磁盘寻道花费的时间,减少延迟时间。日志文件的顺序写入,虽然是物理位置是连续的,但是并不同于传统的连续写类型,日志文件的IO size很小(通常小于4K),每个IO之间是独立的(磁头必须抬起来重新寻道,并等待磁盘转动到相应的位置),而且间隔很短,数据库通过log buffer(缓存)和group commit的方式(批量提交)来达到提高IO size的大小,并减少IO的次数,从而得到更小的响应延迟,所以日志文件的顺序写入可以被认为是“连续位置的随机写入”,更关注IOPS,而不是吞吐量。

SpringBoot中使用Filter

某个SpringBoot项目,在application.yml中指定了context-path:

1
2
3
4
server:
port: 8998
servlet:
context-path: /shuang-api/

这样一来,该项目所有的接口,根访问路径就都成了 ip:prot/shuang-api

service xxx start的使用

https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&srcqid=7372498957567474605&tn=50000021_hao_pg&wd=service%20%20start%20%E5%A6%82%E4%BD%95%E5%B7%A5%E4%BD%9C%E7%9A%84&oq=service%2520xxx%2520start&rsv_pq=a3a465cb00051c79&rsv_t=0200YI4Jcg6vohyCpl6Fa%2Fp%2Frdpz1AP9ztBiquFlpvk%2B8Z1XpUaBu%2Fqs5QEi2dNpUcBNPYsq&rqlang=cn&rsv_enter=1&rsv_dl=tb&rsv_btype=t&inputT=8294&rsv_sug3=36&rsv_sug1=15&rsv_sug7=100&rsv_sug2=0&rsv_sug4=8979

https://blog.csdn.net/qq_38350635/article/details/114450408

https://blog.csdn.net/u011095110/article/details/81020839/

math/rand包源码剖析


关于伪随机数生成算法

伪随机数生成器(pseudo random number generator,PRNG),又被称为确定性随机比特生成器(deterministic random bit generator,DRBG),是一个生成数字序列的算法,其特性近似于随机数序列的特性。PRNG生成的序列并不是真随机,因此它完全由一个初始值决定,这个初始值被称为PRNG的随机种子(seed,但这个种子可能包含真随机数)。尽管接近于真随机的序列可以通过硬件随机数生成器生成,但伪随机数生成器因为其生成速度和可再现的优势,在实践中也很重要