Skip to content

Instantly share code, notes, and snippets.

View matti's full-sized avatar
🎯
Focusing

Matti Paksula matti

🎯
Focusing
View GitHub Profile
func wsHandler(w http.ResponseWriter, r *http.Request) {
conn, err := upgrader.Upgrade(w, r, nil)
logFatalError(err)
clients[conn] = redisClient.Subscribe(*channelName)
n, err := redisClient.Publish(*channelName, "x").Result()
browsers := strconv.FormatInt(n, 10)
for client := range clients {
logFatalError(err)
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJn/Y0Iw1lsUSQkQK/GeMUQDv/+VjEZ2sGWlFWMz/iGv mpa
<!DOCTYPE html>
<html lang='en'>
<head>
<title>results</title>
<style>
/*! github.com/micmro/PerfCascade Version:2.7.0 (07/10/2019) */
.water-fall-chart {width:100%; overflow: visible; font-size: 12px; line-height: 1em;}
.water-fall-chart * {box-sizing: border-box;}
.water-fall-chart button {cursor: pointer;}

3 replicas on 3 azs

$ while true; do echo; echo "untar"; time (tar -xof linux-5.4-rc1.tar.gz; sync); echo; echo "rm"; time (rm -rf linux-5.4-rc1; sync); done

untar

real    0m58.023s
user    0m5.774s
sys    0m3.229s

3 replicas on 3 azs

$ while true; do echo; echo copy; echo; time (dd if=/tmp/debian-9.7.0-amd64-DVD-1.iso of=debian-9.7.0-amd64-DVD-1.iso bs=4M; sync); echo; echo rm; echo; time (rm -f debian-9.7.0-amd64-DVD-1.iso ; sync); done

copy

863+1 records in
863+1 records out
3620339712 bytes (3.6 GB, 3.4 GiB) copied, 3.35944 s, 1.1 GB/s
$ while true; do echo "untar"; time (tar -xof linux-1.0.tar.gz; sync); echo; echo "rm"; time (rm -rf linux; sync); done
untar

real    0m0.679s
user    0m0.036s
sys    0m0.148s

rm
$ while true; do echo "untar"; time (tar -xof linux-5.4-rc5.tar.gz; sync); echo; echo "rm"; time (rm -rf linux-5.4-rc5; sync); done
untar

real    1m28.276s
user    0m6.924s
sys    0m16.092s

rm
@matti
matti / quad.py
Created October 27, 2019 08:07
iterm2 quad panes
#!/usr/bin/env python3.7
import asyncio
import iterm2
async def main(connection):
app = await iterm2.async_get_app(connection)
topLeft = app.current_terminal_window.current_tab.current_session
topRight = await topLeft.async_split_pane(vertical=True)
# source before -u
. /usr/local/opt/asdf/asdf.sh
asdf_tool_versions_path="$(dirname "$(readlink "$0")")/../.tool-versions"
asdf_tool_versions_content=$(cat "$asdf_tool_versions_path")
IFS=$'\n'
for line in $asdf_tool_versions_content; do
name=$(echo "$line" | cut -d' ' -f1)
version=$(echo "$line" | cut -d' ' -f2)
@matti
matti / 00-wt75-terminal.txt
Last active January 7, 2019 09:36
wyse75 serial port terminal
aa