diff --git a/debian-cpu-benchmark/bench.csv b/debian-cpu-benchmark/bench.csv new file mode 100644 index 0000000..8b5fcc2 --- /dev/null +++ b/debian-cpu-benchmark/bench.csv @@ -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 diff --git a/linux-bash/bash_aliases.sh b/linux-bash/bash_aliases.sh index 8a931d1..9da72a8 100644 --- a/linux-bash/bash_aliases.sh +++ b/linux-bash/bash_aliases.sh @@ -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 diff --git a/wireguard/wg-conf.py b/wireguard/wg-conf.py new file mode 100755 index 0000000..2ee30fc --- /dev/null +++ b/wireguard/wg-conf.py @@ -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))