Skip to content

Instantly share code, notes, and snippets.

@xrat
xrat / sshpingpong
Last active March 16, 2023 21:44
Calculate time needed to send 1 byte back and forth within an SSH connection
#!/bin/bash
#
me=sshpingpong
#
# Measure close to minimal packet latency (RTT) of an SSH connection
#
prgversion="$me * 2022-07-27 (c) Andreas Schamanek"
#
# @author Andreas Schamanek <https://andreas.schamanek.net>
# @license GPL <https://www.gnu.org/licenses/gpl.html>
@xrat
xrat / r2eflatten.awk
Created June 22, 2022 20:01
Awk script to flatten an rss2email multipart digest
# Flatten an rss2email multipart digest
#
# Tested only with GNU Awk, and rss2email up to 3.13.1.
# This script expects the encodings setting in r2e to prefer UTF-8.
# It also expects that input was run through `formail -c`, and it
# requires reformime (on e.g. Debian part of package maildrop)
function output() {
# print entry
print "-----------------"
@xrat
xrat / futureTasks.awk
Created May 5, 2012 21:21
Shorter Future Tasks.awk
#!/usr/bin/awk -f
#
# Original script by Ed Blackman, posted May 12, 2009, at
# http://tech.groups.yahoo.com/group/todotxt/message/2299
#
# Ruthlessly reduced by Andreas Schamanek in May, 2012.
#
# This script relies on the fact that a lexical sort of YYYY-MM-DD
# date strings produces the same result as a calendar sort, but avoids
# the tricky calendar math. It will *not* work for other types of