Skip to content

Instantly share code, notes, and snippets.

Avatar

Mikko Rantalainen mikkorantalainen

  • Peda.net, University of Jyväskylä
  • Finland
View GitHub Profile
View PHP lambda performance results
Live version: https://3v4l.org/6AABv
Test script:
<?php
$a = array(
0 => "foo",
1 => "bar",
"animal" => "string",
3.13 => "pi",
View speedtest-cloudflare
#!/bin/bash
# Speedtest using speed.cloudflare.com servers
# Copyright 2020 Mikko Rantalainen <mikko.rantalainen@iki.fi>
# License: 2-clause BSD (https://opensource.org/licenses/BSD-2-Clause)
set -e
ID="$RANDOM$RANDOM$RANDOM"
BYTES="${BYTES:=1000000}"
SERVER="https://speed.cloudflare.com"
TEMPFILE="$(tempfile -p speed -s test)"
View traffic-shaping
#!/bin/bash
# Traffic shaping script (AQM, fq_codel+tbf)
# Copyright 2018 Mikko Rantalainen <mikko.rantalainen@gmail.com>
# License: MIT (X11)
# Usage:
# 21/0.8 Mbps connection (ADSL2): DOWNLINK_RATE=21.7Mbit UPLINK_RATE=0.8Mbit TBF_LATENCY=500ms bin/traffic-shaping start
# 100/100 Mbps connection: ./traffic-shaping
# 1/1 GBps connection: DOWNLINK_RATE=1Gbit UPLINK_RATE=1Gbit TBF_LATENCY=10ms bin/traffic-shaping start
# Note that using low TBF_LATENCY will require powerful CPU.
#