Skip to content

Instantly share code, notes, and snippets.

View caryyu's full-sized avatar
😀
Welcome to AMA!

: ask me anything :) caryyu

😀
Welcome to AMA!
View GitHub Profile
@caryyu
caryyu / 404.html
Created November 15, 2022 12:22
HTML Common Templates
<!DOCTYPE html><html lang="en"><head><style type="text/css">*{transition: all 0.6s;}html {height: 100%;}body{font-family: 'Lato', sans-serif;color: #888;margin: 0;}#main{display: table;width: 100%;height: 100vh;text-align: center;}.fof{display: table-cell;vertical-align: middle;}.fof h1{font-size: 50px;display: inline-block;padding-right: 12px;animation: type .5s alternate infinite;}@keyframes type{from{box-shadow: inset -3px 0px 0px #888;}to{box-shadow: inset -3px 0px 0px transparent;}}</style></head><body><div id="main"><div class="fof"><h1>Oops, (-4o4-) Not Found.</h1></div></div></body></html>
@caryyu
caryyu / On-Alicloud.md
Created November 5, 2022 12:24
Using Certbot to create HTTPS certificates

Ensure the domain resolution is managed by the alicloud.

Create

docker run -it --rm \
-e "ALIYUN_AK=<access_key>" \
-e "ALIYUN_SK=<secret_key>" \
-e "EMAIL=<contact email>" \
-v /var/local/certs:/etc/letsencrypt acbig/certbot-dns-aliyun:1.0.0 obtain_cert \
@caryyu
caryyu / main.go
Created September 30, 2021 05:21
Algorithm of mergesort
package main
import "fmt"
func main() {
var nums []int = []int{10, 7, 8, 1, 4, 3}
topDownMergesort(nums)
fmt.Println(nums)
}
@caryyu
caryyu / main.go
Created September 26, 2021 10:01
Algorithm of Shellsort
package main
import "fmt"
func main() {
var nums []int = []int{3, 2, 1, 2, 5, 9, 8, 6, 7}
shellsort(nums)
fmt.Println(nums)
}
@caryyu
caryyu / main.go
Created September 24, 2021 07:52
Algorithm of Heapsort
package main
import "fmt"
func main() {
var nums []int = []int{57, 40, 38, 11, 13, 34, 48, 75, 6, 19, 9, 7}
heapsort(nums)
fmt.Println(nums)
}
@caryyu
caryyu / main.go
Last active October 18, 2021 04:00
Algorithm of QuickSort
package main
import "fmt"
func main() {
var nums []int = []int{6, 1, 2, 7, 9, 3, 4, 5, 10, 8}
quicksort(nums, 0, len(nums)-1)
fmt.Println(nums)
}
@caryyu
caryyu / README.md
Created February 7, 2021 10:20
Lark notification in Jenkinsfile

Script

Please use the script below as a shell command and save to /usr/local/bin/lark in the execution environment

#!/usr/bin/env bash

action=$1
url=$2
@caryyu
caryyu / readme.md
Last active January 29, 2021 10:13
Docker Desktop Port-Forwarding
  • Docker

docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 0.0.0.0:1234:1234 bobrik/socat TCP-LISTEN:1234,fork UNIX-CONNECT:/var/run/docker.sock

  • Kubernetes

docker run -d -p 0.0.0.0:6444:6443 bobrik/socat TCP-LISTEN:6443,fork TCP:docker-desktop:6443

  • Nginx Stream Proxy
@caryyu
caryyu / outline.md
Last active November 8, 2020 04:18
Bit Torrent Learning Routes
  • Basic Network
    • TCP/IP
    • UDP vs uTP
  • P2P Network
    • STUN Server - NAT Traversal
    • Turn Server
    • UPnP Protocol
    • WebRTC
  • Bit Torrent BEP 0003 - Foundation
  • Bit Torrent BEP 0005 - DHT
@caryyu
caryyu / Docker 中文语言包
Created September 23, 2020 07:25
Ubuntu 相关记录
FROM scottyhardy/docker-wine:latest
RUN apt-get update && apt-get -y install \
locales \
language-pack-zh-hans \
fonts-droid-fallback \
ttf-wqy-zenhei \
ttf-wqy-microhei \
fonts-arphic-ukai \
fonts-arphic-uming