Skip to content

Instantly share code, notes, and snippets.

@WarutaShinken
WarutaShinken / to_discord.sh
Created October 31, 2025 09:23
Compress video for Discord's file size limit using FFmpeg.
#!/bin/bash
# Usage:
# ./to_discord.sh input.mp4 output.webm
input=$1
output=$2
target=$((10 * 1024 * 1024)) # 10 MiB File Size Target
vcodec=libvpx-vp9 # VP9 is used because Discord won't embed AV1 videos.
acodec=libopus
@WarutaShinken
WarutaShinken / mem_usage.sh
Last active September 5, 2024 07:02
Show Memory Usage with /proc/meminfo
#!/bin/bash
set -e
# Constants
DP=2 # Decimal Places
# Functions
get_num()