博文

目前显示的是 2021的博文

TCP in Linux

图片
        TCP的属性包括:Target目标的IP和端口;Source来源的IP和端口;socket file handle。 cat /proc/sys/net/ipv4/ip_local_port_range 可使用端口范围1024 6500,即63977. 理论65535个2^16。  vim /etc/sysctl.conf  ;  net.ipv4.ip_local_port_range = 60000 60009; save; sysctl -p /etc/sysctl.conf ; 系统打开的最大数:cat /proc/sys/fs/file-max 用户可以打开的最大文件数:cat /etc/security/limits.conf 单进程可以打开的最大文件数: cat /proc/sys/fs/nr_open echo 100 > /proc/sys/fs/nr_open 一个线程对一个TCP,采用IO多路复用后,一个线程可以对多个TCP; https://app.diagrams.net/  

The Windows Subsystem for Linux(WSL)- Kali

What is the Windows Subsystem for Linux see https://docs.microsoft.com/en-us/windows/wsl/about . wsl --list --verbose Kali Linux cat /etc/os-release sudo apt update && sudo apt upgrate -y sudo apt install kali-desktop-xfce -y sudo apt install xrdp -y sudo service xrdp start ip add Now you can use Remote Desktop Connection of Windows to connect Kali. to do 1: sudo apt install theharvester theHarvester -d baidu.com -b google   // google will block your IP, if you run this command. Reference: htt p s:/ / w ww. y outube . com/watch ? v = AfVH54edAHU theHarvester theHarvester is a command-line tool included in Kali Linux that acts as a wrapper for a variety of search engines and is used to find email accounts, subdomain names, virtual hosts, open ports / banners, and employee names related to a domain from different public sources (such as search engines and PGP key servers).   to do 2: youtube-dl 91NZ_Rnr7Jc -o bad_apple.mp4 ffmpeg -i bad_apple.mp4 bad_apple_h264.mp4 mplayer -

DV, Domain validated and letsencrypt.org

 Domain Validated; Organization validated; Extended validation;   Let's Encrypt Getting Started - Let's Encrypt (letsencrypt.org) is a free, automated, and open certificateauthority brought to you by the nonprofit Internet Security Research Group(ISRG). To enable HTTPS on your website, you need to get a certificate (a type of file) from a Certificate Authority (CA). Let’s Encrypt is a CA. In order to get a certificate for your website’s domain from Let’s Encrypt, you have to demonstrate control over the domain. With Let’s Encrypt, you do this using software that uses the   ACME protocol   which typically runs on your web host.        OCSP Stapling inside the Server.  ZeroSSL; OS always trusts identrust DST Root CA *3.   LetsEncrypt gets Let's Encrypt R3 from DST Root CA *3 that was expired on 9/30/2021. ISRG Root X1 is Let's Encrypt root, which join the trust list of OS in 2021. Android >=2.3.6<7.1.1 has Let's Encrypt R3, does not have ISRG Root X1.  Let

程序员必须是业务专家才能开发出好的软件业务系统吗?Do programmers have to be business experts to develop good software business systems?

 程序员必须是业务专家才能开发出好的软件业务系统吗? Do programmers have to be business experts to develop good software business systems?

base64 in Nodejs and Java

From :  https://www.hacksparrow.com/nodejs/base64-encoding-decoding-in-node-js.html let secretBase64 = Buffer.from(“ JavaScript ”).toString('base64'); // SmF2YVNjcmlwdA== var b = new Buffer('JavaScript'); // Buffer var s = b.toString('base64'); // SmF2YVNjcmlwdA== var b = new Buffer('SmF2YVNjcmlwdA==', 'base64') var s = b.toString(); // JavaScript // ------------------- var b = new Buffer('SmF2YVNjcmlwdA==', 'base64') var s = b.toString('hex'); // 4a617661536372697074 var b = new Buffer('4a617661536372697074', 'hex') var s = b.toString('utf8'); // JavaScript //---------------------- $node >require('crypto').randomBytes(64).toString('hex') f3a302c14cd2f57bc6972a0d599857dbde877fbf03b38dd592b9635bc7f30299c9d5dfe44e5abb615737cf40a45958c8283b5d1132c4e7e0d8e66610044be1f4 https://expressjs.com/en/api.html var fs = require('fs' ); // function to encode file data to base64 enc

Log: update System.Net.Http.dll

Update System.Net.Http.dll We need to modify three files, packages.config, Web.config, App.conf, then copy System.Net.Http.dll into the folder bin. 1.packages.config C:\Users\JinTb\Documents\tb\new-net-api\src\TbApi45\TBWebService\packages.config <package id="System.Net.Http" version="4.3.4" targetFramework="net461" /> D:\jin\net-api\src\Api45\twWebService\packages.config <package id="System.Net.Http" version="4.3.3" targetFramework="net461" /> ------------------------------ 2.Web.config <dependentAssembly>         <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />         <bindingRedirect oldVersion="0.0.0.0-4.1.1.2" newVersion="4.1.1.2" />       </dependentAssembly> <dependentAssembly>         <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a"

Java-deepcopy

Reference:  https://www.baeldung.com/java-immutable-object From: https://github.com/eugenp/tutorials/tree/master/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/deepcopy package com.baeldung.deepcopy; import java.io.Serializable; public class Address implements Serializable, Cloneable {     @Override     public Object clone () {         try {             return (Address) super.clone();         } catch (CloneNotSupportedException e) {             return new Address(this.street, this.getCity(), this.getCountry());         }     }     private static final long serialVersionUID = 1740913841244949416L;     private String street;     private String city;     private String country;     public Address(Address that) {         this(that.getStreet(), that.getCity(), that.getCountry());     }     public Address(String street, String city, String country) {         this.street = street;         this.city = city;         this.country = country;     }     public Address() {

distributed transaction solution - Seata

 Distributed Transaction Solution GTS(Global Transaction Service) ACID XA(eXtended Architecture) X/Open. TM(Transaction Manager), RM(Resource Manager), and Application Manager. XA->2PC(Prepare, commit, rollback)->TCC(Try,Confirm,Canccel)->3PC(CanCommit,PreCommit,DoCommit) Saga , 1987 year, by Hector and Kenneth for Long lived transaction. Princeton University Seata TXC->GTS->Seata->Seata GA TC(Transaction Coordinator),TM(Transaction Manager),RM(Resource Manager). http://seata.io/en-us/docs/overview/what-is-seata.html XID - Transaction ID TC - Transaction Coordinator Maintain status of global and branch transactions, drive the global commit or rollback. TM - Transaction Manager Define the scope of global transaction: begin a global transaction, commit or rollback a global transaction. RM - Resource Manager Manage resources that branch transactions working on, talk to TC for registering branch transactions and reporting status of branch transactions, and drive th

CAP, Consistency, Availability, Partition tolerance & ES, Elastic Search

 CAP, Consistency, Availability, Partition tolerance Consistency Consistency means that all clients see the same data at the same time, no matter which node they connect to. For this to happen, whenever data is written to one node, it must be instantly forwarded or replicated to all the other nodes in the system before the write is deemed ‘successful.’ Availability Availability means that that any client making a request for data gets a response, even if one or more nodes are down. Another way to state this—all working nodes in the distributed system return a valid response for any request, without exception. Partition tolerance A partition is a communications break within a distributed system—a lost or temporarily delayed connection between two nodes. Partition tolerance means that the cluster must continue to work despite any number of communication breakdowns between nodes in the system. From: https://www.ibm.com/cloud/learn/cap-theorem CA: Oracle, My SQL; AP:Co