Skip to content

Instantly share code, notes, and snippets.

View xanoni's full-sized avatar
🐱
I'm a cat

Linus Xanoni xanoni

🐱
I'm a cat
View GitHub Profile
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=googlemail.com; s=20161025;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to;
bh=+lkRo0xHq0A5qPt4Ud4bXvNaQX2AJTwdlR5UthC+VcY=;
b=jau+o2hGzSHgRaoPfJe9eMaxU4Lh7DsSbtV8wQehOE8xaULsl+CoYhZHxXzm8Dr0KW
H5H6up8OANeXTFyBnW35FWBqr6cdCiPbzHCKslHnurBb0/CQ4yinWjahpIbsu35gxfOM
hc1q8r02ahsVyfXrpegxHxv2TjmKEniO0WiXa5ybooZngNJEUdxLwHgPiK7Nnwm7eA8N
/hP1vCBspeaTT2muu22srZkwVygeJiuxUJTewc9bT57LRFQQQ75YELEKIbrL6wwtE7Hf
EGzqdNHJpFvAttioPpSCf54YALz2rKuvrCmEBkFXRa+gyBX2CIDIeqQdzbrRHKiZ10nM
i/Lw==
#! /usr/bin/env -S bash -e
drive="/dev/sda"
if ! [ -z ${1} ]; then
drive=${1}
fi
function benchmark_cryptsetup {
local num_runs=${1}
> dd benchmark 1/1 (bs=1M):
write test:
5120+0 records in
5120+0 records out
5368709120 bytes (5.4 GB, 5.0 GiB) copied, 45.2929 s, 119 MB/s
read test:
5120+0 records in
5120+0 records out
> cryptsetup benchmark 1/2:
# Tests are approximate using memory only (no storage IO).
# Algorithm | Key | Encryption | Decryption
xchacha12,aes-adiantum 256b 108.1 MiB/s 112.3 MiB/s
# Tests are approximate using memory only (no storage IO).
# Algorithm | Key | Encryption | Decryption
xchacha20,aes-adiantum 256b 98.1 MiB/s 98.4 MiB/s
# Tests are approximate using memory only (no storage IO).
# Algorithm | Key | Encryption | Decryption
> cryptsetup benchmark 1/2:
# Tests are approximate using memory only (no storage IO).
# Algorithm | Key | Encryption | Decryption
xchacha12,aes-adiantum 256b 111.8 MiB/s 111.9 MiB/s
# Tests are approximate using memory only (no storage IO).
# Algorithm | Key | Encryption | Decryption
xchacha20,aes-adiantum 256b 97.8 MiB/s 98.4 MiB/s
# Tests are approximate using memory only (no storage IO).
# Algorithm | Key | Encryption | Decryption
> dd benchmark 1/1 (bs=1M):
write test:
5120+0 records in
5120+0 records out
5368709120 bytes (5.4 GB, 5.0 GiB) copied, 62.1796 s, 86.3 MB/s
read test:
5120+0 records in
5120+0 records out
> dd benchmark 1/1 (bs=1M):
write test:
5120+0 records in
5120+0 records out
5368709120 bytes (5.4 GB, 5.0 GiB) copied, 47.4326 s, 113 MB/s
read test:
5120+0 records in
5120+0 records out
> dd benchmark 1/1 (bs=1M):
write test:
5120+0 records in
5120+0 records out
5368709120 bytes (5.4 GB, 5.0 GiB) copied, 44.1281 s, 122 MB/s
read test:
5120+0 records in
5120+0 records out
> hdparm benchmark 1/2 (/dev/mapper/cryptssd):
/dev/mapper/cryptssd:
150 MB in 2.01 seconds = 74.80 MB/sec
Timing O_DIRECT disk reads: 232 MB in 3.02 seconds = 76.83 MB/sec
> hdparm benchmark 2/2 (/dev/mapper/cryptssd):
/dev/mapper/cryptssd:
150 MB in 2.01 seconds = 74.57 MB/sec
Timing O_DIRECT disk reads: 232 MB in 3.02 seconds = 76.75 MB/sec
> dd benchmark 1/1 (bs=512M):
write test:
@xanoni
xanoni / scp-delete-during-transfer.sh
Last active August 3, 2021 06:59
scp-delete-during-transfer.sh: for when you're running out of disk space and need to scp a file out while deleting chunks of it
#! /usr/bin/env -S bash -e
SSH_USERHOST="user@host"
REMOTE_PATH="/tmp/disk_backup.img"
OUT_PATH="./$(basename ${REMOTE_PATH})"
TMP_PATH="/tmp/ssh-big-copy"
SLICES=200
echo -e "\nGetting from ${SSH_USERHOST}: ${REMOTE_PATH}\n"