diff options
author | Franck Cuny <franck@fcuny.net> | 2022-03-25 07:07:05 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-03-25 07:07:05 -0700 |
commit | cff751de56663d017b7e997b034d90f9847711af (patch) | |
tree | 3cbb2aa216a27a634b57da14d5cfdd148be95e2c | |
parent | rclone: correct path for the backups (diff) | |
download | world-cff751de56663d017b7e997b034d90f9847711af.tar.gz |
docs: add more documentation!
-rw-r--r-- | docs/desktop.org | 19 | ||||
-rw-r--r-- | docs/gnome-keyring.org | 66 | ||||
-rw-r--r-- | docs/tools.org | 122 |
3 files changed, 207 insertions, 0 deletions
diff --git a/docs/desktop.org b/docs/desktop.org new file mode 100644 index 0000000..a52fc53 --- /dev/null +++ b/docs/desktop.org @@ -0,0 +1,19 @@ +* Next build +** Requirements +- Future proof (PCIe 5, DDR5) +- Re-use the nr200p case +- 2 NVMe drive would be nice +- not have to use a GPU would be nice +** Hardware selection + +| component | model | price | note | +|-------------+-----------------------------------------------+-------+------| +| CPU | Intel Core i7-12700K | 380 | | +| CPU cooler | Noctua NH-U9S chromax.black | 0 | | +| motherboard | Asus ROG STRIX B660-I GAMING | 220 | | +| memory | Corsair Vengeance 32 GB (2 x 16 GB) DDR5-5200 | 309 | | +| boot drive | Western Digital Black SN850 | 160 | | +| case | nr200p | 0 | | +|-------------+-----------------------------------------------+-------+------| +| | | 1069 | | +#+TBLFM: @8$3=vsum(@2..@-1) diff --git a/docs/gnome-keyring.org b/docs/gnome-keyring.org new file mode 100644 index 0000000..35480e5 --- /dev/null +++ b/docs/gnome-keyring.org @@ -0,0 +1,66 @@ +#+TITLE: gnome-keyring-daemon setup + +It seems that there's a lot of hate for the =gnome-keyring-daemon= online, so I might be missing something. But on my end, it seems to simplifies a few things and there are no more prompt when I log into my session about various keys. + +* gnome-keyring-daemon +It looks like we need to install a few packages: +- =gnome-keyring= +- =seahorse= + +There is a [[file:~/workspace/linux-desktop/systemd/gnome-keyring.service][unit]] that ensure it starts when we log in a session. + +Using =seahorse=, we can see which secrets / keys are managed by it. + +Additional documentations: +- [[https://wiki.archlinux.org/title/GNOME/Keyring][arch wiki]] +* PGP +** Unlocking the key +The keyring daemon unlocks the key for us. +** Backup the key +To backup the key, do +#+begin_src sh +gpg --export-secret-keys --armor franck@fcuny.net > ~/documents/backups/gpg-secret-key-backup.asc +#+end_src + +To see the list of keys: +#+begin_src sh :results verbatim raw +gpg --list-secret-keys +#+end_src + +#+RESULTS: +/home/fcuny/.gnupg/pubring.kbx +------------------------------ +sec rsa4096 2021-09-13 [SC] + 23348B57F01D4234B5CFBA0923208AC01EB6EEA1 +uid [ultimate] Franck Cuny <franck@fcuny.net> +ssb rsa4096 2021-09-13 [E] + +To export the trusted keys: +#+begin_src sh +gpg --export-ownertrust > ~/documents/backups/gpg-trusteddb-backup.txt +#+end_src + +** Restore the key +To restore the key from the backup +#+begin_src sh +gpg --import ~/documents/backups/gpg-secret-key-backup.asc +#+end_src + +To restore the trusted db: +#+begin_src sh +gpg --import-ownertrust < ~/documents/backups/gpg-trusteddb-backup.txt +#+end_src + +If you don't import the trusted db you need to set your key as trusted +#+begin_src +gpg --edit-key franck@fcuny.net +gpg> trust +gpg> save +#+end_src +** Configuration for the agent +In =$HOME/.gnupg/gpg-agent.conf= +#+begin_src conf +pinentry-program /usr/bin/pinentry-gnome3 +#+end_src +* SSH +As the keyring daemon manages our ssh key, all we need to do is to export =SSH_AUTH_SOCK= to where the socket started by the daemon is. This is done in [[file:~/workspace/linux-desktop/dotfiles/pam_environment][pam_environment]]. diff --git a/docs/tools.org b/docs/tools.org new file mode 100644 index 0000000..17c9110 --- /dev/null +++ b/docs/tools.org @@ -0,0 +1,122 @@ +#+TITLE: Collection of recipes for various tools + +* yt-dlp +- use =--merge-output-format=mkv= +- check what's the best audio and video for a video +- prefer =mp4= for the audio over =webm= + +** List of supported formats +#+begin_src sh :results verbatim +yt-dlp --list-formats https://www.youtube.com/watch?v=igH-NgcuW2M +#+end_src + +#+RESULTS: +#+begin_example +[youtube] igH-NgcuW2M: Downloading webpage +[youtube] igH-NgcuW2M: Downloading android player API JSON +[info] Available formats for igH-NgcuW2M: +ID EXT RESOLUTION FPS | FILESIZE TBR PROTO | VCODEC VBR ACODEC ABR ASR MORE INFO +--- ---- ---------- --- - ---------- ----- ----- - ----------- ----- --------- ---- ------- ----------------- +139 m4a audio only | 15.00MiB 47k https | mp4a.40.5 47k 22050Hz low, m4a_dash +249 webm audio only | 15.28MiB 48k https | opus 48k 48000Hz low, webm_dash +250 webm audio only | 19.58MiB 62k https | opus 62k 48000Hz low, webm_dash +140 m4a audio only | 40.06MiB 127k https | mp4a.40.2 127k 44100Hz medium, m4a_dash +251 webm audio only | 39.20MiB 124k https | opus 124k 48000Hz medium, webm_dash +17 3gp 176x144 12 | 24.81MiB 78k https | mp4v.20.3 78k mp4a.40.2 0k 22050Hz 144p +160 mp4 256x144 12 | 34.44MiB 109k https | avc1.4d400c 109k 144p, mp4_dash +278 webm 256x144 12 | 28.61MiB 90k https | vp9 90k 144p, webm_dash +133 mp4 426x240 24 | 77.23MiB 244k https | avc1.4d4015 244k 240p, mp4_dash +242 webm 426x240 24 | 72.41MiB 229k https | vp9 229k 240p, webm_dash +134 mp4 640x360 24 | 178.23MiB 565k https | avc1.4d401e 565k 360p, mp4_dash +18 mp4 640x360 24 | 231.71MiB 734k https | avc1.42001E 734k mp4a.40.2 0k 44100Hz 360p +243 webm 640x360 24 | 137.73MiB 436k https | vp9 436k 360p, webm_dash +135 mp4 854x480 24 | 329.98MiB 1046k https | avc1.4d401e 1046k 480p, mp4_dash +244 webm 854x480 24 | 244.94MiB 776k https | vp9 776k 480p, webm_dash +136 mp4 1280x720 24 | 638.05MiB 2023k https | avc1.4d401f 2023k 720p, mp4_dash +22 mp4 1280x720 24 | 2150k https | avc1.64001F 2150k mp4a.40.2 0k 44100Hz 720p +247 webm 1280x720 24 | 490.14MiB 1554k https | vp9 1554k 720p, webm_dash +137 mp4 1920x1080 24 | 1.13GiB 3685k https | avc1.640028 3685k 1080p, mp4_dash +248 webm 1920x1080 24 | 893.45MiB 2833k https | vp9 2833k 1080p, webm_dash +#+end_example +** Best audio and video +#+begin_src sh +yt-dlp -f 'bv*+ba' https://www.youtube.com/watch?v=igH-NgcuW2M -o '%(id)s.%(ext)s' +#+end_src +** Download a playlist +Save into =channel_id/playlist_id= directory with the video added to an archive text file: +#+begin_src sh +yt-dlp -f 'bv*[height=1080]+ba' --download-archive videos.txt https://www.youtube.com/playlist?list=PLlVlyGVtvuVnUjA4d6gHKCSrLAAm2n1e6 -o '%(channel_id)s/%(playlist_id)s/%(id)s.%(ext)s' +#+end_src +** Download a channel +#+begin_src sh +yt-dlp -f 'bv*[height=720]+ba' --download-archive videos.txt https://www.youtube.com/c/FootheFlowerhorn/videos -o '%(channel)s/%(title)s.%(ext)s' +#+end_src +* exiftool +** Copy media based on the creation date +#+begin_src sh +exiftool -v -o . '-Directory<CreateDate' -d /data/photos/%Y/%Y-%m-%d/ . +#+end_src +** Move media based on the creation date +#+begin_src sh +exiftool -v '-Directory<CreateDate' -d /data/photos/%Y/%Y-%m-%d/ . +#+end_src + +Alternatively, in case the creation date is incorrect: +#+begin_src sh +exiftool -v '-Directory<DateTimeOriginal' -d /data/photos/%Y/%Y-%m-%d/ +#+end_src +** Move pdf to a directory +To move papers (for example) using the title and date of creation to a specific destination: +#+begin_src sh +exiftool '-filename<${Title;}.%e' '-directory<CreateDate' -d ~/documents/papers/%Y/ . +#+end_src +** Edit metadata from a google takeout +This [[https://github.com/kaytat/exiftool-scripts-for-takeout][repository]] as a few scripts for =exiftools= that are interesting. In case this repository were to disappear in the future, here is the script to update the metadata from the JSON files: +#+begin_src sh :filename use_json.args +# Fill in from Google's JSON + +# Look at all media files and ignore JSON +--ext +json + +# Recursive +-r + +# Show processed filenames +-v0 + +# Check if the corresponding JSON exists +-if +(-e "${Directory}/${Filename}".".json") + +# Attempt to modify media only if the info doesn't already exist +-if +($Filetype eq "MP4" and not $quicktime:TrackCreateDate) or ($Filetype eq "MP4" and $quicktime:TrackCreateDate eq "0000:00:00 00:00:00") or ($Filetype eq "JPEG" and not $exif:DateTimeOriginal) or ($Filetype eq "PNG" and not $PNG:CreationTime) + +# Attempt to read in the JSON +-tagsfromfile +%d%F.json + +# +# Write out the tags. Use ConvertUnixTime to try and convert the UTC timestamp +# to a reasonable local EXIF string. +# + +# EXIF for regular JPG photos +-AllDates<${PhotoTakenTimeTimestamp;$_=ConvertUnixTime($_,1)} + +# PNG-specific +-XMP-Exif:DateTimeOriginal<${PhotoTakenTimeTimestamp;$_=ConvertUnixTime($_,1)} +-PNG:CreationTime<${PhotoTakenTimeTimestamp;$_=ConvertUnixTime($_,1)} + +# Quicktime / MP4. Assume that timestamp is in UTC. +-QuickTime:TrackCreateDate<${PhotoTakenTimeTimestamp;$_=ConvertUnixTime($_,0)} +-QuickTime:TrackModifyDate<${PhotoTakenTimeTimestamp;$_=ConvertUnixTime($_,0)} +-QuickTime:MediaCreateDate<${PhotoTakenTimeTimestamp;$_=ConvertUnixTime($_,0)} +-QuickTime:MediaModifyDate<${PhotoTakenTimeTimestamp;$_=ConvertUnixTime($_,0)} + +# Clobber everything +-overwrite_original +#+end_src + +and to run it: =exiftool -@ use_json.args <takeout_dir>= |