git-send-email: SSL_verify_mode 警告

CentOS7 上使用git send-email发送patch,碰到一个SSL的警告,可以通过修改 /usr/share/perl5/Net/SMTP.pm 解决。

$ diff SMTP.pm.orig SMTP.pm -urp
--- SMTP.pm.orig	2019-06-21 23:33:55.298091001 +0000
+++ SMTP.pm	2019-06-21 23:33:29.120829781 +0000
@@ -59,6 +59,7 @@ sub new {
       PeerPort => $arg{Port} || 'smtp(25)',
       LocalAddr => $arg{LocalAddr},
       LocalPort => $arg{LocalPort},
+      SSL_verify_mode => 0,
       Proto     => 'tcp',
       Timeout   => defined $arg{Timeout}
       ? $arg{Timeout}
$ git send-email --no-signed-off-by-cc --suppress-cc=all --to kongjianjun@gmail.com 0001-dist-suppress-the-yaml-load-warning.patch
0001-dist-suppress-the-yaml-load-warning.patch
*******************************************************************
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
possibly with SSL_ca_file|SSL_ca_path for verification.
If you really don't want to verify the certificate and keep the
connection open to Man-In-The-Middle attacks please set
SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
*******************************************************************
at /usr/libexec/git-core/git-send-email line 1211.
OK. Log says:
Server: smtp.gmail.com
MAIL FROM:<>
RCPT TO:<kongjianjun@gmail.com>
From: Amos Kong <>
To: kongjianjun@gmail.com
Subject: [PATCH scylla] dist: suppress the yaml load warning
Date: Fri, 21 Jun 2019 23:23:17 +0000
X-Mailer: git-send-email 1.8.3.1

Result: 250 2.0.0 OK 1561159400 z18sm3445252pgv.8 - gsmtp

In git 1.7.0, the default has changed to --no-chain-reply-to
Set sendemail.chainreplyto configuration variable to true if
you want to keep --chain-reply-to as your default.

SimpleSSHD for Android

https://play.google.com/store/apps/details?id=org.galexander.sshd&hl=en

通过google play安装到手机,默认端口为2222,app手机启动后,需要点击启动按钮开启服务。app上会显示手机ip。

然后通过电脑ssh客户端连接,如 ssh 192.168.1.100 -p 2222,连接建立后会在app上显示随机分配的密码,再客户端输入后可以成功登陆了。可以在ssh文件目录下添加 authorized_keys文件,这样就不用每次输入了。

手机sd卡的目录为 /sdcard/,连接的普通用户是有读写访问权限的。可以使用rsync把手机相册的问题件同步到电脑上。rsync -e ‘ssh -p 2222’ -rtvpl 192.168.1.1:/sdcard/DCIM/ .

扩展:Asias使用rsync把手机图片视频原始文件同步到电脑,然后再压缩后回传到手机,这样大大减少了手机空间使用,而且压缩后的图片视频基本不影响查看。

Algorithm: Practical Set Reconciliation

《Practical Set Reconciliation》
Yaron Minsky Cornell University https://blog.janestreet.com/author/yminsky/
Ari Trachtenberg Boston University

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.456.7200&rep=rep1&type=pdf

def set_reconcile(src_seq, dst_seq):
    "Return required operations to mutate src_seq into dst_seq"
    src_set= set(src_seq) # no-op if already of type set
    dst_set= set(dst_seq) # ditto

    for item in src_set - dst_set:
        yield 'delete', item

    for item in dst_set - src_set:
        yield 'create', item

for i in set_reconcile([1,2,3,4], [2,3,4,5]):
    print i

$ python set_reconcile.py 
('delete', 1)
('create', 5)

Input & Output

2007年因为opera博客被封,决定自己注册域名、购买空间,创办个人网站。一直维持个人小站、技术生活大杂烩博客。这些年网络世界发生了翻天覆地的变化,内容背后更多的是网络社交关系。现在分享的平台太多,博客、微信、公众号、medium、简书、twitter、Facebook、音频(如喜马拉雅)、视频(youku\youtube\抖音)、知乎、豆瓣。

周围的朋友,也有很多人通过网络分享精彩的生活,涉及绘画、美食、健身、旅行、育儿等等。百家争鸣,百花齐放!

每个人都是一个系统,可以通过阅读、旅行、社交等等进行输入。然后内部加工(思考)后通过言行进行输出。输出的可能是知识、思想、价值观、生活感想等等。网络也是一个个性展现的大平台,一个更加开放包容的平台。

现在博客写的太少,估计看的人也少,而且基本都是生活相关的。所以索性把博客搬到wordpress.com。我想梳理一下,选择自己擅长的领域,多思考、多对外有高质量的“输出”。

圣诞前

This is a blog from mobile app.

wordpress.com好像不被GFW屏蔽了,难得呀。不知道是临时,还是长期。虽然用手机码字写博客不会是经常,但随时随地能方便的发东西还是很不错的。

今天是周一,早上上班路上明显感觉大家都很赶时间,各种横冲直闯,狭路相逢勇者胜。

虽然还有一周才过圣诞节,上周已经有人开始提这事,开始问候了。小孩看到别人拍的公司的音乐圣诞树也是兴奋不已,去年老婆也在家里专门装扮了一个小圣诞树,闪烁的灯光,再加上精心挑选的背景音乐,让大人和小孩都进入了无限的遐想。

于是周末带小孩逛商场,果不其然多数商家费尽心思各种装扮,装点满满的圣诞树,可爱的小雪人,圣诞老人🎅和小鹿。有一个母婴店,用绳子挂满了中国剪纸的圣诞老人和英文祝福语,很有特色,当然这个剪纸也有可能是机器加工的,虽然没有灵魂,但还是五颜六色很漂亮。

最后吃完披萨,准备去看电影《龙猫》,这个应该非常适合小孩子。但当天只有日语版了,最后只能放弃。

Continue reading “圣诞前”

Meet Casper

Casper was my colleague in Red Hat, we haven’t met each other for about 4 years. We knew same friends in Opensource communities before he join in Red Hat. He is working for Aliyun on system software area.

They want to cooperate with Universities, share their cool technology, provide guide and job position (intern or regular) for the students.

They investigated and used machine-learning in system software, one success usecase is key-value search, it’s quicker than hash table, but only for read most situation, that’s popular in their production environment.

Opensource NoSQL – Scylla (compatible with Cassandra)

About Scylla

Scylla is an open source drop-in replacement for Apache Cassandra at 10x the performance and low tail-latency at all times. The project was started from 2014, github major project Scylla has 14,000+ commits, 40+ contributors.

The team behind Scylla designed and developed the KVM hypervisor, the default hypervisor in many cloud computing environments, including Google Compute Engine and OpenStack.

You can follow or join in its development by Twitter (@ScyllaDB), Maillist (https://groups.google.com/forum/#!forum/scylladb-dev), Github (http://github.com/scylladb/), Slack (found latest invite link from http://www.scylladb.com/open-source/).

Download packages from http://www.scylladb.com/download/

About Seastar

Seastar(http://www.seastar-project.org/) is an advanced, open-source C++ framework for high-performance server applications on modern hardware. Seastar is used in ScyllaDB .

Google Chrome can’t save password

All saved password in Chrome disappeared after upgrading the system to High Sierra. I tried to sync it from Google, sync completed but no password was synced. And the password of new site can’t be saved successfully, Chrome asked to save it, but not really work.

I can’t bear to remember all password especially for some unimportant sites, I found a solution in Google forum. The problem was solved by following steps:

  • delete all users from Google chrome
  • upgrade Chrome to latest version
  • quit Chrome
  • deleting KeyChain of Chrome
  • start Chrome
  • add user, login with your Google account (apps, data will be synced again)

After executed above steps, I can saw original saved password, and when I login new sites, the password can be saved to Chrome as expected.

scylla main.cc

main:
– cpu sse4.2 flag check
– init the uptime timer
– app template/config/options
– query_processor
– get storage_proxy
– get migration_manager
– http_context ctx (create)
– prometheus
– app.run_deprecated()
– parse args
– tcp_syncookies check
– seastar::async()
– dma read cfg
– apply logging settings
– verify rlimit(openfile)
– mem_per_shard 2 ** 32 ~= 1G
– check partitioner, Murmur3Partitioner is recommended
– cfg: assign setup parameters
– start prometheus API server
– set broadcast/broadcast_rpc
– client encryption
– create trace/snitch
– dns/api_address
– start API server(ctx.http_server)
– init storage service
– init per-shard core
– start engine
– init data dir
– init commitlog dir
– * init system keyspace
– * start gossip by init_ms_fd_gossiper()
– * start storage proxy
– start migration manager
– start query processor
– init batchlog manager
– init metrics?
– mini setup (sys ks)
– legacy schema migrate
– loading sstables
– setup sys ks
– start commitlog
– set storage/gossip/snitch/storage_proxy/load_sstable server to ctx
– init migration manager rpc verbs
– init storage proxy rpc verbs
– * start streaming service
– starting msg service
– start storage service
– start load broadcaster
– start cf/cache hit rate
– start native transport ( start (thrift) rpc)
– * set_server_done
– at_exit():
– repair_shutdown
– drain_on_shutdown
– compaction_manager stop

Key components
– storage proxy
– migration manager
– partitioner
– prometheus API server
– engine
– query processor
– streaming service
– thrift rpc
– compaction manager