If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.
This should fit most setups (not mine though 😉)
| # This is a modified version of `orig_benchmark.py`, using different data to | |
| # highlight performance differences. | |
| import json | |
| import random | |
| import string | |
| import timeit | |
| from statistics import mean, stdev | |
| import orjson | |
| import simdjson |
| # Written by Brendan O'Connor, [email protected], www.anyall.org | |
| # * Originally written Aug. 2005 | |
| # * Posted to gist.github.com/16173 on Oct. 2008 | |
| # Copyright (c) 2003-2006 Open Source Applications Foundation | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # |
| # Written by Brendan O'Connor, [email protected], www.anyall.org | |
| # * Originally written Aug. 2005 | |
| # * Posted to gist.github.com/16173 on Oct. 2008 | |
| # Copyright (c) 2003-2006 Open Source Applications Foundation | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # |
| import asyncio | |
| from pathlib import Path | |
| from typing import Optional | |
| from watchdog.events import FileSystemEvent, FileSystemEventHandler | |
| from watchdog.observers import Observer | |
| class _EventHandler(FileSystemEventHandler): | |
| def __init__(self, queue: asyncio.Queue, loop: asyncio.BaseEventLoop, |
| Ref: https://bbs.archlinux.org/viewtopic.php?id=65508 | |
| 1/ Method 1 | |
| # First, create a new Linux group which has permission to use promiscuous mode, and add yourself to the group. | |
| $ groupadd promiscuous | |
| $ usermod -a -G promiscuous <your_user_id> | |
| # Update the group ownership and access permission of /dev/vmnet* | |
| $ chgrp promiscuous /dev/vmnet* | |
| $ chmod g+rw /dev/vmnet* |
| Install WireGuard via whatever package manager you use. For me, I use apt. | |
| $ sudo add-apt-repository ppa:wireguard/wireguard | |
| $ sudo apt-get update | |
| $ sudo apt-get install wireguard | |
| MacOS | |
| $ brew install wireguard-tools | |
| Generate key your key pairs. The key pairs are just that, key pairs. They can be |
| #!/usr/bin/env bash | |
| # ======================================================================================= | |
| # | |
| # A simple script to test Synology NAS disk speed with hdparm, dd and fio. | |
| # | |
| # How to use: | |
| # | |
| # 1. Save synology_disk_benchmark.sh and xfio.conf to your Synology NAS | |
| # 2. Make it executable: chmod +x synology_disk_benchmark.sh |
If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.
This should fit most setups (not mine though 😉)
| # Based on the example from https://www.activestate.com/blog/dash-vs-bokeh/ | |
| import dash | |
| import dash_core_components as dcc | |
| import dash_html_components as html | |
| import pandas as pd | |
| import plotly.graph_objs as obj | |
| import uvicorn as uvicorn | |
| from dash.dependencies import Input, Output | |
| from fastapi import FastAPI | |
| from starlette.middleware.wsgi import WSGIMiddleware |