由于certbot更新,之前的方法失效.

新版本需要编辑let’s encrypt的配置文件,默认的配置文件在/etc/letsencrypt/cli.ini

vim /etc/letsencrypt/cli.ini

然后增加key-type和cert-name两行

key-type = ecdsa
cert-name = t2t2.cc_ecdsa_jason19659

key-type = ecdsa
最后执行正常的命令生成证书就可以了,

sudo certbot --nginx


新版本比旧版本简单多了.

问题: ups询价和下单过慢.

之前的解决方案为,在美国的服务器上部署一套代理项目,只有询价.但是问题也随之而来,每次修改相关代码的时候需要修改2个项目,需要全部进行重新部署,代理项目的代码和现行代码版本差距过大,不易扩展.

现阶废弃方案,把下单的代码加入到代理项目中.这么做还是很麻烦,每次修改都要修改两个项目并且重新部署,而且每次都要把代码拷贝一份,毫无意义.

于是乎现阶段我选择一个更为激进的方案,把该部分修改为RPC调用,搭一套分布式系统,正所谓不整活活着就没意义.把正常的服务放在国内服务器上,把下单和询价部分放在美国服务器上,通过RPC调用可以成功的绕过封锁提升速度,而且还可以部署多个节点,在世界多地放置服务器,提升查询速度.

使用DUBBO,它的坑在于目前还在迭代,3.0正在研发当中,现在只能使用2.7版本.而且对zookeeper和相关类库的版本要求极为严格,一旦对不上是无法启动的,只能更换版本自己慢慢试.一旦无法连接和无法访问,报错信息极为模糊,跟本无法精准的找到原因.

现阶段在三台服务器上跑了zookeeper集群,原线上服务器不动,在ups代理服务器上跑提供者.原线上项目作为消费者.注册中心目前看起来还没有使用的必要,下次整活再加上吧.

还有,每个东西都要实现Serializable真的好烦

技术细节在其他的内部文档中.

整活真开心

2021年5月24日 17:36:17

Jason

感谢v2ex用户zerision提供的鼠标点击特效源码 原帖:https://www.v2ex.com/t/656062

function clickEffect() {
    let balls = [];
    let longPressed = false;
    let longPress;
    let multiplier = 0;
    let width, height;
    let origin;
    let normal;
    let ctx;
    const colours = ["#F73859", "#14FFEC", "#00E0FF", "#FF99FE", "#FAF15D"];
    const canvas = document.createElement("canvas");
    document.body.appendChild(canvas);
    canvas.setAttribute("style", "width: 100%; height: 100%; top: 0; left: 0; z-index: 99999; position: fixed; pointer-events: none;");
    const pointer = document.createElement("span");
    pointer.classList.add("pointer");
    document.body.appendChild(pointer);

    if (canvas.getContext && window.addEventListener) {
        ctx = canvas.getContext("2d");
        updateSize();
        window.addEventListener('resize', updateSize, false);
        loop();
        window.addEventListener("mousedown", function(e) {
            pushBalls(randBetween(10, 20), e.clientX, e.clientY);
            document.body.classList.add("is-pressed");
            longPress = setTimeout(function() {
                document.body.classList.add("is-longpress");
                longPressed = true;
            }, 500);
        }, false);
        window.addEventListener("mouseup", function(e) {
            clearInterval(longPress);
            if (longPressed == true) {
                document.body.classList.remove("is-longpress");
                pushBalls(randBetween(50 + Math.ceil(multiplier), 100 + Math.ceil(multiplier)), e.clientX, e.clientY);
                longPressed = false;
            }
            document.body.classList.remove("is-pressed");
        }, false);
        window.addEventListener("mousemove", function(e) {
            let x = e.clientX;
            let y = e.clientY;
            pointer.style.top = y + "px";
            pointer.style.left = x + "px";
        }, false);
    } else {
        console.log("canvas or addEventListener is unsupported!");
    }

    function updateSize() {
        canvas.width = window.innerWidth * 2;
        canvas.height = window.innerHeight * 2;
        canvas.style.width = window.innerWidth + 'px';
        canvas.style.height = window.innerHeight + 'px';
        ctx.scale(2, 2);
        width = (canvas.width = window.innerWidth);
        height = (canvas.height = window.innerHeight);
        origin = {
            x: width / 2,
            y: height / 2
        };
        normal = {
            x: width / 2,
            y: height / 2
        };
    }
    class Ball {
        constructor(x=origin.x, y=origin.y) {
            this.x = x;
            this.y = y;
            this.angle = Math.PI * 2 * Math.random();
            if (longPressed == true) {
                this.multiplier = randBetween(14 + multiplier, 15 + multiplier);
            } else {
                this.multiplier = randBetween(6, 12);
            }
            this.vx = (this.multiplier + Math.random() * 0.5) * Math.cos(this.angle);
            this.vy = (this.multiplier + Math.random() * 0.5) * Math.sin(this.angle);
            this.r = randBetween(8, 12) + 3 * Math.random();
            this.color = colours[Math.floor(Math.random() * colours.length)];
        }
        update() {
            this.x += this.vx - normal.x;
            this.y += this.vy - normal.y;
            normal.x = -2 / window.innerWidth * Math.sin(this.angle);
            normal.y = -2 / window.innerHeight * Math.cos(this.angle);
            this.r -= 0.3;
            this.vx *= 0.9;
            this.vy *= 0.9;
        }
    }

    function pushBalls(count=1, x=origin.x, y=origin.y) {
        for (let i = 0; i < count; i++) {
            balls.push(new Ball(x,y));
        }
    }

    function randBetween(min, max) {
        return Math.floor(Math.random() * max) + min;
    }

    function loop() {
        ctx.fillStyle = "rgba(255, 255, 255, 0)";
        ctx.clearRect(0, 0, canvas.width, canvas.height);
        for (let i = 0; i < balls.length; i++) {
            let b = balls[i];
            if (b.r < 0)
                continue;
            ctx.fillStyle = b.color;
            ctx.beginPath();
            ctx.arc(b.x, b.y, b.r, 0, Math.PI * 2, false);
            ctx.fill();
            b.update();
        }
        if (longPressed == true) {
            multiplier += 0.2;
        } else if (!longPressed && multiplier >= 0) {
            multiplier -= 0.4;
        }
        removeBall();
        requestAnimationFrame(loop);
    }

    function removeBall() {
        for (let i = 0; i < balls.length; i++) {
            let b = balls[i];
            if (b.x + b.r < 0 || b.x - b.r > width || b.y + b.r < 0 || b.y - b.r > height || b.r < 0) {
                balls.splice(i, 1);
            }
        }
    }
}

