Switching from Docker Desktop to Podman on macOS M1/M2 ARM64 CPU
After podman machine start
, do podman machine ssh
and create the following files:
/etc/sysctl.d/98-performance.conf
[Peer] | |
AllowedIPs = 0.0.0.0/5, 8.0.0.0/7, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/2, 128.0.0.0/3, 160.0.0.0/5, 168.0.0.0/6, 172.0.0.0/12, 172.32.0.0/11, 172.64.0.0/10, 172.128.0.0/9, 173.0.0.0/8, 174.0.0.0/7, 176.0.0.0/4, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, 224.0.0.0/3 |
expect -c ' | |
spawn your_command | |
sleep 30 | |
send "\r" | |
interact | |
' |
scoop status | ForEach-Object { | |
if ($_ -match '^(@{Name=)?(\S+?);?\s+(\S+)\s+(\S+)\s+(.*)') { | |
$name = $matches[2] | |
$installedVersion = $matches[3] | |
$latestVersion = $matches[4] | |
if ($installedVersion -ne $latestVersion) { | |
try { | |
scoop update $name | |
} catch { | |
Write-Host "Failed to update $name" -ForegroundColor Red |
#!/usr/bin/env python3 | |
import os | |
import sys | |
import mmap | |
import subprocess | |
import time | |
from multiprocessing import Pool | |
num=0; for i in *; do mv "$i" "$(printf '%04d' $num).${i#*.}"; ((num++)); done |
import hashlib | |
import sys | |
with open(sys.argv[1], 'rb', buffering=0) as f: | |
print(hashlib.file_digest(f, 'shake_256').hexdigest(8)) |
Switching from Docker Desktop to Podman on macOS M1/M2 ARM64 CPU
After podman machine start
, do podman machine ssh
and create the following files:
/etc/sysctl.d/98-performance.conf
for DIR in *; do pushd "$DIR" >/dev/null 2>&1; export URL="https://api.github.com/repos/$(git remote -v| grep -P "origin.*push" | head -n 1 | cols 2 | sed "s/.*github\.com\///" | sed "s/\.git$//")"; export PARENT="$(curl -fsSL -H "Authorization: token $GITHUB_TOKEN" "$URL" | jq -r '.parent.html_url')"; [[ "$PARENT" != "null" ]] && export FORKNAME="$(echo "$PARENT" | cut -d'/' -f4)" && echo "$FORKNAME" && git remote add "$FORKNAME" "$PARENT"; popd >/dev/null 2>&1; done |
A few options:
for FILE in *.mkv; do \ | |
echo "$FILE"; \ | |
for STREAM in $(ffprobe "$FILE" -loglevel error -show_entries stream=index:stream_tags=language -select_streams a -of compact=p=0:nk=1); do \ | |
export STREAM_ID=$(( $(echo "$STREAM" | cut -d'|' -f1)-1 )); \ | |
export STREAM_LANG="$(echo "$STREAM" | cut -d'|' -f2)"; \ | |
export STREAM_CODEC="$(ffprobe "$FILE" -loglevel error -select_streams a:"$STREAM_ID" -show_entries stream=codec_name -of csv=p=0)"; \ | |
mkdir -p "$STREAM_LANG"; \ | |
ffmpeg -hide_banner -loglevel error -y -i "$FILE" -map 0:a:m:language:"$STREAM_LANG" -vn -sn -c:a copy -map_metadata 0 ./"$STREAM_LANG"/"$(base "$FILE").$STREAM_LANG.$STREAM_CODEC"; \ | |
done; \ | |
done |