西维蜀黍

【VMware】软路由在 ESXi 中安装 OpenWrt

Build

  ...


【Linux】sshd 配置文件(ssh/sshd_config)

sshd 的配置文件位于 /etc/ssh/sshd_config,这是 OpenSSH 服务器的主配置文件,用于控制 SSH 服务器的行为。

以下是一些常见的配置选项及其含义:

常用配置选项

Port

设置 SSH 服务器监听的端口。默认是 22,但可以更改为其他非标准端口以增加安全性。

  ...


【Ubuntu】Install GitLab

  ...


【VMware】VMware ESXi 8 安装 macOS

Build ISO Mirrnor

参考 https://swsmile.info/post/make-macos-install-usb-stick/

为VMware ESXi 安装补丁

Download macOS Unlocker V4.0 for VMware ESXi: https://github.com/DrDonk/esxi-unlocker

The ESXi unlocker will need to be run each time the ESXi Server is upgraded. It is also best to switch ESXi to Maintanence mode and make sure you do not have any VMs running.

cd /tmp; wget http://192.168.18.4:9000/esxi/esxi-unlocker-4.0.6.zip; unzip esxi-unlocker-4.0.6.zip; cd esxi-unlocker-4.0.6; chmod +x unlock; ./unlock

cd /tmp; wget http://192.168.18.4:9000/esxi/esxi-unlocker-4.0.6.zip; unzip esxi-unlocker-4.0.6.zip; cd esxi-unlocker-4.0.6; chmod +x check; ./check

制作镜像

Convert and rename the Disk Image to ISO

  ...


【PVE】Install ProxMox VE (PVE)

Download

https://www.proxmox.com/en/downloads

Prepare a USB Flash Drive

  • use balenaEtcher
  ...


【macOS】制作 VMware vSphere Hypervisor (ESXi) 8.0 U3

Install

$ diskutil list

$ diskutil eraseDisk MS-DOS "ESXI" MBR /dev/disk4

$ diskutil unmountDisk /dev/disk4

$ sudo fdisk -e /dev/disk4
Password:
fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory
Enter 'help' for information
fdisk: 1> f 1
Partition 1 marked active.
fdisk:*1> write
Writing MBR at offset 0.
fdisk: 1> exit

$ hdiutil mount Downloads/VMware-VMvisor-Installer-8.0U3-24022510.x86_64.iso
/dev/disk6          	                               	/Volumes/ESXI-8.0U3-24022510-STANDARD
$ cp -R /Volumes/ESXI-8.0U3-24022510-STANDARD/* /Volumes/ESXI/
  ...


【Compile】ANTLR

Background

文法定义(Grammar Definition)

风控策略表达式的语法到底是什么样的?也就是说 风控策略表达式这种DSL的语法结构是什么?

在学习形式语言或编译原理课程时,想必大家肯定接触过BNF(Backus-Naur Form),即巴科斯范式。巴科斯范式是以美国人巴科斯(Backus)和丹麦人诺尔(Naur)的名字命名的一种形式化的语法表示方法,是用来描述语法的一种形式体系,是一种典型的元语言。自从编程语言Algol 60(Naur,1960)使用BNF符号定义语法以来,这种符号规则体系被证明适合作为形式化编程语言的语法,之后人们也开始习惯于使用此类元语言去定义语言语法。

BNF元语言的典型表达形式如下:

<symbol> ::= expression
<symbol> ::= expression1 | expression2
  • 这个式子左侧放在尖括号中的symbol是一个非终结符号,而expression这个表达式由一个或多个终结符号或非终结符号的序列组成,这个式子也被称为产生式(production)。
  • 产生式中的“::=”这个符号含义是“被定义为”,左边的非终结符号可以被推导为右边的表达式,右边的表达式也可以归约为左边的非终结符号。
  • 如果右侧有多种表达式形式可作为symbol的归约选择,可以使用”|”符号分隔。
  • 从未出现在左边的符号是终结符号。另一方面,出现在左侧的符号为非终结符号,并且总是被包围在一对<>之间。

随着BNF的广泛应用,一些以简化BNF或特定应用为目的的扩展BNF元语言被创建出来,其中典型的包括EBNF、ABNF等。

我们来定义一下能描述背景的例子的文法:

/* 关键字 */
USER: 'user';
CONTAINS: 'contains';
AND: 'and';
OR: 'or';

/* 符号和运算符 */
DOUBLE_QUOTE: '"';
COMMA: ',';
DOT: '.';
LT: '<';
LE: '<=';
GT: '>';
GE: '>=';
EQ: '==';
NE: '!=';
DOLLAR: '$';
L_PAREN: '(';
R_PAREN: ')';
L_CURLY: '{';
R_CURLY: '}';
L_BRACKET: '[';
R_BRACKET: ']';

/* 标识符 */
ID: [a-zA-Z][a-zA-Z0-9]+;

/* 无符号整数和字符串的字面量 */
NUM_LIT: ('0' | [1-9] ('_'? [0-9])*);
STR_LIT: DOUBLE_QUOTE ~["\\]* DOUBLE_QUOTE;

以上为词法规则,全部使用大写表示,定义了所有的终结符。

  ...


【Compile】Lex and Yacc

Lex

Lex is a computer program that generates lexical analyzers (“scanners” or “lexers”). It is commonly used with the yacc parser generator and is the standard lexical analyzer generator on many Unix and Unix-like systems.

Lex reads an input stream specifying the lexical analyzer and writes source code which implements the lexical analyzer in the C programming language.

  ...


【Compile】编译(Compilation)

编译原理(Fundamentals of Compiling)

  ...


【Engineering】规则引擎(Rule Engine)

  ...