Skip to content

Instantly share code, notes, and snippets.

@50kudos
Last active August 12, 2017 22:07
Show Gist options
  • Save 50kudos/cbf345ff22e3cccd821f to your computer and use it in GitHub Desktop.
Save 50kudos/cbf345ff22e3cccd821f to your computer and use it in GitHub Desktop.
Arch-KDE/MacOS/Windows scripts

Allow root logon

  1. Swap to console mode (ctrl+alt+F3)
  2. Login as root
  3. In /usr/share/config/kdm/kdmrc, change AllowRootlogon = false to true

Simplest list hidden files only

ls -ld .* OR ls -ld .??*

mkv to mp4

ffmpeg -i PATH/FILENAME.mkv -acodec aac -ac 2 -strict experimental -ab 160k -vcodec libx264 -preset slow -profile:v baseline -level 30 -maxrate 10000000 -bufsize 10000000 -b 1200k -f mp4 -threads 0 PATH/FILENAME.mp4

mkv to mp4 losslessly

ffmpeg -y -i INPUT.mkv -c copy -map 0:0 -map 0:1 OUTPUT.mp4

extract subtitles

re-encode

ffmpeg -i ~/source.mkv -y out.srt

stream copy

ffmpeg -i ~/source.mkv -c copy -y out.srt

#!/bin/bash
SOURCE=$1
DESTINATION=$2
rsync -avhP --iconv=utf-8-mac,utf-8 \
--delete \
--exclude '.DS_Store' \
--exclude '.Trashes' \
--exclude '.DocumentRevisions-V100' \
--exclude '.Spotlight-V100' \
--exclude '.TemporaryItems' \
--exclude '.com.apple.timemachine.donotpresent' \
--exclude '.fseventsd' \
--exclude 'node_modules' \
$SOURCE $DESTINATION \
2>rsync.err
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment