Skip to content

Instantly share code, notes, and snippets.

@cntoby
cntoby / docker-registry-mirrors.md
Created September 30, 2024 00:22 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@cntoby
cntoby / url
Created February 21, 2023 09:22
trojan://[email protected]:36116?allowInsecure=0&peer=jp01.abpilot.xyz&sni=jp01.abpilot.xyz#翻墙党fanqiangdang.com
trojan://[email protected]:36106?allowInsecure=0&peer=jp02.abpilot.xyz&sni=jp02.abpilot.xyz#翻墙党fanqiangdang.com
trojan://[email protected]:36111?allowInsecure=0&peer=jp03.abpilot.xyz&sni=jp03.abpilot.xyz#翻墙党fanqiangdang.com
vmess://eyJ2IjoiMiIsInBzIiA6Iue/u+WimeWFmmZhbnFpYW5nZGFuZy5jb20iLCIiIDoiXHVkODNjXHVkZGVmXHVkODNjXHVkZGY1XHU2NWU1XHU2NzJjMDQiLCJhZGQiOiIxajhwMDQuYWJ6b29uZXMueHl6IiwicG9ydCI6IjM2MTE2IiwiaWQiOiIwYzdkMTlhYi0xMzc2LTQ2ZDYtOGE2ZC04MWRkMWVmMzU1OTAiLCJhaWQiOiIwIiwibmV0IjoidGNwIiwidHlwZSI6Im5vbmUiLCJob3N0IjoiIiwicGF0aCI6IiIsInRscyI6InRscyIsInNuaSI6ImpwMDQuYWJwaWxvdC54eXoifQ==
vmess://eyJ2IjoiMiIsInBzIiA6Iue/u+WimeWFmmZhbnFpYW5nZGFuZy5jb20iLCIiIDoiXHVkODNjXHVkZGVmXHVkODNjXHVkZGY1XHU2NWU1XHU2NzJjMDUiLCJhZGQiOiIxajhwMDUuYWJ6b29uZXMueHl6IiwicG9ydCI6IjM2MTA2IiwiaWQiOiIwYzdkMTlhYi
@cntoby
cntoby / SpaceFn.json
Created November 4, 2021 05:28 — forked from tshu-w/SpaceFn.json
Karabiner Elements config to simulate SpaceLauncher
{
"title": "SpaceFN",
"rules": [
{
"description": "SpaceFN: Space enables SpaceFN mode (see: https://geekhack.org/index.php?topic=51069.0)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar"
@cntoby
cntoby / china-national-radio.m3u8
Created April 9, 2021 05:18 — forked from greenyleaf/china-national-radio.m3u8
China National Radio streams
#EXTM3U
#EXTINF:60,中国之声
#EXTVLCOPT:network-caching=1000
http://ngcdn001.cnr.cn/live/zgzs/index.m3u8
#EXTINF:60,中国之声 low resolution
#EXTVLCOPT:network-caching=1000
http://ngcdn001.cnr.cn/live/zgzs48/index.m3u8
#EXTINF:60,经济之声
#EXTVLCOPT:network-caching=1000
http://ngcdn002.cnr.cn/live/jjzs/index.m3u8
@cntoby
cntoby / serve.go
Created March 31, 2020 06:23 — forked from rivo/serve.go
Graceful stop and restart for HTTP servers in Go
package main
import (
"context"
"fmt"
"net"
"net/http"
"os"
"os/exec"
"os/signal"
@cntoby
cntoby / aes_encryption.go
Created November 5, 2019 05:50 — forked from stupidbodo/aes_encryption.go
AES Encryption Example in Golang
// Playbook - http://play.golang.org/p/3wFl4lacjX
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
@cntoby
cntoby / ecb.go
Created October 30, 2019 04:45 — forked from yinheli/ecb.go
golang 标准库不支持 AES/ECB/PKCS5Padding issues: https://code.google.com/p/go/issues/detail?id=5597 别人的补丁. https://codereview.appspot.com/7860047/
package main
import (
"crypto/cipher"
)
type ecb struct {
b cipher.Block
blockSize int
}
@cntoby
cntoby / deencrypt_3des.go
Created October 15, 2019 12:05 — forked from wklken/deencrypt_3des.go
3des: encrypt with python & deencrypt with golang
package main
// reference: https://golang.org/pkg/crypto/des/
// reference: http://blog.studygolang.com/2013/01/go%E5%8A%A0%E5%AF%86%E8%A7%A3%E5%AF%86%E4%B9%8Bdes/
import (
"crypto/cipher"
"crypto/des"
"encoding/base64"
"encoding/json"
@cntoby
cntoby / k8s-pi.md
Created July 5, 2019 12:52 — forked from aaronkjones/k8s-pi.md
K8s (v1.10.2) on Raspbian (April 2018)

Kubernetes on (vanilla) Raspbian Lite

Yes - you can create a Kubernetes cluster with Raspberry Pis with the default operating system called Raspbian. This means you can carry on using all the tools and packages you're used to with the officially-supported OS.

Pre-reqs:

  • You must use an RPi 2 or 3 for use with Kubernetes
  • I'm assuming you're using wired ethernet (Wi-Fi also works, but it's not recommended)
@cntoby
cntoby / osx_automount_nfs.md
Created June 21, 2019 12:17 — forked from L422Y/osx_automount_nfs.md
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service