Skip to content

Instantly share code, notes, and snippets.

View czyt's full-sized avatar
🍒
Working as a Coder

虫子樱桃 czyt

🍒
Working as a Coder
View GitHub Profile
@czyt
czyt / Cloudflare Tunnel Setup.md
Created January 15, 2025 05:59 — forked from obrassard/Cloudflare Tunnel Setup.md
This quick guide will help you set up a Cloudflare Tunnel on your Linux server

Cloudflare Tunnel Setup on Linux

This quick guide will help you set up a Cloudflare Tunnel on your Linux server !

Cloudflare Tunnel provides you with a secure way to connect your resources to the web without a publicly routable IP address. With Tunnel, you do not send traffic to an external IP, instead, a lightweight daemon in your infrastructure (cloudflared) creates outbound-only connections to Cloudflare’s edge. Cloudflare Tunnel can connect HTTP web servers, SSH servers, remote desktops, and other protocols safely to Cloudflare. This way, your origins can serve traffic through Cloudflare without being vulnerable to attacks that bypass Cloudflare. (Source)

Getting Started

Pre-requisites

#!/bin/bash
# 生成随机ID
generate_machine_id() {
openssl rand -hex 32
}
generate_device_id() {
# 使用openssl生成UUID v4
openssl rand -hex 16 | awk '{print substr($0,1,8) "-" substr($0,9,4) "-4" substr($0,14,3) "-" substr($0,17,4) "-" substr($0,21,12)}'
@czyt
czyt / setting.json
Created July 25, 2024 16:29
my zed full config
{
// The name of the Zed theme to use for the UI.
//
// `mode` is one of:
// - "system": Use the theme that corresponds to the system's appearance
// - "light": Use the theme indicated by the "light" field
// - "dark": Use the theme indicated by the "dark" field
"theme": {
"mode": "system",
"light": "One Light",
@czyt
czyt / domains.txt
Last active February 11, 2025 12:07
https://jixingwangluo.top/
https://user.susucloud.net/
https://www.02er.com/
https://wymv.top/
https://zhuiyun.top/
https://jichang.jinsanjiaohs.com/
https://jindouyun88.life/
https://vb.cx100.top/
https://chinayyds.xyz/
https://cloud.yydschina.top/
@czyt
czyt / ms-edge-tts-api.md
Created January 17, 2024 05:14 — forked from wilinz/ms-edge-tts-api.md
微软edge-tts-api(大声朗读协议)
@czyt
czyt / systemenv.cs
Created July 19, 2023 13:45
write app current working dir to windows system Path
using System;
using System.Security.Principal;
namespace AddCurrentDirToPath
{
internal class Program
{
const string envPathKey = "Path";
public static bool IsAdministrator()
{
@czyt
czyt / default.custom.yaml
Created June 8, 2023 08:41 — forked from lewangdev/default.custom.yaml
雾凇拼音自定义配置,MacOS-like & Wechat-like Dark/Light Color Scheme For Rime
patch:
# 菜单
menu:
page_size: 8 # 候选词个数
# alternative_select_labels: [ ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩ ] # 修改候选项标签
# alternative_select_keys: ASDFGHJKL # 如编码字符占用数字键,则需另设选字键
# ascii_mode、inline、no_inline、vim_mode 等等设定,可参考 /Library/Input Methods/Squirrel.app/Contents/SharedSupport/squirrel.yaml
# 中西文切换
#
# 【good_old_caps_lock】 CapsLock 切换到大写或切换中英。
@czyt
czyt / README.md
Created January 1, 2023 02:41 — forked from acmacalister/README.md
WebSocket through Cloudflare Access

Overview

These are instructions on setting up Access in front of a origin serving WebSockets. This example contains client code for a client that authenticates through Access using mTLS.

Access

In the Cloudflare Dashboard, configure an Access policy that contains a service token. The developer docs has steps on how to do this:

https://developers.cloudflare.com/access/service-auth/mtls-testing/

@czyt
czyt / cloudflaretool.go
Last active September 19, 2022 16:54
cloudflare ddns and pages deploy cleaner&helper
package main
import (
"context"
"encoding/json"
"errors"
"fmt"
"github.com/cloudflare/cloudflare-go"
"io"
"log"
@czyt
czyt / autocert.go
Created August 4, 2022 05:17 — forked from NHOrus/autocert.go
Currently cobbled autocerted file server thingy
package main
import (
"crypto/tls"
"fmt"
"golang.org/x/crypto/acme/autocert"
"io"
"log"
"net/http"
"time"