merge
This commit is contained in:
9
debian-cpu-benchmark/bench.csv
Normal file
9
debian-cpu-benchmark/bench.csv
Normal file
@@ -0,0 +1,9 @@
|
||||
0,1,2
|
||||
1,4014.52,4014.52
|
||||
2,7866.07,3933.035
|
||||
3,10550.74,3516.9133333333334
|
||||
4,14024.92,3506.23
|
||||
5,14161.24,2832.248
|
||||
6,14438.38,2406.3966666666665
|
||||
7,14620.7,2088.671428571429
|
||||
8,14785.37,1848.17125
|
||||
|
@@ -14,6 +14,7 @@ export LLAMA_ARG_CTX_SIZE=65536
|
||||
# export LC_ALL=C.UTF-8
|
||||
|
||||
|
||||
alias rerun="docker compose down && docker compose up -d --build && docker compose logs -f"
|
||||
export PATH="/usr/local/bin:/home/w/.cache/ms-playwright/chromium-1129/chrome-linux:$PATH"
|
||||
export OLLAMA_HOST=host.docker.internal:11434
|
||||
|
||||
|
||||
47
wireguard/wg-conf.py
Executable file
47
wireguard/wg-conf.py
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess, textwrap
|
||||
|
||||
|
||||
def bash(command, input=None):
|
||||
return subprocess.run(
|
||||
command, shell=True, input=input, capture_output=True, text=True
|
||||
)
|
||||
|
||||
|
||||
def keygen():
|
||||
privatekey = bash("wg genkey").stdout.strip()
|
||||
publickey = bash("wg pubkey", privatekey).stdout.strip()
|
||||
return {"private": privatekey, "public": publickey}
|
||||
|
||||
|
||||
def server_conf(server, clients, server_port=51820):
|
||||
return textwrap.dedent(
|
||||
f"""
|
||||
# server.conf
|
||||
|
||||
[Interface]
|
||||
PrivateKey = {server['private']}
|
||||
Address = 10.0.0.1/24
|
||||
ListenPort = {server_port}
|
||||
"""
|
||||
+ "".join(
|
||||
f"""
|
||||
[Peer]
|
||||
PublicKey = {client['public']}
|
||||
AllowedIPs = 10.0.0.{idx+2}/32
|
||||
"""
|
||||
for idx, client in enumerate(clients)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
# def client_conf(server_key, client_key, server_ip, server_port=51820):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
assert bash("wg -v").returncode == 0
|
||||
server = keygen()
|
||||
clients = [keygen() for _ in range(2)]
|
||||
|
||||
print(server_conf(server, clients))
|
||||
Reference in New Issue
Block a user