Logo
常用代码块合集
大纲

kotlin

添加全局logger

kotlin
val <T : Any> T.LOGGER: Logger
    get() = LoggerFactory.getLogger(this::class.java)

windows

上传公钥到服务器

cmd
type %USERPROFILE%\.ssh\id_rsa.pub | ssh user@host "cat >> ~/.ssh/authorized_keys"

linux

打印文件树

shell
find . -maxdepth 2 | sed -e 's;[^/]*/;|____;g;s;____|; |;g'

linux lo 网卡缺少ip

ip addr add 127.0.0.1/8 dev lo
ip addr add ::1/128 dev lo

nginx

nginx反代后跳转变成原始ip+端口号

加上如下配置

    server_name_in_redirect off;
    port_in_redirect off;