Skip to content

Instantly share code, notes, and snippets.

View CandyMi's full-sized avatar

CandyMi CandyMi

View GitHub Profile
@CandyMi
CandyMi / bbr.ps1
Created October 11, 2024 10:28
Windows 11 开启 BBR 的 PowerShell 脚本
# 变更为BBR2
netsh int tcp set supplemental Template=Internet CongestionProvider=bbr
netsh int tcp set supplemental Template=Datacenter CongestionProvider=bbr
netsh int tcp set supplemental Template=Compat CongestionProvider=bbr
netsh int tcp set supplemental Template=DatacenterCustom CongestionProvider=bbr
netsh int tcp set supplemental Template=InternetCustom CongestionProvider=bbr
# 恢复为CUBIC
# netsh int tcp set supplemental Template=Internet CongestionProvider=cubic
# netsh int tcp set supplemental Template=Datacenter CongestionProvider=cubic
@CandyMi
CandyMi / README.md
Last active August 13, 2024 11:36
Unix-Like 运行包装脚本

运行脚本

自动搜索安装的内存分配器并加入到LDPRELAOD中, 然后运行后续参数的内容.

使用示例

运行后在下面的命令:

root@localhost:~/xrioadmin$ ./start.sh luac -
@CandyMi
CandyMi / README.md
Last active July 16, 2024 08:50
ascii的编码和解码

ascii的编码和解码

测试代码

local ascii = require "ascii"
print(ascii.encode('我123321sdacsdavsd'))
print(ascii.decode('我123321sdacsdavsd'))
@CandyMi
CandyMi / README.md
Last active July 15, 2024 11:44
对指定字符串进行`Unicode`编码、解码.

Unicode 编码 / 解码

测试代码:

local unicode = require "unicode"

print(unicode.encode("我是谁abc"))
print(unicode.encode("我是谁abc", true))
@CandyMi
CandyMi / README.md
Created July 11, 2024 03:44
测试证书

测试证书

RSA

-----BEGIN CERTIFICATE-----
MIIDATCCAekCFHtrL6LgAAo9od9xDpCoG1EqJQgqMA0GCSqGSIb3DQEBCwUAMD0x
CzAJBgNVBAYTAkNOMQswCQYDVQQIDAJDRDEhMB8GA1UECgwYSW50ZXJuZXQgV2lk
Z2l0cyBQdHkgTHRkMB4XDTE5MTExMjAyMjQ0NVoXDTIwMTExMTAyMjQ0NVowPTEL
MAkGA1UEBhMCQ04xCzAJBgNVBAgMAkNEMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRn
@CandyMi
CandyMi / docker-compose.yml
Last active June 26, 2024 11:14
OpenSearch 实例
version: '3'
services:
opensearch-node: # This is also the hostname of the container within the Docker network (i.e. https://opensearch-node1/)
image: opensearchproject/opensearch:2 # Specifying the latest available image - modify if you want a specific version
container_name: opensearch-node
environment:
- cluster.name=opensearch-cluster # Name the cluster
- node.name=opensearch-node # Name the node that will run in this container
- bootstrap.memory_lock=true # Disable JVM heap memory swapping
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # Set min and max JVM heap sizes to at least 50% of system RAM
@CandyMi
CandyMi / README.md
Last active April 30, 2024 05:43
中宣接口示例代码

中宣接口加密解密测试代码

@CandyMi
CandyMi / README.md
Last active March 15, 2024 10:17
在 WSL2 中安装 Docker

在 WSL2 中安装 Docker

安装

使用 WSL2 时,可以按照官方说明安装 Docker, 安装 Docker 后只需运行 sudo service docker start 启动 Docker

问题

但是你使用 Debian 12WSL2 中安装 Docker 时,会发现运行 sudo service docker start 命令后 Docker 依旧无法启动。

@CandyMi
CandyMi / OSSL_SPEED.md
Last active December 8, 2023 03:46
AES vs SM4

CPU

Intel i5-10400 AES-NI

命令

openssl speed -evp 算法名(aes-256-cbc)

结果

@CandyMi
CandyMi / CMakeLists.txt
Last active March 14, 2024 08:25
Build lua from cmake
cmake_minimum_required(VERSION 2.8...3.12)
project(lua)
# Lua 头文件
set(LIBLUA_INCLUDE lua.h luaconf.h lualib.h lauxlib.h lua.hpp)
file(GLOB LUA_SOURCES lua.c)
file(GLOB LUAC_SOURCES luac.c)
file(GLOB LIBLUA_SOURCES l*.c)