Blogs ›

File, Block and Object Storages

August 9, 2022
storage

Files, blocks, and objects are storage formats that hold, organize, and present data in different ways—each with their own capabilities and limitations. File storage organizes and represents data as a hierarchy of files in folders; block storage chunks data into arbitrarily organized, evenly sized volumes; and object storage manages data and links it to associated metadata.

The terms file storage, block storage, and object storage refers to the API that the storage exports to its consumers, regardless of the transport (network, local, etc.).

...

GCC vs. Clang/LLVM: An In-Depth Comparison of C/C++ Compilers

August 7, 2022
compiler

Introducing GNU Compiler Collection (GCC) and Clang/Low Level Virtual Machine (LLVM); comparing the performance of both C/C++ compilers

This post is copied from here

Background #

Visual C++, GNU Compiler Collection (GCC), and Clang/Low Level Virtual Machine (LLVM) are three mainstream C/C++ compilers in the industry. Visual C++ provides graphical user interfaces (GUIs) and is easy to debug, but it is not suitable for Linux platforms. Therefore, this document mainly compares GCC with Clang/LLVM.

...

Check Network Cards for Linux

April 7, 2022
network

The network interface controller (NIC). Also known as a network interface card, network adapter, LAN adapter or physical network interface, and so on. the following commands can be used for list NIC for linux.

Overview #

  1. lspci, List all PCI devices
  2. lshw, Linux identify Ethernet interfaces and NIC hardware.
  3. dmidecode, List all hardware data from BIOS.
  4. ifconfig, Outdated network config utility
  5. ip, Recommended new network config utility.
  6. hwinfo, Probe Linux for network cards.
  7. ethtool, A unified NIC/card driver and settings read/set utility on Linux.
...

Linux proxy setup

April 6, 2022
development

Sometimes we need to set up a proxy from the command line due to network issues. On Ubuntu, the common commands I use that require networking are curl, git, apt, wget, docker, maven, gradle, npm, yarn etc. Some of these commands access proxy settings in environment variables, some of them requires specific configurations. In this post, we are targeting a Debian-based distribution, e.g, Debian and Ubuntu…

...

Tweaking git history with git rebase

February 3, 2022
git

Git rebase can be used as a powerful tool to tweak the git history, this post log basic git rebase usage with an example that removes large files from git. The Error Message # So, you just tried to run git push, and after taking longer than usual, you get an error trace like this one: remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs. ...

Git side-by-side diff in tig with meld

January 20, 2022
git

Side-by-side diffs are more readable to me than in-line diffs.

Long time ago, I started using Meld to display them when working with git. But I always needed to manually specify branch or commit names. This week I finally spent some time and found a way to invoke Meld directly from tig, so that I can see the diff side-by-side while browsing a commit history in tig (for example, when I want to review a proposed branch containing 10 new commits, and I want to inspect each of them individually). Here’s a short howto.

...

Implementing gRPCweb with Istio Envoy

June 10, 2019
grpc, istio, envoy

This is a post which was about how web applications can benefit from gRPC by leveraging a gRPC sub-project called gRPC-Web along with Istio.

gRPC-Web addresses a shortcoming in the core gRPC framework: the fact that it doesn’t work so well with web applications running on browsers. That’s because even though most browsers support HTTP/2 and gRPC is based on HTTP/2, gRPC has its own protocols that web applications must understand in order to work properly with it. But web applications do not have this capability because browsers don’t support gRPC out of the box. Developers are increasingly looking to benefit from the advantages the core gRPC framework confers beyond backend microservices, thus gRPC-Web was born.

...

TLS/SSL 协议

August 30, 2018
tls, security

  • TLS/SSL 是什么,他们的区别是什么
  • TLS 握手协议 - handshake protocol
  • TLS 如何提供认证、授权、保密以及完整性
  • 实例:用openssl 生成证书链, client/server 如何使用证书链
...

Git Submodule

July 17, 2018
git

基于公司的项目会越来越多,常常需要提取公共的library提供给多个项目使用,但是这个library怎么和git在一起方便管理呢?

我们需要解决下面几个问题:

  • 如何在git项目中导入library?
  • library在其他的项目中被修改了可以更新到远程的代码库中?
  • 其他项目如何获取到library最新的提交?
  • 如何在clone的时候能够自动导入library?

解决以上问题,可以考虑使用git的submodule来解决。

...