Skip to content

Instantly share code, notes, and snippets.

@thapakazi
Last active May 8, 2021 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thapakazi/3c0fb6eb45dbc00311de7a0de9334220 to your computer and use it in GitHub Desktop.
Save thapakazi/3c0fb6eb45dbc00311de7a0de9334220 to your computer and use it in GitHub Desktop.

NOte

  • install librespeed-cli from https://github.com/librespeed/speedtest-cli
  • configure your systemd service so it logs your speed test to a file: `~/.cache/librespeed/librespeed_test.json` that you can later make use of

cheers !! 🎉

# /home/thapakazi/.config/systemd/user/librespeed-cli.service
[Unit]
Description=SpeedTest with librespeed-cli
[Service]
Type=simple
ExecStartPre=/bin/bash -c "mkdir -p ~/.cache/librespeed/ && librespeed-cli --list | awk -F: '/[[:digit:]]/ {print $1}' > /tmp/librespeed-cli.servers"
ExecStart=/bin/bash -c 'while true; do librespeed-cli --server $(shuf -n 1 /tmp/librespeed-cli.servers) --json >> ~/.cache/librespeed/librespeed_test.json; sleep 5m; done'
[Install]
WantedBy=default.target
install:
ln -s $PWD/librespeed-cli.service ~/.config/systemd/user/librespeed-cli.service
systemctl --user enable librespeed-cli.service
systemctl --user start librespeed-cli.service
re-install:
systemctl --user daemon-reload
systemctl --user restart librespeed-cli.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment