Skip to content

Instantly share code, notes, and snippets.

View nirui's full-sized avatar
Slow to respond

R+ nirui

Slow to respond
View GitHub Profile
This file has been truncated, but you can view the full file.
f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAASGi9AAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAOAAD
AAAAAAAAAAEAAAAGAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAABAAAAAAAACAw18AAAAAAAAQ
AAAAAAAAAQAAAAUAAAAAAAAAAAAAAADQnwAAAAAAANCfAAAAAACIrB0AAAAAAIisHQAAAAAAABAA
AAAAAABR5XRkBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAA
AAAAAOftKS1VUFghSBQOFgAAAACYQF0ACLItAJABAAB+AAAADgAAADwHAD+RRYRgEAcAGsAnsUct
V57kl3LFwXr4KAPQKVhzcczJalhfJR8SSxfRTN9xgCq0XkOl2EE9SE+AdFWY6XoTIjXkEJNrodVe
TyfQF/lWhIyywkX4zRbSq9D8rloaZHljMo0zqS2wSbzapcp/fccnPCSjIQrmP3/JGN8pLtYALAD5
KA0ADkkqADwHAABuWEgsKe8XmJTShnuvLNb/caDbBs3dmPb4MAaMDngoz+18BKkhpDFx4Av7XZG1
bJwZb8MczF4QMlYjaOr3FtcKDECYjJu+pC3ar2qxOm4/Bg03aGzGolf5YwLGYlkwutGNvnOrjqcB
EiWFakpULvmnPavvwpAr2pY8sMHmnbe4TpsjYHak5nmPWW1a1mp7pqb964xqWldlvmCgdcIYB7vU
# Modified based on https://blog.creekorful.com/2019/10/how-to-install-traefik-2-docker-swarm/
# Hope it helps :)
version: '3'
services:
reverse-proxy:
image: traefik:v2.4.3
command:
// This program and script allows you to map the dns request to [domain].<lan-hostname>.svc.lan to <lan-hostname>.
//
// 1. Setup the OpenWrt. File /etc/config/dhcp
//
// config dnsmasq
// ....
// list server '/svc.lan/127.0.0.1#5333'
// list rebind_domain 'svc.lan'
//
// 2. Init.d Script: /etc/init.d/dnsf.sh
package main
import "testing"
import "sync"
type obj struct {
test string
}
type obj2 struct {

Keybase proof

I hereby claim:

  • I am nirui on github.
  • I am nirui (https://keybase.io/nirui) on keybase.
  • I have a public key whose fingerprint is B412 2F2C 5F8F 6807 43C3 273B 82AE 11AD 1E5E 8729

To claim this, I am signing this object:

package main
import (
"crypto/aes"
"crypto/cipher"
"fmt"
)
func decrypt(key, nonce, buf []byte, bufPadLength int) {
block, err := aes.NewCipher(key[:])
@nirui
nirui / To Deploy A Proxy.md
Last active October 5, 2024 12:48
To deploy a proxy

To deploy a proxy

Copyright (C) 2020 RUI Ni ([email protected])

This is a document on how to depoly a reasonably secured proxy server which is capable of relaying non-critical communications and few other tasks.

Given the fact that this document is largely a personal note and memo, information and method provided in this document may NOT be useful for your use case. Do NOT follow the content if you don't fully understand the information and instruction.

The document also assumes the reader has decent amont of knownledge about Linux server. Because of that, step-by-step guide will not be provided, the reader must install and fine tune the softwares by themselves.

#!/bin/bash
TEST_TARGET=$1
RECOVER_COMMANDS=("${@:2}")
while true; do
for RECOVER_CMD in "${RECOVER_COMMANDS[@]}"; do
while true; do
sleep 1
package main
import (
"testing"
"time"
)
func BenchmarkTimeNow(b *testing.B) {
for i := 0; i < b.N; i++ {
time.Now()
package main
import (
"crypto/rand"
"testing"
)
var sample = makeSample()
const sampleSize = 4096