August 8, 2023
·
72 min read
thrift 是一种接口描述语言和二进制通讯协议,它被用来定义和创建跨语言的服务。
Thrift 是 Facebook 于 2007 年开发的跨语言的 RPC(Remote Procedure Call,远程过程调用)服务框架,提供多语言的编译功能,并提供多种服务器工作模式;用户通过 Thrift 的 IDL(接口定义语言)来描述接口函数及数据类型,然后通过 Thrift 的编译环境生成各种语言类型的接口文件,用户可以根据自己的需要采用不同的语言开发客户端代码和服务器端代码,让不同语言构建的服务可以做到远程调用无缝对接。(它们的目的都是提供本地调用远程服务的能力)
RPC(Remote Procedure Call,远程过程调用)是一个计算机通信协议,此协议允许进程间通信。简单来说,当机器 A 上的进程调用机器 B 上的进程时,A 上的调用进程被挂起,而 B 上的被调用进程开始执行。调用方可以通过参数将信息传送给被调用方,然后可以通过被调用方传回的结果得到返回
大部分的RPC框架都遵循如下三个开发步骤:
- 定义一个接口说明文件:描述了对象(结构体)、对象成员、接口方法等一系列信息;
- 通过
RPC框架所提供的编译器,将接口说明文件编译成具体的语言文件; - 在客户端和服务器端分别引入
RPC编译器所生成的文件,即可像调用本地方法一样调用服务端代码;
RPC是一种C/S架构的服务模型,server端提供接口供client调用,client端向server端发送数据,server端接收client端的数据进行相关计算并将结果返回给client端。
...
July 26, 2022
·
1 min read
A tmux instance can contain multiple sessions, a session can contain multiple windows, a window can contain multiple panes, and a shell dialog is opened in each pane.
...
July 25, 2022
·
23 min read
Shell is the language we use to communicate with the operating system through the command line.
Shell scripts can run directly on the command line, or a set of logic can be organized into a file for reuse. The command line can be thought of as a “shell script executing line by line.”
There are many common kinds of shell scripts in Linux, including:
- Bourne Shell (
/usr/bin/sh or /bin/sh) - Bourne Again Shell (
/bin/bash) - C Shell (
/usr/bin/csh) - K Shell (
/usr/bin/ksh) zsh- …
Linux systems generally use bash by default.
The file should begin with #! /bin/bash to specify bash as the script interpreter.
...
February 12, 2022
·
4 min read
Log In to the Server
#
user: usernamehostname: IP address or domain name
The first time you log in, you will see this prompt:
The authenticity of host '123.57.47.211 (123.57.47.211)' can't be established.
ECDSA key fingerprint is SHA256:iy237yysfCe013/l+
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Enter yes and press Enter. This records the server’s information in ~/.ssh/known_hosts.
Then enter the password to log in to the remote server.
The default login port is 22. To log in through a specific port:
...