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

@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 / 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 / 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"
@czyt
czyt / dial-mysql-via-ssh.go
Created March 8, 2022 15:19 — forked from vinzenz/dial-mysql-via-ssh.go
Using MySQL / MariaDB via SSH in Golang
package main
import (
"database/sql"
"fmt"
"net"
"os"
"github.com/go-sql-driver/mysql"
"golang.org/x/crypto/ssh"
@czyt
czyt / dial-pq-via-ssh.go
Created March 8, 2022 15:19 — forked from vinzenz/dial-pq-via-ssh.go
Use postgres via SSH in Golang
package main
import (
"database/sql"
"database/sql/driver"
"fmt"
"net"
"os"
"time"

WARNING: interfaces can enumarate differently:

ufw status
#iptables -F
#iptables --table nat --append POSTROUTING --out-interface wlxe0b94db737c9 -j MASQUERADE
#iptables --table nat --append POSTROUTING --out-interface enp0s20u1u1 -j MASQUERADE
iptables --table nat --append POSTROUTING --out-interface enp0s20u1u2 -j MASQUERADE
#iptables --append FORWARD --in-interface enx1cba8c9bbeb5 -j ACCEPT
#iptables --append FORWARD --in-interface enx9884e391a556 -j ACCEPT
iptables --append FORWARD --in-interface enx9884e391a559 -j ACCEPT
@czyt
czyt / custom.css
Created September 26, 2021 05:14 — forked from MitaZ/custom.css
V2EX Custom CSS
/* https://www.v2ex.com/settings */
/* 使用圆角头像 */
img.avatar {
border-radius: 100%;
}
/* 设定顶部栏颜色 */
body,#Top,#Bottom {
background-color:#2b2f3e;
}
/* 设定链接颜色 */
@czyt
czyt / TinyGoGoRoutine.go
Created July 23, 2021 07:29 — forked from tzechienchu/TinyGoGoRoutine.go
Test TinyGo goroutine on wio terminal
package main
import (
"fmt"
"machine"
"math/rand"
"sync"
"time"
)