Forward SSH keys through Tmux windows

How to forward ssh public keys through Tmux windows? 1cat<<~/.bashrc>>EOF 2# forward ssh-agent 3[[ -z $(pgrep ssh-agent) ]] && eval `ssh-agent` &>/dev/null 4if [[ -S "$SSH_AUTH_SOCK" && ! -h "$SSH_AUTH_SOCK" ]]; then 5 ln -sf "$SSH_AUTH_SOCK_LOCAL" ~/.ssh/ssh_auth_sock; 6fi 7export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock; # already in ~/.ssh/config 8EOF 9cat<<~/.ssh/config>>EOF 10ForwardAgent yes 11IdentityAgent ~/.ssh/ssh_auth_sock 12EOF SOURCES Martijnvermaat’s gist Stackoverflow Werat’s post Blogsystem5’s post Ssh-agent Switcher tool

2024-02-20 · G2G

Set songs tags and rename songs filename with id3v2

in oneliner and mass renaming mode get tags information with exiftool and copy tags /rename mp3 file with id3v2 1IFS=$'\n';for MP3_NAME in *mp3; do 2 ARTIST=$(exiftool -artist "$MP3_NAME" | awk -F': ' '{print $2}'); 3 SONG=$(exiftool -title "$MP3_NAME" | awk -F': ' '{print $2}'); 4 ALBUM=$(exiftool -album "$MP3_NAME" | awk -F': ' '{print $2}'); 5 id3v2 -a "$ARTIST" -t "$SONG" -A "$ALBUM" --genre 45 "$MP3_NAME" ; 6 mv -vi "$MP3_NAME" "${ARTIST} - ${SONG}.mp3" ; 7done; 8IFS=$' \t\n' tags based on mp3 filename if some mp3 files are no tags with exiftool 1# move mp3 files without tags in 3mpty directory 2IFS=$'\n';for SONG in *mp3; do 3 [ -z "$(exiftool -artist "$SONG")" ] && \ 4 mv -vi "$SONG" 3mpty/ ; 5done 6cd 3mpty 7 8# set tags on mp3 files from filename with this format "artist - title.mp3" 9IFS=$'\n'; for SONG_FILENAME in *mp3; do 10 ARTIST=$(echo "$SONG_FILENAME" | sed 's/ - .*$//'); 11 TITLE=$(echo "$SONG_FILENAME" | sed 's/^.*- \(.*\)\..*$/\1/'); 12 id3v2 -a "$ARTIST" -t "$TITLE" "$SONG_FILENAME"; 13done; 14IFS=$' \t\n' id3v2 commands that may help 1id3v2 -h 2id3v2 --list-frames # list id3v2 frames 3id3v2 --list-genres # list id3v1 genres 4id3v2 --delete-all # remove all tags from mp3 file

2020-04-05 · G2G

Manage subtitles with mpv media player

with hotkeys add custom hotkeys to increase / decrease subtitle size 1cat <EOF>> ~/.config/mpv/input.conf 2# increase subtitle font size 3ALT+k add sub-scale +0.1 4 5# decrease subtitle font size 6ALT+j add sub-scale -0.1 HOTKEYS v => show/hide subtitle ALT+k => increase subtitle size ALT+j => decrease subtitle size

2020-02-12 · G2G