diff --git a/tutos/computer.txt b/tutos/computer.txt index d6470a5..77397c9 100644 --- a/tutos/computer.txt +++ b/tutos/computer.txt @@ -34,6 +34,14 @@ sed 's/^BASEURL=/URL=/' "$1" | grep -m 1 '^URL=' | sed 's/^URL=//' | sed 's/\r//' | xargs xdg-open fi ``` + - signification : + - for the command "open_url file.URL" : + - **$0** : /usr/local/bin/open_url + - **$(basename "$0")** : open_url + - **$1** : file.URL + - the sed command : + - **grep -m 1** : tells grep to stop searching after the first match + - **xargs** : reads items from standard input and executes a command with those items as arguments - give execution permission : `chmod +x /usr/local/bin/open_url` - tell the file manager to use this script to open .URL files : - right click on a .URL file @@ -42,10 +50,18 @@ - 'use as default for this kind of file' (or equivalent) - open :) + **open .webloc files :** - see above 'open .URL files' - - change this line in the script : - grep -m 1 -oP '(?<=).*?(?=<\/string>)' repas_4_etoiles.webloc | xargs xdg-open + - in the script change the line "sed..." by this : + grep -m 1 -oP '(?<=).*?(?=<\/string>)' "$1" | xargs xdg-open + - signification : + - **-m 1** : tells grep to stop searching after the first match + - **-o** : tells grep to print only the matching portion of the line + - **-P** : this option enables Perl-compatible regular expressions, which support lookaheads and lookbehinds + - **(?<=)** : this is a positive lookbehind that matches the position immediately after . + - **.*?** : this matches any character (except for a newline) zero or more times, but as few times as possible. + - **(?=<\/string>)** : this is a positive lookahead that matches the position immediately before **pdftotext** transforme un pdf en un fichier texte @@ -227,7 +243,7 @@ find | sort | grep -ve "node_modules/" -e ".git/" | sed 's#[^/]*/#|__ #g;s#__ |# **list of automatic settings :** - - install screen, omyzsh, keepassxc, curl, make, firefox, signal, gnome-tweaks + - install screen, omyzsh, keepassxc, curl, make, firefox, signal, gnome-tweaks, ffmpeg, yt-dlp - install or configure to avoid screen blue light - install nextcloud client (apt ? or appimage ? appimage need fuse : https://github.com/AppImage/AppImageKit/wiki/FUSE), and launch at startup - install these settings (connection with bitbucket ? ssh ? https ?) diff --git a/tutos/vim.txt b/tutos/vim.txt index 600b669..32695e6 100644 --- a/tutos/vim.txt +++ b/tutos/vim.txt @@ -137,7 +137,7 @@ **==** rétablit la bonne indentation pour la ligne **=G** rétablit la bonne indentation pour toute la page **''** go to last cursor position -**gx** open the file under cursor, or url +**gx** open the file under cursor, or url or links /REMPLACER/ **:s/old/new** remplace la 1ere occurence de ancien par nouveau