Skip to content

Instantly share code, notes, and snippets.

View lewangdev's full-sized avatar
🐢
Running

LE lewangdev

🐢
Running
View GitHub Profile
@lewangdev
lewangdev / convert-mkv-to-mp4.sh
Last active June 30, 2023 06:33
Convert mkv to mp4 in h264 and aac
#!/bin/bash
if [ -z "$1" ]
then
echo "Please provide the directory as an argument."
exit 1
fi
for file in "$1"/*.mkv
do
@lewangdev
lewangdev / Step-1.js
Last active July 3, 2023 13:17
Get Twitter followings and add them to your private list
(function(window) {
function saveAsLocalStorage(username) {
// 将 Set 转换为 Array
let followerIdsArray = Array.from(followerIds);
// 存储到localStorage
localStorage.setItem('MyFollowingIds', JSON.stringify(followerIdsArray));
}
function saveAsCSV(username) {
@lewangdev
lewangdev / edge_tts_voices.py
Created October 24, 2023 14:13
Get Edge TTS Voice Name List
import asyncio
from edge_tts import list_voices
async def print_voices() -> None:
"""Print all available voices."""
voices = await list_voices()
voices = sorted(voices, key=lambda voice: voice["ShortName"])
print("| Name | Gender | Language |")
print("| :--- | :----- | :--------|")
@lewangdev
lewangdev / openai-api.conf
Created November 11, 2023 13:20
nginx proxy for openai api
server {
listen 80;
server_name openai-api.xxx.link;
error_log /var/log/nginx/openai-api/nginx-error.log;
access_log /var/log/nginx/openai-api/nginx-access.log main;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
@lewangdev
lewangdev / add-public-keys.md
Last active November 21, 2023 10:07
how-to-add-ssh-public-keys

推荐 通过 ssh-import-id 命令导入 ssh 公钥

$ sudo apt install -y ssh-import-id
$
$ ssh-import-id-gh lewangdev
2023-11-21 09:29:24,308 INFO Authorized key ['2048', 'SHA256:Pu/8zz7rT6zKH0aklqk+7j1XNqAfB7COIan4Kryo3+Y', 'lewangdev@github/8809471', '(RSA)']
2023-11-21 09:29:24,313 INFO Authorized key ['3072', 'SHA256:2/aQDHc+ULG3moyvTr9h3702Btb49I5Y3UGKf7kqJRI', 'lewangdev@github/61522538', '(RSA)']
2023-11-21 09:29:24,318 INFO Authorized key ['256', 'SHA256:oLZ91UAqwhQgnb7wC+NrgEAYq+sxg9xmLCrI6t+N93M', 'lewangdev@github/66075094', '(ED25519)']
2023-11-21 09:29:24,323 INFO Authorized key ['256', 'SHA256:ymuGSnvAOSrJylWtaFVVGARv+AcsKnrG+B3HHptXews', 'lewangdev@github/75841698', '(ED25519)']
2023-11-21 09:29:24,324 INFO [4] SSH keys [Authorized]
@lewangdev
lewangdev / install-docker-ce-aliyun-debian.md
Last active June 4, 2025 16:04
在阿里云中国大陆机房的Debian系统上安装Docker服务和拉取dockerhub镜像

安装 docker-ce

# https://developer.aliyun.com/article/110806
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc