nix

configuration files that power my machines
Log | Files | Refs | README | LICENSE

commit c9e14de156f61bd82a3a33370c4a71ebd803f250
parent 53e9847ca5c3abc5dd5b841c5773bcaa933a404d
Author: mtmn <miro@haravara.org>
Date:   Fri, 26 Jun 2026 16:30:10 +0200

bin: change iperf proof endpoint

Diffstat:
Mhosts/void/overlays/config/magdalena/config.json.nix | 0
Amodules/mixins/dotfiles/bin/iperf-mine | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dmodules/mixins/dotfiles/bin/iperf-ovh | 69---------------------------------------------------------------------
3 files changed, 71 insertions(+), 69 deletions(-)

diff --git a/hosts/void/overlays/config/magdalena/config.json.nix b/hosts/void/overlays/config/magdalena/config.json.nix Binary files differ. diff --git a/modules/mixins/dotfiles/bin/iperf-mine b/modules/mixins/dotfiles/bin/iperf-mine @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +set -euo pipefail + +SERVER=speedtest.lu.buyvm.net +PORT="5201" DURATION=60 STREAMS=5 ALL=0 LOGFILE="" + +usage() { + cat <<EOF +Usage: $0 [-p PORT] [-t SECONDS] [-P STREAMS] [-a] [-l FILE] [-h] + +iperf3 upload/download test against ${SERVER} (ports 5201-5210). + +Options: + -p PORT test a specific port (default: try 5201-5210 until one works) + -t SECONDS test duration in seconds (default: ${DURATION}) + -P STREAMS number of parallel streams (default: ${STREAMS}) + -a test all ports 5201-5210 + -l FILE pass --logfile FILE to iperf3 (appends iperf3 output to FILE) + -h show this help and exit +EOF +} + +[ $# -eq 0 ] && { + usage + exit 0 +} + +while getopts "p:t:P:al:h" o; do case "$o" in + p) PORT=$OPTARG ;; + t) DURATION=$OPTARG ;; + P) STREAMS=$OPTARG ;; + a) ALL=1 ;; + l) LOGFILE=$OPTARG ;; + h) + usage + exit 0 + ;; + *) + usage >&2 + exit 1 + ;; + esac done + +command -v iperf3 >/dev/null || { + echo "iperf3 not installed" >&2 + exit 1 +} + +LOG=() +[ -n "$LOGFILE" ] && LOG=(--logfile "$LOGFILE") + +test_port() { + echo "=== ${SERVER}:$1 (${DURATION}s, ${STREAMS} stream) ===" + echo "[download]" + iperf3 -c "$SERVER" -p "$1" -t "$DURATION" -P "$STREAMS" "${LOG[@]}" -R || return 1 + echo "[upload]" + iperf3 -c "$SERVER" -p "$1" -t "$DURATION" -P "$STREAMS" "${LOG[@]}" +} + +if [ "$ALL" = 1 ]; then + for p in $(seq 5201 5210); do test_port "$p" || true; done +elif [ -n "$PORT" ]; then + test_port "$PORT" +else + for p in $(seq 5201 5210); do + test_port "$p" && exit 0 + echo "port $p busy, trying next..." >&2 + done + echo "all ports busy/unreachable" >&2 + exit 1 +fi diff --git a/modules/mixins/dotfiles/bin/iperf-ovh b/modules/mixins/dotfiles/bin/iperf-ovh @@ -1,69 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -SERVER=proof.ovh.net -PORT="" DURATION=10 STREAMS=1 ALL=0 LOGFILE="" - -usage() { - cat <<EOF -Usage: $0 [-p PORT] [-t SECONDS] [-P STREAMS] [-a] [-l FILE] [-h] - -iperf3 upload/download test against ${SERVER} (ports 5201-5210). - -Options: - -p PORT test a specific port (default: try 5201-5210 until one works) - -t SECONDS test duration in seconds (default: ${DURATION}) - -P STREAMS number of parallel streams (default: ${STREAMS}) - -a test all ports 5201-5210 - -l FILE pass --logfile FILE to iperf3 (appends iperf3 output to FILE) - -h show this help and exit -EOF -} - -[ $# -eq 0 ] && { - usage - exit 0 -} - -while getopts "p:t:P:al:h" o; do case "$o" in - p) PORT=$OPTARG ;; - t) DURATION=$OPTARG ;; - P) STREAMS=$OPTARG ;; - a) ALL=1 ;; - l) LOGFILE=$OPTARG ;; - h) - usage - exit 0 - ;; - *) - usage >&2 - exit 1 - ;; - esac done - -command -v iperf3 >/dev/null || { - echo "iperf3 not installed" >&2 - exit 1 -} - -LOG=() -[ -n "$LOGFILE" ] && LOG=(--logfile "$LOGFILE") - -test_port() { - echo "=== ${SERVER}:$1 (${DURATION}s, ${STREAMS} stream) ===" - iperf3 -c "$SERVER" -p "$1" -t "$DURATION" -P "$STREAMS" "${LOG[@]}" -R || return 1 - iperf3 -c "$SERVER" -p "$1" -t "$DURATION" -P "$STREAMS" "${LOG[@]}" -} - -if [ "$ALL" = 1 ]; then - for p in $(seq 5201 5210); do test_port "$p" || true; done -elif [ -n "$PORT" ]; then - test_port "$PORT" -else - for p in $(seq 5201 5210); do - test_port "$p" && exit 0 - echo "port $p busy, trying next..." >&2 - done - echo "all ports busy/unreachable" >&2 - exit 1 -fi