Golang
参考文献
https://github.com/gopl-zh/gopl-zh.github.com
命名
Go语言中的函数名、变量名、常量名、类型名、语句标号和包名等所有的命名,都遵循一个简单的命名规则:一个名字必须以一个字母(Unicode字母)或下划线开头,后面可以跟任意数量的字母、数字或下划线.大写字母和小写字母是不同的:heapSort和Heapsort是两个不同的名字.
Go语言中类似if和switch的关键字有25个;关键字不能用于自定义名字,只能在特定语法结构中使用.
12345break default func interface selectcase defer go map structchan else goto package switchconst fallthrough if range typecontinue for import retu ...
SpringBoot-杂项
参考文献
SpringBoot Jar目录结构
BOOT-INF/classes目录存放应用编译后的class文件
BOOT-INF/lib目录存放应用依赖的JAR包
META-INF/目录存放应用相关的元信息,如MANIFEST.MF文件
org/目录存放SpringBoot相关的class文件
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113.├── BOOT-INF│ ├── classes│ │ ├── application.yaml│ │ └── cn│ │ └── holelin│ │ ├── NiiH ...
Redis-Docker-Cluster模式部署
参考文献
5分钟实现用docker搭建Redis集群模式和哨兵模式
redis.conf配置文件
123456789101112131415161718192021222324252627# 连接端口port 6371# 允许其他机器访问redis服务bind 0.0.0.0# 数据目录dir /data# 日志文件, 默认输出到控制台logfile /logs/nodes-6371.logappendonly yesprotected-mode no# 密码requirepass holelin..# 开启cluster集群模式cluster-enabled yes# 集群配置信息文件名, 记录了每个节点的地址、角色(master/slave)、slot等信息, 由redis自己生成, 位于数据目录下cluster-config-file nodes-6371.conf# 集群节点连接超时时间,每个节点都会检查其它节点是否挂了cluster-node-timeout 5000# 从节点需要配置主节点的密码, 不然主从同步时从节点无法从主节点同步到数据masterauth hole ...
Redis-Docker-Sentinel模式部署
参考文献
配置文件
master配置文件
1234567port 6379bind 0.0.0.0daemonize nopidfile "/var/run/redis_6379.pid"logfile "/usr/local/etc/redis/redis.log"dbfilename "dump_6379.rdb"dir "/usr/local/redis/data"
replication配置文件
1234567891011121314151617port 6380daemonize nopidfile "/var/run/redis.pid"logfile "/usr/local/etc/redis/redis.log"dbfilename "dump.rdb"dir "/usr/local/redis/data"bind 0.0.0.0replicaof 192.168.11.216 6379port 6381daem ...
Redis-Config
参考文献
Redis Config
以下内容拷贝至redis-7.2.4版本的redis.conf
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851 ...
Redis-Sentinel Config
参考文献
Sentinel Config
以下内容拷贝至redis-7.2.4版本的sentinel.conf
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831 ...
Kali-John The Ripper
John The Ripper
John The Ripper是一个快速的密码破解工具,用于在已知密文的情况下尝试破解出明文,支持目前大多数的加密算法,如DES、MD4、MD5等。它支持多种不同类型的系统架构,包括Unix、Linux、Windows、DOS模式、BeOS和OpenVMS,主要目的是破解不够牢固的Unix/Linux系统密码。除了在各种Unix系统上最常见的几种密码哈希类型之外,它还支持Windows LM散列,以及社区增强版本中的许多其他哈希和密码。它是一款开源软件。Kali中自带John The Ripper
使用John The Ripper暴力破解PDF
安装编译John The Ripper
123456789git clone https://github.com/magnumripper/JohnTheRipper.gitcd ./JohnTheRipper/srcsudo apt-get updatesudo apt-get install libssl-devcd ./JohnTheRipper/src./configure && ...
Kali-Tools
Tools
1arpspoof -i <network adapter> -r -t <victim IP address> <gateway IP address>
Linux工具-openssl
参考文献
openssl
加密
对称加密-AES
AES是当前针对大量数据加密时最常用的分组加密算法。AES-256表示分组的密钥空间长度为256比特,具体由于分组算法的不同,AES-256还可以细分为很多种。
1234#加密openssl enc -aes-256-cbc -in msg.txt -out enc.txt -pass pass:123456 -iter 100 -pbkdf2#解密openssl enc -d -aes-256-cbc -in enc.txt -out plain.txt -pass pass:123456 -iter 100 -pbkdf2
对称加密-DES
3DES是DES的升级版,DES的加密强度比较弱。
12#加密openssl enc -des3 -in out.txt -out p.txt -pass pass:123456 -iter 100 -pbkdf2
对称加密-blowfish
12#加密openssl enc -blowfish -in out.txt -out p.txt -pass pass:123456 -iter ...
SpringBoot-自动生成spring-configuration-metadata.json文件
参考文献
spring-configuration-metadata.json文件是做啥的?
spring-configuration-metadata.json作用
在编写好自定义配置项后,可以在application.yaml自动提示
实现步骤
添加依赖
12345<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional></dependency>
添加注解(可选,不加idea会红色波浪线提示,对于实际使用没影响)
12345678@EnableConfigurationProperties@ConfigurationPropertiesScan@SpringBootApplication(exclude = MongoAuto ...