为了防止误卸载车机应用,应用均已备份了一份

下载链接

链接:https://pan.baidu.com/s/1_-NkFbRhbzWe1tLwpCp3Ew
提取码:d89f

md5

15A119BBA82768E1EEAA8D5E413627D6 *360全景V0.6800.apk
F0DBC61E4F811004CCB75936B4113572 *Android 动态壁纸V4.3-2019-04-02.apk
A45DD473009C29417BF2671C96B69E30 *Android 系统V4.3-2019-04-02.apk
1B8F0EA0FBEFB80D0CE36499859C6C35 *AnwSdkServiceV1.0.apk
F0E4507D462924F6A540EE1002EA78D2 *BluetoothV0.6800.apk
8330D9A22B6CBE004C59C3DFB2555F7F *com.android.backupconfirmV4.3-2019-04-02.apk
D2D7BC69277084C71C159D09D017AE43 *com.android.sharedstoragebackupV4.3-2019-04-02.apk
D6934B1BCBD7EE82E6C6A39E87DEC7DD *com.android.systemuiV.apk
8D26DE1472C876986ADE2E5FCDD9F01E *DRM 保护内容存储V4.3-2019-04-02.apk
A371DE4AAD8C1C2C67478318B7B81299 *ECarXBluetoothServiceV1.0.20-kc-20190110.3221.apk
D4C1ED3CD80BF4E3CC77BE4EBE3FF7DE *EcarxSettingWidgetV1.0.apk
4FB8C905162C5D27F368AD5C08872430 *Example WallpapersV4.3-2019-04-02.apk
A85FA4214BA35F47F2FE47608E72E37A *ExtraServiceV0.6800.apk
FB72B5B524EF91B3515C3EE4D8F0BC8F *Fused LocationV4.3-2019-04-02.apk
DA1A82D352E81BA29384155BCACE15E3 *HTML 查看程序V4.3-2019-04-02.apk
20FE6B7E4A661590FAF8A78000CF1CE7 *Input DevicesV4.3-2019-04-02.apk
B34131D2AF4815E59E9F3749FA0122BE *InstumentServerV.apk
8A40E15C85A37220B315DA0918BC483C *INX_GEELY_SX11_1.2V1.0.apk
2F3CAD6ED5FB891A930FCBF51F1B9506 *KC2_Navi.apk
AB1DA517D42D90E739F2C9C0B8BED2E0 *KC2_Navi.odex
1FC2B10F154CF8E1370ADBE3340CC553 *Live Wallpaper PickerV4.3-2019-04-02.apk
43178FB0F7CAAED4F2ADF50BC2C84794 *MQTTV1.0.352.2663.apk
C7F9624FBE2130B8DECACA417954DD3B *ScreensaverV1.4.7_kc.778.apk
4C88C6AA26A860EC610693C02B127291 *ShellV4.3-2019-04-02.apk
5F3C397B66C784683334E4B2C9229BE8 *TBoxClientV0.6800.apk
55C2E34320CD5CD06F8BCE24CD12F2EE *User DictionaryV4.3-2019-04-02.apk
8DCBEB0D2ADD682E5BDD78667C5126D3 *VpnDialogsV4.3-2019-04-02.apk
CB692DA6F7BBA9C64CE8D301A7FD94F6 *XCInputServiceV1.5.6.apk
5D72CA524B8F1C9E4725F67BB4180FE5 *XCStateServiceV 1.0.9_master_181123.8.apk
81AD42A5211BDEAAA69C7D22128A63E1 *XCStatisticV1.1.2.7.apk
2CA217A36B664BADCD29F3E04E923F8B *XCSystemUIPluginV1.9.12-kc-sop-m-20190308.328.apk
86294AA966BC6364FC1BC52ED3069B4D *XCTtsServiceV1.8.0.apk
1F66C881757F8BCBC503953B21F80487 *XCVoiceServiceV1.8.0.apk
1D5FECD7F1F32C3B95EF41CFCE8C9C68 *XSFConfigServiceV1.0.391.9.apk
00000000000000000000000000000000 *?高德地图?V2.7.8.23142.apk
2F7CFD0EF0DF528727214DFE60EF0074 *一键清理V1.2.452K.1433.apk
9050255514C428E5B695520A49F26A05 *下载管理程序V4.3-2019-04-02.apk
86A59EA493D167932B34A62359CD8000 *主页V1.0.54.1320.apk
5238C9026ABEC496D345CAAE4E35974B *主题V1.0.190431-kc.1198.apk
A804E46B485968C62E22E084A3EE730B *会员中心V1.4.1908421K.3067.apk
A854CA3824253BAF7107807D38790EF4 *伴听V2.1.84.apk
4B5DD69F8EE0BA6F3CD6F7C57EC2CEA5 *喜马拉雅FMV1.6.1.apk
471B3BE249194E0B1F6B60BBC2E23749 *图库V1.1.40.2179.apk
EA51FE494E908B8BC94CE7AD8FF7BE37 *基本互动屏保V4.3-2019-04-02.apk
D8FA7F2C19059B3E812C208FFE060A96 *多媒体V1.0.85_adapter_1212.649.apk
42997FA97125E6B03AE0238E2A767709 *多媒体V1.1.117_1.2.kc_190123.2760.apk
5B5AC1D813D102C0A1F15ED07506E8DA *天气V1.4.0.2971.apk
875B18574FDCA02E2D234BD0858CB1E9 *媒体存储V4.3-2019-04-02.apk
3C1440C30F962AB677AFD39061795C89 *媒体库V0.6800.apk
87FA328C918BDEBA668A3109AA716EFF *密钥链V4.3-2019-04-02.apk
5B06CCED148BEB8C7B7BAFD3650A5F03 *导航V1.0.21-kc2-tsp-20180913.3857.apk
71CDE7BACB3DEA94EAC5812F4CD5266F *工程模式V0.6800.apk
667AA8FB5819D42A73B2B74ECEA766FD *应用包安装程序V4.3-2019-04-02.apk
F7FB087637B4415E3BA3EF2AFA7833F0 *应用包访问权限帮助程序V4.3-2019-04-02.apk
771A8EC0FFD37E844322E56430B2AD08 *应用商城V1.2.515K.591.apk
28406B2B994A2158792030461A32D8D8 *应用宝V7.2.4.apk
31F7ED483353539B642723163EED42C7 *开机引导V1.2.492K.175.apk
3F469EA7F8A69DB1CFC7C3944E3FB5FA *搜索应用提供程序V4.3-2019-04-02.apk
B0AB882FCC6CECFF6F1AB1CAA7EE1CFE *收音机服务V1.0.26_adapter_190226.apk
AFF955CD050469FF190485B232B1FF2D *新闻V1.1.48.3018.apk
25687825FFD35D3107187A020568C3B9 *日历存储V4.3-2019-04-02.apk
30DC576EB52C8B8C9A7009A1E8D652C5 *时钟V1.0.7.7.apk
F9C0B64E70F1907E4F520BEB8AFE075E *测试JAR包V0.6.apk
88CDEA01A4E4B33C69B04EE7AF8A758F *灵云智能输入法V1.0.8.apk
25A062675654CAF6D79AFDBEE85E927D *用户手册V1.0.apk
DBCC0B1850CC923F7C17A73A7EAF8FC7 *电话V1.0.41-adapter-20190115.3229.apk
26C7192E2A61FC24ED7B0A296AEE1FD3 *移动网络配置V4.3-2019-04-02.apk
1B9711F7E609598D41A5394E03B9F342 *空调V1.0.253-kc-2-20190304.860.apk
02AB6A110C2F400954B0F96B20E492FB *系统更新V1.0.43.2269.apk
9C36EA5E9DC9F5EA5E32F63FF2AC39CD *联系人存储V4.3-2019-04-02.apk
2EEE68AC4911FF3BC9F0F6B9B33BD7BE *蓝牙共享V4.3-2019-04-02.apk
89C1014FF0AE212C518BF952C65F539D *蓝牙电话V0.6800.apk
C8503A7DB39A1A467E5E48F19F0C4266 *行车记录V0.6800.apk
0E56FEB6FBA559BDE003218DDE6218F2 *视频V1.1.53.2189.apk
C7450467615E0FCCB2EEC3CBAE6848DF *设置V0.6800.apk
1EA7DC7830575573A143D285F41C02BD *设置V4.3-2019-04-02.apk
197F69EE9B2ADC4BD94927205CF0D7EE *设置存储V4.3-2019-04-02.apk
314E9B755279E73ECA422DC66311F5A7 *证书安装程序V4.3-2019-04-02.apk
35093BE1A83B3B19328D9FEA5BA860AD *语音助理V1.1.0.apk
7B430D3A5489D93431D5B9A989D68F70 *语音助理VSpeechClient_1097_20190122_1144_gkui1.2kc.apk
4BF702379EB9F5150E4DEFD7B9DD1D7F *负一屏V1.4.10.217.apk
4C8D2115612E5DA203CC711FE1FC57A8 *违章查询V1.1.3_GKUI1.2.KC_181213.2893.apk
69E8179F0123FA461BE7F47C0D489109 *音乐可视化壁纸V4.3-2019-04-02.apk
25D8A193CC5C782F2507D6C22BBB2612 *魔幻烟雾壁纸V4.3-2019-04-02.apk

最近发现youtube的证书使用了新的椭圆曲线算法,于是我也想折腾弄了一下。
1.首先需要生成椭圆曲线算法的密钥 命令

openssl ecparam -genkey -name secp384r1 | sudo openssl ec -out private.key

如果已经有密钥可以跳过这步,我使用的算法是secp256r1
2.接下来需要安装certbot,这部不多说了。
3.需要创建配置文件如 cert.conf

[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
 
[req_distinguished_name]
 
[v3_req]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
 
[alt_names]
DNS.1 = t2t2.cc
DNS.2 = www.t2t2.cc
DNS.3 = jason19659.pw
DNS.4 = www.jason19659.pw

DNS写自己的域名,然后保存为文件
4.

openssl req -new -sha256 -key private.key -out public.csr -subj "/C=IN/ST=Goa/L=Ponda/O=Priolkar Elf/CN=t2t2.cc" -config cert.conf
 

生成csr.
5.生成证书 命令:

letsencrypt certonly --hsts -w /var/www/blog/ -d t2t2.cc -d jason19659.pw --email jason19659@163.com --csr "public.csr"
 
 

-d 为需要生成证书的域名 -w是网站根目录,可以直接访问到的 –csr是csr文件位置。
6.生成之后 private是ssl_certificate_key。

– Congratulations! Your certificate and chain have been saved at:
/ssl/t2t2.cc/0001_chain.pem

生成之后会提示ssl_certificate在哪

继续转载当年的坑系列,这个系列的题目都是当年从各种坑中收集而来的。
本题中只要有跟final字符串有关的操作,最后结果都相等

false

true

true

true

true


                String ab = "ab";
			
	        String a = "a";
	        String b = a +"b";
	        System.out.println(b == ab);
	        
	        final String s12 = "a";
	        String s22 = s12 +"b";
	        System.out.println(s22 == ab);
	        
	        final String s1 = "ab";
	        String s4 = "abcdef";
	        String s5 = s1 + "cdef";
	        String s6 = "ab" + "cdef";
	        System.out.println(s4 == s5);
	        System.out.println(s4 == s6);
	        System.out.println(s5 == s6);

继续转载当年的坑系列,这个系列的题目都是当年从各种坑中收集而来的。

 


	public class Test23 {
		static {
			name = "B";
		}
		static String name = "A";
		static {
			System.out.println(name);
		}
	
		public Test23() {
			System.out.println("初始化" + name);
		}
	
		public static void main(String[] args) {
	
		}
	}

会输出什么?
答案:
Continue reading

继续转载当年的坑系列,这个系列的题目都是当年从各种坑中收集而来的。

 

 

public class 初始化重载 {
    public static void main(String[] args) {
        new Derived();
    }
}
 
class Base {
    private int i = 2;
     
    public Base() {
        display();
    }
    public void display() {
        System.out.println(i);
    }
}
 
class Derived extends Base {
    private int i = 22;
     
    public Derived() {
        i = 222;
    }
     
    public void display() {
        System.out.println(i);
    }
}

问:会输出什么?
答案:
Continue reading