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
" Navigation related stuff | |
nnoremap <S-Left> :tabprevious<CR> | |
nnoremap <S-Right> :tabnext<CR> | |
inoremap <S-Left> <ESC>:tabprevious<CR> | |
inoremap <S-Right> <ESC>:tabnext<CR> | |
" Shortcuts to make opening and closing vim easier | |
:nmap <C-q> :q<CR> | |
:imap <C-q> <ESC>:wq<CR> |
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 | |
name="$1" | |
# If there are subtitles, keep the part related to "s" | |
ffmpeg -i "$name" -c:v copy -map 0:v:0 -vcodec libx265 -crf 28 -map 0:a:0 -c:a copy -map 0:s:1 -c:s ass "temp.mkv" | |
echo "Initial size:" | |
du -h "$name" |
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
find . -maxdepth 1 -iname '*.mp4' -exec ffprobe -v quiet -of csv=p=0 -show_entries format=duration {} \; | paste -sd+ -| bc | awk '{printf("%d:%02d:%02d:%02d\n",($1/60/60/24),($1/60/60%24),($1/60%60),($1%60))}' |
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
Drag this formula to all relevant cells, changing the $A$1 to $A$2, $3..., assuming data starts from column A | |
Change $25 to $n, where n is the number of rows we want to merge | |
=TRANSPOSE(OFFSET($A$1:$A$25,25*(ROWS($1:1)-1),0)) |
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 | |
find . -maxdepth 1 -iname '*.mkv' | while read filename | |
do | |
# TODO: format output better | |
printf "$filename\t" | |
ffprobe -i "$filename" -show_entries format=duration -v quiet -of csv="p=0" | |
done |
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/bash | |
# Removes old revisions of snaps | |
# CLOSE ALL SNAPS BEFORE RUNNING THIS | |
set -eu | |
snap list --all | awk '/disabled/{print $1, $3}' | | |
while read snapname revision; do | |
snap remove "$snapname" --revision="$revision" | |
done |