Skip to content

Instantly share code, notes, and snippets.

View BlakeLiAFK's full-sized avatar
👾
🧡🧡🧡🧡🧡🧡💛💛💛

Blake Li BlakeLiAFK

👾
🧡🧡🧡🧡🧡🧡💛💛💛
View GitHub Profile
@BlakeLiAFK
BlakeLiAFK / o2outer-model-limits-template.json
Last active May 10, 2025 12:31
o2outer-model-limits-template
{
"ai.dev": {
"models": {
"gemini-2.5-flash-preview-04-17": {
"rpm": 10,
"tpm": 250000,
"rpd": 500
},
"gemini-2.5-pro-preview-05-06": {
"rpm": 5,
@BlakeLiAFK
BlakeLiAFK / openwrt-in-docker.md
Created November 19, 2023 14:51 — forked from mcxiaoke/openwrt-in-docker.md
Run OpenWrt in Docker

OpenWrt Docker镜像构建

为了在Docker中运行OpenWrt系统,我们需要用到OpenWrt的docker镜像,网上有很多人分享已经制作好的镜像。但是,每个人都有自己不同的需求,自己学会制作镜像就显得特别重要了。

其实使用OpenWrt的固件, 可以很方便的构建Docker镜像,这里的固件不光是官方固件,也可以是经过自己定制编译生成的固件。

直接使用

package main
import (
"context"
"github.com/awa/go-iap/playstore"
"github.com/gin-gonic/gin"
"github.com/gorilla/websocket"
"google.golang.org/api/androidpublisher/v3"
"io/ioutil"
"net/http"
@BlakeLiAFK
BlakeLiAFK / rpc-tls-client.go
Created July 23, 2020 15:37 — forked from artyom/rpc-tls-client.go
Go RPC over TLS.You have to create the following keys: certs/client.crt, certs/client.key, certs/server.crt, certs/server.key. client.crt and server.crt should be signed with ca.crt, which should be concatenated to both client.crt and server.crt. It's easier to do with easy-rsa: http://openvpn.net/index.php/open-source/documentation/howto.html#pki
package main
import (
"crypto/tls"
"crypto/x509"
"log"
"net/rpc"
)
func main() {
@BlakeLiAFK
BlakeLiAFK / UnityWebRequestCachingExtensions.cs
Created April 2, 2020 02:58
Unity基于Etag的缓存下载器
using UnityEngine;
using System.Collections;
using UnityEngine.Networking;
using System.IO;
using System;
using System.Security.Cryptography;
using System.Text;
using UnityEngine.UI;
using System.Collections.Generic;
@BlakeLiAFK
BlakeLiAFK / ToastText.cs
Created July 14, 2019 14:13
UnityDoTween显示Toast
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
[RequireComponent(typeof(Text))]
public class ToastText : MonoBehaviour {
void FlyTo(Graphic graphic) {
RectTransform rt = graphic.rectTransform;
var originPositon = rt.localPosition;
Color c = graphic.color;
@BlakeLiAFK
BlakeLiAFK / net.sh
Created June 25, 2019 03:25
监控linux流量脚本
#!/bin/bash
export LANG="en_US.UTF-8"
#export LANG="zh_CN.UTF8"
[ -f /etc/rc.d/init.d/functions ] && source /etc/rc.d/init.d/functions
[ -f /etc/profile ] && . /etc/profile
[ -f ~/.bash_profile ] && . ~/.bash_profile
ethn=$1
while true
do
RX_pre=$(cat /proc/net/dev | grep $ethn | sed 's/:/ /g' | awk '{print $2}')
@BlakeLiAFK
BlakeLiAFK / update_ip.sh
Created June 14, 2019 10:08
CloudFlareDDNS
#!/bin/sh
zid="<Zone ID>"
domain="<Your Domain>"
key="<Your Key>"
mail="<Your Account Mail>"
#option
#did="<domain id>"
#get domain id
@BlakeLiAFK
BlakeLiAFK / RateLimiting.md
Last active August 11, 2023 13:21
GolangRateLimiting

###QPS控制,10 QPS

通过Ticker触发消息,达到流控目的

import "time"

rate := time.Second / 10
throttle := time.Tick(rate)
for req := range requests {
 &lt;-throttle // rate limit our Service.Method RPCs
@BlakeLiAFK
BlakeLiAFK / README-Template.md
Created December 7, 2018 10:02 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites