Skip to content

Instantly share code, notes, and snippets.

@hongyegb123
hongyegb123 / epub-to-txt.py
Created May 8, 2025 06:33 — forked from robmcelhinney/epub-to-txt.py
Convert epub to a .txt file
import os
from pathlib import Path
import ebooklib
from ebooklib import epub
from bs4 import BeautifulSoup
import argparse
# https://medium.com/@zazazakaria18/turn-your-ebook-to-text-with-python-in-seconds-2a1e42804913
blocklist = ['[document]', 'noscript', 'header', 'html', 'meta', 'head', 'input', 'script']
@hongyegb123
hongyegb123 / openssl_tool.txt
Last active December 27, 2024 06:02 — forked from jorben/openssl_tool.txt
RSA加解密,签名、验签文件
Ed25519
1) Generate Ed25519 key:
openssl genpkey -algorithm ed25519 -out key.pem
openssl pkey -in key.pem -text -noout
2) Save public key in pub.pem file:
openssl pkey -in key.pem -pubout -out pub.pem
@hongyegb123
hongyegb123 / Resize-LVM.md
Created August 10, 2023 13:59 — forked from cleanunicorn/Resize-LVM.md
How to extend an LVM partition to use the available disk space.

Tell LVM to resize to the physical partition size.

$ sudo pvresize /dev/sda3

Find the actual path of the LVM logical volume. The LV Path is the value needed.

@hongyegb123
hongyegb123 / rsa_util.go
Created May 24, 2023 09:19 — forked from miguelmota/rsa_util.go
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
@hongyegb123
hongyegb123 / 0-go-os-arch.md
Created June 25, 2022 17:54 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android

mTLS 配置

对于mTLS的配置的证书来说,有如下的提示。

  • 三个文件。 对于大多数系统,如:MySQL, Redis,PostgreSQL。会需要三个文件:CA证书 + CERT 和 KEY。可以在我的这个开源项目(https://github.com/haoel/mTLS/tree/main/certs )中找到我生成的CA,以及 Server 和 Client的 .crt.key 文件。生成的方法也在我的那个开源项目中了。

  • 两个文件。 对于有的系统,比如:MongoDB,他只要两个文件,一个是CA,一个是 pem 文件,对于pem文件,你可以直接把上面的 .crt 和 .key 合并了就好了。如:cat server.crt server.key > server.pem

  • JKS文件。 对于一些系统,比如:Kafka 和 Zookeeper。他要的不是上面的明文的格式,他要的是一种jks的格式,这是Java的格式。怎么从上面的明文的方式转到jks的文件。需要经过下面几步。

@hongyegb123
hongyegb123 / nf_check.js
Created February 28, 2022 10:37 — forked from Hyseen/nf_check.js
Netflix 解锁检测模块
/**
*
* [Panel]
* nf_check = script-name=nf_check, title="Netflix 解锁检测", content="请刷新", update-interval=1
*
* [Script]
* nf_check = type=generic, script-path=https://gist.github.com/Hyseen/b06e911a41036ebc36acf04ddebe7b9a/raw/nf_check.js?version=1633074636264, argument=title=Netflix 解锁检测
*
* 支持使用脚本使用 argument 参数自定义配置,如:argument=key1=URLEncode(value1)&key2=URLEncode(value2),具体参数如下所示,
* title: 面板标题
@hongyegb123
hongyegb123 / JsonPlistConverter.py
Created January 22, 2022 04:54 — forked from pokstad/JsonPlistConverter.py
Convert between JSON and Plist Files
#!/usr/bin/env python
import plistlib
import json
import tkFileDialog
import re
import sys
file_to_open = tkFileDialog.askopenfilename(message="Select an existing plist or json file to convert.")
converted = None
@hongyegb123
hongyegb123 / .gitignore
Created November 10, 2021 05:02 — forked from smoser/.gitignore
cloud-init ubuntu nocloud example with network config
*.img
*.raw