Skip to content

Instantly share code, notes, and snippets.

yulewei /
Last active Jul 18, 2021
yulewei /
Last active Jul 21, 2021
yulewei /
Last active Mar 19, 2021
Utility bean for getting Spring beans from static context
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
* Utility bean for getting Spring beans from static context
View +mqadmin管理工具.md
yulewei /
Last active Mar 5, 2020
生成 pkcs8 格式的 RSA 公钥和私钥
# 生成私钥,默认 pkcs1 格式
openssl genrsa -out private_key_pkcs1.pem 1024
# 生成公钥,默认 pkcs8 格式
openssl rsa -pubout -in private_key_pkcs1.pem -out public_key_pkcs8.pem
# 私钥转 pkcs8 格式
openssl pkcs8 -topk8 -in private_key_pkcs1.pem -inform pem -out private_key_pkcs8.pem -outform pem -nocrypt
# 只保留 pem 文件中的 base64 内容
cat private_key_pkcs8.pem | sed '1d;$d' | tr -d '\n' > private_key.txt
cat public_key_pkcs8.pem | sed '1d;$d' | tr -d '\n' > public_key.txt
yulewei /
Last active Mar 2, 2021
从零开始入门 K8s

从零开始入门 K8s:

yulewei /
Last active Mar 15, 2020
yulewei / kafka-acls
Last active Jun 26, 2020
kafka 2.2.0 help
View kafka-acls
$ kafka-acls --help
This tool helps to manage acls on kafka.
Option Description
------ -----------
--add Indicates you are trying to add ACLs.
--allow-host <String: allow-host> Host from which principals listed in --
allow-principal will have access. If
you have specified --allow-principal
then the default for this option
will be set to * which allows access