$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1 259:0 0 953.9G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
├─nvme0n1p2 259:2 0 244M 0 part /boot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# the below command exports only the subtitles/text from the mkv video to a plain-text srt file | |
ffmpeg -i video.mkv -an -vn -map 0:2 -c:s:0 srt sub.srt | |
# this command replaces any text in the subtitles matching "some text to change" with "new text" | |
sed -E 's/(some text to change)/new text/g' -i sub.srt | |
# this command mixes the subtitles back in with the video and audio into a new media file | |
ffmpeg -i video.mkv -i sub.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s copy video-new-subtitles.mkv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DEBUG="${DEBUG:-}" | |
if [ -n "$DEBUG" ]; then | |
set -x | |
fi | |
# This script uses ffmpeg to convert an mp4 to a gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>Matrix</title> | |
<link | |
rel="shortcut icon" | |
type="image/ico" | |
href="data:image/x-icon;base64,xxx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const square = x => x*x; | |
const squareCallback = (x, callback) => callback(x*x); | |
const squareCurry = (x) => callback => callback(x*x); | |
const squarePromise = (x) => ({ then: resolve => resolve(x*x) }) | |
const toContinuation = (v) => (callback => callback(v)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#------------------------------------------------------------------------------# | |
# Execute with source termguicolors.sh && truecolor # | |
#------------------------------------------------------------------------------# | |
DEBUG="${DEBUG:-}" | |
if [[ -n $DEBUG ]]; then | |
set -x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
PLATFORM_ARCH="$(uname -m)" | |
PLATFORM_ARCH_APT= | |
if [[ $PLATFORM_ARCH = "aarch64" ]]; then | |
PLATFORM_ARCH_APT="arm64" | |
elif [[ $PLATFORM_ARCH = "x86_64" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
box-sizing: border-box; | |
max-width: 70ch; | |
padding: 3em 1em; | |
margin: auto; | |
line-height: 1.75; | |
font-size: 1.25rem; | |
} | |
*, |
Without diagnostic information like CPU
% utilization or load average
,
memory/swap usage, packets per second, etc., I can only shoot from the hip.
- My first guess would be disk I/O. What's
CPU
%wa
look like? I have gigabit fiber at home and when I'm downloading large files they start off strong at 98-101 MBps before dropping down to ~70 MBps because of disk write speed - high disk %wa is always the indicator. (P.S. b4 a pedantic commenter,I'm saying mega bytes per second, not mega bits per second). You can run some performance and tuning tests withiperf
. Check out this part of theiperf
documentation on Tuning TCP.
For example, here's a test on my local network