Skip to content

Instantly share code, notes, and snippets.

View lonelyleaf's full-sized avatar

Lonelyleaf lonelyleaf

View GitHub Profile

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
class 放量下跌Params : RuleParams() {
var 下跌天数: Int = 3
var 跌幅: Double = 0.07
var 放量幅度: Double = 0.15
}
class 放量下跌Rule : IRule<RuleResult, 放量下跌Params>() {
override fun run(request: RuleRunRequest,
params: 放量下跌Params,
@lonelyleaf
lonelyleaf / find-busy-mnt.sh
Last active June 18, 2020 02:26
找到busy的mnt设备,不知道是哪里的祖传脚本……
#!/bin/bash
# A simple script to get information about mount points and pids and their
# mount namespaces.
if [ $# -ne 1 ];then
echo "Usage: $0 <devicemapper-device-id>"
exit 1
fi
@lonelyleaf
lonelyleaf / logback-spring.xml
Created August 23, 2019 04:22
spring结合logback,将日志导入es的配置示例
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<contextName>logback</contextName>
<!--从spring environment中注入的变量-->
<springProperty scope="context" name="app-name" source="spring.application.name"
defaultValue="unknown"/>
<springProperty scope="context" name="spring.profiles" source="spring.profiles"
defaultValue="unknown"/>
@lonelyleaf
lonelyleaf / Switcher
Last active June 26, 2017 09:20
to replace the fucking swith in java,reduce the code lines
import java.util.HashMap;
import java.util.Map;
/**
* replace
* Created by Rock on 2017/6/26.
*/
public class Switcher<T> {
@lonelyleaf
lonelyleaf / CheckableLinearLayout
Created May 5, 2016 08:16 — forked from christopherperry/CheckableLinearLayout
A LinearLayout that implements the Checkable interface, allowing a LinearLayout to be put into a checked state.
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Checkable;
import android.widget.LinearLayout;