Skip to content

Instantly share code, notes, and snippets.

View bxb100's full-sized avatar
😭
R.I.P, My friends

Lemon bxb100

😭
R.I.P, My friends
View GitHub Profile
@bxb100
bxb100 / execute.cmd
Last active March 13, 2022 17:12
Parse html page gets m3u8 link then using N_m3u8DL-CLI to download video
@echo off
setlocal EnableDelayedExpansion
echo ================[ Getting web page ]================
set URL=%1
if NOT "%URL:~-1%" == "/" (
set URL="%URL%/"
)
echo 'url: %URL%'
for /f "tokens=4 delims=/" %%a in ("%URL%") do (
@bxb100
bxb100 / log.md
Last active May 23, 2022 14:18
记一次 windows docker 安装 ES 8.x 问题汇总

max_map_count 过小无法启动

  • 使用 .wslconfig 来控制 wsl 的内存大小[^1]
  • 然后 wsl --shutdown 使其生效
  • 进入 wsl 容器后调整 vm.max_map_count=262144, 详细命令是 sudo sysctl -w vm.max_map_count=262144 注意不要 sudo vim 那是没用的.[^3]

8.x 默认 ssl

  • Docker 中使用 cp 复制 /usr/share/elasticsearch/config/certs/http_ca.crt 然后移入受信任的根证书颁发机构[^2]
@bxb100
bxb100 / EmbySetting.css
Last active February 8, 2022 17:17
simple beautify
.cardImageContainer {
background-size: cover;
}
.paper-icon-button-img {
object-fit: cover;
max-height: 1.72em;
}
.fldImage img {
height: 103px;
object-fit: cover;
@bxb100
bxb100 / SearchImageByGoogle.sh
Last active November 6, 2022 09:39
DropOver 脚本
#!/usr/bin/env bash
regex='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
for var in "$@"
do
files="encoded_image=@$var"
# if this is a gif, get the first frame
if [[ $var =~ \.(gif|mp4)$ ]]; then
tempfile="$TMPDIR$(uuidgen).jpg";
@bxb100
bxb100 / searchImageByGoogleLens.sh
Last active January 25, 2022 09:16
Dropover action script
#!/usr/bin/env bash
timestamp() {
date +%s
}
regex='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
for var in "$@"
do
timestamp=$(timestamp)
SHOW FULL PROCESSLIST;

SHOW ENGINE INNODB STATUS;

8.x

The data_locks table shows data locks held and requested [^1][^2]

@bxb100
bxb100 / checkPortUsingInWindows.md
Last active April 16, 2022 14:16
检查 windows 端口占用
  • 查找所有运行的端口 netstat -ano
  • 查看被占用端口对应的 PID netstat -aon|findstr "8081" 最后一位数字就是 PID, 这里假定为 9088
  • 查看指定 PID 的进程 tasklist|findstr "9088"
  • 结束进程, 强制(/F参数)杀死 pid 为 9088 的所有进程包括子进程(/T参数) taskkill /T /F /PID 9088

当然最方便的还是用 TcpView


@bxb100
bxb100 / regex.md
Last active April 16, 2022 14:17
常见的正则
限制输入字符串规则:
1.仅支持输入中英文 数字 连字符- 空格字符
2.且不能全为空格字符
  1. ^(?!\s+$)[0-9a-zA-Z\\u4e00-\\u9fa5\-\s]+$
  2. ^[\u4e00-\u9fa5\d\w- ]*[\u4e00-\u9fa5\d\w-]+[\u4e00-\u9fa5\d\w- ]*$
  3. ^(?=[ ]*[\S]+)[\u4E00-\u9FFF0-9a-zA-Z- ]+$

@bxb100
bxb100 / JsonUtil.java
Last active April 30, 2022 06:56
Jackson 常用 #java #jackson
package com.pers.telegram.util;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;