Skip to content

Instantly share code, notes, and snippets.

View zhjwpku's full-sized avatar
🦀

Junwang Zhao zhjwpku

🦀
View GitHub Profile

On the wire encryption

Google Summer of Code 2016

Background

Ceph does a cryptographic handshake when establishing a connection in order to mutually authenticate the client and server, but the actual data is not encrypted. This project would use the existing session key to encrypt that traffic. Obviously this will provide ceph with a more safe transmission mode.

We need to support:

// ant filter, 用于拷贝时进行参数替换
import org.apache.tools.ant.filters.ReplaceTokens
import org.apache.tools.ant.filters.FixCrLfFilter
// 定义默认构建任务,即./gradlew如果不加参数会启动该任务
defaultTasks 'bundle'
// 定义全局变量,通常项目依赖包的版本号会放在这里,另外,如果子项目依赖的版本不同,可在子项目中overwrite
ext {
aspectjweaverVersion = '1.8.2'

Keybase proof

I hereby claim:

  • I am zhjwpku on github.
  • I am zhjwpku (https://keybase.io/zhjwpku) on keybase.
  • I have a public key ASAj2SBQThWoo8sK4TdmngZILI3gQfxvJzUAhFsz7Squ6Ao

To claim this, I am signing this object:

mysql> select * from balancer;
+----+--------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------------------+
| id | key | value | type | op_time |
+----+--------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Josephus {
public static List<Integer> getResult(int n, int m) {
List<Integer> circle = new ArrayList<>();
for (int i = 1; i <= n; i++) {
circle.add(i);
import java.util.Scanner;
public class Jiepijiu {
public static void main(String [] args) {
int w[] = new int[10010];
int lastw[] = new int[10010];
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int m = scanner.nextInt();
int time = 0;
public class MaxNumString {
public int Continumax(String intputStr, StringBuffer outputStr){
int maxlength=0;
StringBuffer maxNumberStr = null;
int nowlength=0;
StringBuffer nowNumberStr = null;
for(int i=0;i<intputStr.length();i++){
@zhjwpku
zhjwpku / pg_buffercache.sql
Last active July 2, 2022 13:04
pg_buffercache usage
create extension pg_buffercache;
-- 查看哪个数据库占用的缓存最多
select datname, count(*), count(*) filter (where isdirty = true) as dirty
from pg_buffercache as b, pg_database as d
where d.oid = b.reldatabase
group by rollup (1);
-- 查看指定数据库中哪张表占用的缓存最多
select relname, relkind, count(*), count(*) filter (where isdirty = true) as dirty
@zhjwpku
zhjwpku / gpdb_tpch_lz4.sql
Created October 4, 2022 05:01
Greenplum tpch lz4 compression test.
CREATE TABLE customer_lz4 (
c_custkey integer NOT NULL,
c_name character varying(25) NOT NULL,
c_address character varying(40) NOT NULL,
c_nationkey integer NOT NULL,
c_phone character(15) NOT NULL,
c_acctbal numeric(15,2) NOT NULL,
c_mktsegment character(10) NOT NULL,
c_comment character varying(117) NOT NULL
) with (appendoptimized=true, compresstype=lz4, compresslevel = 1, orientation=column) distributed by (c_custkey);
@zhjwpku
zhjwpku / gpdb_tpch_zstd.sql
Created October 4, 2022 05:05
Greenplum tpch zstd compression test.
CREATE TABLE customer_zstd (
c_custkey integer NOT NULL,
c_name character varying(25) NOT NULL,
c_address character varying(40) NOT NULL,
c_nationkey integer NOT NULL,
c_phone character(15) NOT NULL,
c_acctbal numeric(15,2) NOT NULL,
c_mktsegment character(10) NOT NULL,
c_comment character varying(117) NOT NULL
) with (appendoptimized=true, compresstype=zstd, orientation=column) distributed by (c_custkey);