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

Get list of some Firefox addons I'm using

All Firefox addons with its URLs I’m actually using: Asciidoctor.js Live Preview Buster: Captcha Solver for Humans Checkmarks Clear Browsing Data ClearURLs Consent-O-Matic Cookies.txt Copy PlainText Copy ShortURL Dark Mode (WebExtension) Export Tabs URLs Flagfox FoxyProxy Basic FoxyTab LibRedirect Markdown Viewer Medium Free with Google Cache Mobile View Switcher Modify Header Value NoScript Security Suite Open in Colab PassFF RSSPreview Search by Image Simple Translate Simple WebSocket Client Spaywall - spay your paywall Startpage - Private Search Engine To Google Translate uBlock Origin Web Archives YT Siphon

2023-11-17 · G2G

Migrate ZX2C4 pass to MacOSX

… or how to migrate your pass keys softly Source 1for FOLDER in $HOME/.password-store $HOME/.gnupg ; do 2 rsync -arv --delete ${FOLDER}/ macosx:${FOLDER}/; 3done Target 1brew install gnupg pass pinentry 2gpg --list-key toto@perdu.com # ensure that gpg email user is the same as git email user 3git config --global --edit # ensure that gpg email user is the same as git email user 4 5cat<<\EOF>>$HOME/.bash_profile 6[[ -f ~/.bashrc ]] && source ~/.bashrc 7EOF 8 9cat<<\EOF>>$HOME/.bashrc 10eval "$(/opt/homebrew/bin/brew shellenv 2>/dev/null)" 11# password-store completion 12for COMPLETION in /opt/homebrew/etc/bash_completion.d/* ; do 13 source $COMPLETION 2>/dev/null; 14done 15 16[[ -z $(pgrep gpg-agent) ]] && gpg-agent --pinentry-program=/opt/homebrew/bin/pinentry-tty --daemon # for password-store 17EOF Sources ZX2C4 Pass Documentation

2023-08-07 · G2G

TLDR as customizable collaborative cheatsheets tool

tldr-pages project contains a lot of Linux commands cheatsheets. But you can easily contribute with pull requests (1) to customize it. In this case, follow the guide below. 1# install tldr rust client 2paru -S tealdeer 3# fork tldr-pages project from your user github repo 4git clone git@github.com:my_user/tldr.git ~/.cache/tealdeer/tldr-pages By this way, you can : get locally your modifications with tldr command modify markdown pages inside ~/.cache/tealdeer/tldr-pages/ contribute with PR to the project SOURCES tldr-pages github project tldr rust client

2023-01-21 · G2G

Dockerize persistent Firefox with Java 7 support

… for old Raritan PDU/KVM devices Web access Build your Docker image from Dockerfile create your Dockerfile Dockerfile 1FROM i386/debian:jessie 2RUN apt-get update && apt-get install -y firefox-esr icedtea-plugin icedtea-netx openjdk-7-jre openjdk-7-jre-headless tzdata-java 3RUN useradd -ms /bin/bash firefox 4ENV MOZ_FORCE_DISABLE_E10S=1 5USER firefox 6WORKDIR /home/firefox 7CMD tail -f /dev/null tail -f /dev/null force your Docker container to be persistent even if you’ve closed your Firefox session build it 1docker build -t firefox . # make it great again 2docker images --filter reference=firefox # check your docker image information Run your Docker container pop Firefox 1docker run -it --rm -e DISPLAY=${DISPLAY} -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/Downloads:/home/firefox/Downloads firefox firefox # run it with sharing Downloads directory add it to your .bashrc to simplify Firefox docker access .bashrc 1function ffjava7(){ 2 CONTAINER_NAME=firefox 3 xhost +; 4 docker container inspect ${CONTAINER_NAME} > /dev/null 2>&1 ; [ $? -eq 0 ] \ 5 && docker start firefox \ 6 || docker run -d --name ${CONTAINER_NAME} -e DISPLAY=${DISPLAY} -v /tmp/.X11-unix:/tmp/.X11-unix -v $HOME/Downloads:/home/firefox/Downloads firefox firefox 7} Sources how to build your Docker container https://blog.yadutaf.fr/2017/09/10/running-a-graphical-app-in-a-docker-container-on-a-remote-server/ https://www.sicpers.info/2020/10/running-linux-gui-apps-under-macos-using-docker/ [Mac OSX] https://github.com/jlesage/docker-firefox https://github.com/findepi/docker.firefox-silverlight-pipelight [Silverlight support] fix Firefox tab persistently crashes on some sites https://support.mozilla.org/bm/questions/1266719

2020-10-15 · G2G

Remind Urgent Tasks

… with desktop notifications from Taskwarrior Script it send only tasks with high priority list as desktop notification task_notify_send.sh 1#!/usr/bin/env bash 2 3export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$EUID/bus" 4notify-send -u critical "$(for ID in $(task _ids priority:V -WAITING -PARENT); do echo [$ID]$(task $ID export | jq -r '.[].description') ; done)" Schedule it schedule task notification as systray message every 20 minutes in Crontab 1# crontab -l 2/20 * * * * ~/.local/bin/task_notify_send.sh Sources https://www.sudipbhandari.wtf/task-warrior-reminder/ https://eshapard.github.io/export-taskwarrior-dates-to-remind.html

2020-10-11 · G2G

Complete Them All Everywhere

…with Espanso text expander in Rust (works in Bash, Firefox,…) Getting Started 1yay -S espanso-bin # install espanso package for archlinux 2espanso status # get espanso service status 3espanso start # start espanso service / create ~/.config/systemd/user/espanso.service if does not exist 4espanso path # list espanso config files 5:date # get current date from trigger :date config files Support fix X11 display context error with starting Espanso service 1[[ -z $(grep DISPLAY $HOME/.config/systemd/user/espanso.service) ]] && \ 2 sed -i '/\[Service\]/aEnvironment="DISPLAY=:0"' $HOME/.config/systemd/user/espanso.service && \ 3 /usr/bin/systemctl --user daemon-reload && \ 4 espanso start # fix x11 display context error Sources Getting Started Official Packages Offical Documentation Pour gagner du temps quand vous tapez au clavier [in French] Use Espanso Text Expander To Save Time And Increase Productivity The Journey to My First 100 GitHub Stars

2020-08-19 · G2G

View markdown pages with Firefox

With Markdown Viewer Addon by Simeon Velichkov. Install https://addons.mozilla.org/en-US/firefox/addon/markdown-viewer-chrome/ https://github.com/simov/markdown-viewer View local markdown pages press button from toolbar press advanced options Allowed Origins > select *://* (you may need to use special configuration)[https://github.com/KeithLRobertson/markdown-viewer#support-for-local-files-on-linux] (from issue #131) View file with rst extension press button from toolbar press advanced options MATCH : \.(?:markdown|mdown|mkdn|md|mkd|mdwn|mdtxt|mdtext|text|rst)(?:#.*|\?.*)?$ Table of Contents press button from toolbar press CONTENT tab activate TOC Reload automatically page press button from toolbar press CONTENT tab activate AUTORELOAD

2020-08-07 · 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