export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"net" | |
) | |
func main() { | |
ln, err := net.Listen("tcp", ":8080") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile=cpu.out -memprofile=mem.out -trace=trace.out ./package | tee bench.txt | |
go tool pprof -http :8080 cpu.out | |
go tool pprof -http :8081 mem.out | |
go tool trace trace.out | |
go tool pprof $FILENAME.test cpu.out | |
# (pprof) list <func name> | |
# go get -u golang.org/x/perf/cmd/benchstat | |
benchstat bench.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
method=$1 | |
ss-tunnel -k test -m $method -l 8387 -L 127.0.0.1:8388 -s 127.0.0.1 -p 8389 & | |
ss_tunnel_pid=$! | |
ss-server -k test -m $method -s 127.0.0.1 -p 8389 & | |
ss_server_pid=$! | |
iperf -s -p 8388 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ciphers | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/sha512" | |
"crypto/x509" | |
"encoding/pem" | |
"log" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Automatic interactive installer for mtproto proxy https://github.com/seriyps/mtproto_proxy | |
# Supported OS: | |
# - Ubuntu 18.xx | |
# - Ubuntu 19.xx | |
# - Ubuntu 20.xx | |
# - Ubuntu 21.xx | |
# - Ubuntu 22.xx | |
# - Debian 11 bullseye | |
# - Debian 10 buster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Requires PInvoke.BCrypt | |
//Note that AES GCM encryption is included on .Net Core 3.0, but not in the full .Net framework. | |
//This implementation requires PInvoke.BCrypt, and reulies on the Windows CNG Bcrypt library which | |
//is available on Windows Vista or later. Note also the requirement for unsafe code. | |
//As coded requires VS 2015 / C#6 or above. | |
using System; | |
using PInvoke; | |
using static PInvoke.BCrypt; | |
using System.Security.Cryptography; |