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 / 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"
)
@czyt
czyt / get_go.sh
Created June 2, 2021 13:14 — forked from Zate/get_go.sh
Shell script to download and install latest golang
#! /bin/bash
# [get_golang.sh](https://gist.github.com/n8henrie/1043443463a4a511acf98aaa4f8f0f69)
# Download latest Golang release for AMD64
# https://dl.google.com/go/go1.10.linux-amd64.tar.gz
set -euf -o pipefail
# Install pre-reqs
sudo apt-get install python3 git -y
o=$(python3 -c $'import os\nprint(os.get_blocking(0))\nos.set_blocking(0, True)')