Skip to content

Instantly share code, notes, and snippets.

View Wang-Kai's full-sized avatar
💭
Happy

Kai Wang-Kai

💭
Happy
View GitHub Profile
@mowings
mowings / readme.md
Last active October 9, 2022 07:36
kuberetes etcd metrics or api calls with curl
curl --cacert /etc/kubernetes/pki/etcd/ca.crt \
    --cert /etc/kubernetes/pki/etcd/peer.crt \
    --key /etc/kubernetes/pki/etcd/peer.key \
    https://localhost:2379/metrics
@Wang-Kai
Wang-Kai / ladon_vs_casbin.md
Last active January 15, 2025 12:26
ladon & casbin 两个 authorization 库的比较

通览了 casbin 的文档,结合先前对 AWS IAM 的理解,以及对 ladon SDK 的使用,总结对比一下 Ladon & Casbin 两个授权库。

1. 项目定位

先对比两个项目的简介:

ladon

A SDK for access control policies: authorization for the microservice and IoT age. Inspired by AWS IAM policies. Written for Go.

@josue
josue / server.go
Last active August 4, 2023 21:23
Simple Golang HTTP server with signal capturing (ie: SIGINT/SIGTERM) & pprof debugger
/*
go build for linux:
env GOOS=linux go build -o /tmp/server server.go
run with docker:
docker run -it --rm --name test -v /tmp/server:/server -p 3000:80 -p 3001:6060 alpine /server
run pprof debugger:
go get github.com/google/pprof
pprof --seconds 30 -http=:4444 /tmp/server http://localhost:3001/debug/pprof/profile

Hub as a Gateway

Miners are required to have a public IP address and a properly configured firewall to make all things work properly. But sometimes it is not possible due to either security, privacy or provider limitations. This also includes miners behind the NAT.

To be able to work with these miners a Hub can be configured as a gateway.

Note: we assume that it is possible to build a private network between Hub and miners.

NAT

@nikhita
nikhita / update-golang.md
Last active March 6, 2025 20:06
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@reachlin
reachlin / prometheus.yml
Created April 19, 2017 07:06
sample prometheus configuration explained
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: