From 92a8179dd00ea2c2e2a317edb5c2682f56425268 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 10 Jul 2021 22:20:08 +0800 Subject: [PATCH] Update formatting on the command line notes Along with some extra updates for a note about GitHub Actions. --- structured/cli.borg.org | 8 ++-- structured/cli.ffmpeg.org | 20 ++++---- structured/cli.journalctl.org | 16 +++---- structured/cli.youtube-dl.org | 74 +++++++++++++++++++++++++++++ structured/cloud.github-actions.org | 3 +- 5 files changed, 98 insertions(+), 23 deletions(-) create mode 100644 structured/cli.youtube-dl.org diff --git a/structured/cli.borg.org b/structured/cli.borg.org index 7f1575c..e975260 100644 --- a/structured/cli.borg.org +++ b/structured/cli.borg.org @@ -3,7 +3,7 @@ :END: #+title: Command line: BorgBackup #+date: "2021-05-30 21:40:24 +08:00" -#+date_modified: "2021-06-20 10:02:15 +08:00" +#+date_modified: "2021-07-08 17:56:25 +08:00" #+language: en #+property: header_args :eval no #+property: header_args:bash :results silent :exports code @@ -36,9 +36,9 @@ It can be picky with certain subcommands output being affected from the order of Borg uses a Git-style command-line interface with subcommands and some common options to choose from. -- You can set the log level of the program with ~--debug~, ~--info~, ~--warning~, ~--error~, and ~--critical~. -- ~-v, --verbose~ - alias for ~--info~ -- ~-p, --progress~ - show progress information; will be slower on certain operations due to additional passing of the metadata +- You can set the log level of the program with =--debug=, =--info=, =--warning=, =--error=, and =--critical=. +- =-v, --verbose= - alias for =--info= +- =-p, --progress= - show progress information; will be slower on certain operations due to additional passing of the metadata Keep in mind, Borg doesn't have global configuration files, only per-repo configurations. You can create configurations with a little hard work and shell scripts. diff --git a/structured/cli.ffmpeg.org b/structured/cli.ffmpeg.org index f113e5f..876918e 100644 --- a/structured/cli.ffmpeg.org +++ b/structured/cli.ffmpeg.org @@ -1,6 +1,6 @@ #+title: Command line: FFmpeg #+date: "2021-05-09 16:40:50 +08:00" -#+date_modified: "2021-06-19 17:43:07 +08:00" +#+date_modified: "2021-07-08 17:52:54 +08:00" #+language: en #+property: header-args :eval no @@ -15,17 +15,17 @@ The swiss army knife for interacting with multimedia files (except images becaus The FFmpeg command line interface is mostly picky because of order. Whatever options are given will be processed with those options in order. -- ~-hide_banner~ - hide the annoying banner -- ~-loglevel [level] | -v [level]~ - set the verbosity level -- ~-codecs~ - list all codecs -- ~-devices~ - list all devices -- ~-i [file]~ - the input file -- ~c [codec]~ - set the codec -- ~-b [rate]~ - set the bitrate -- ~-o [file]~ - set the output +- =-hide_banner= - hide the annoying banner +- =-loglevel [level] | -v [level]= - set the verbosity level +- =-codecs= - list all codecs +- =-devices= - list all devices +- =-i [file]= - the input file +- =c [codec]= - set the codec +- =-b [rate]= - set the bitrate +- =-o [file]= - set the output Certain options have the option of specifying whether you're interacting with the audio or video track. -For example, ~-codec:audio~ (~-c:a~) to set the audio codec. +For example, =-codec:audio= (=-c:a=) to set the audio codec. diff --git a/structured/cli.journalctl.org b/structured/cli.journalctl.org index 15f56dc..3682c16 100644 --- a/structured/cli.journalctl.org +++ b/structured/cli.journalctl.org @@ -1,6 +1,6 @@ #+title: Command line: journalctl #+date: "2021-05-20 23:07:39 +08:00" -#+date_modified: "2021-06-19 17:43:20 +08:00" +#+date_modified: "2021-07-10 22:19:08 +08:00" #+language: en #+property: header-args :results none @@ -16,13 +16,13 @@ For more information, see =journalctl.1= manual page. * Options -- ~-b, --boot~ - show the logs starting from boot time -- ~-e, --pager-end~ - go to the end of the logs -- ~-f, --follow~ - watch the logs -- ~--user-unit~ - show logs from a user unit -- ~-u, --unit [UNIT]~ - show the logs of a system unit -- ~--vacuum-time=[TIMESPAN]~ - delete logs older than the specified timespan [fn:: View =systemd.time.5= for more information.] -- ~-x, --catalog~ - prints helpful messages such as the documentation URIs +- =-b, --boot= - show the logs starting from boot time +- =-e, --pager-end= - go to the end of the logs +- =-f, --follow= - watch the logs +- =--user-unit= - show logs from a user unit +- =-u, --unit [UNIT]= - show the logs of a system unit +- =--vacuum-time [TIMESPAN]= - delete logs older than the specified timespan [fn:: View =systemd.time.5= for more information.] +- =-x, --catalog= - prints helpful messages such as the documentation URIs diff --git a/structured/cli.youtube-dl.org b/structured/cli.youtube-dl.org new file mode 100644 index 0000000..817b467 --- /dev/null +++ b/structured/cli.youtube-dl.org @@ -0,0 +1,74 @@ +#+title: Command-line: youtube-dl +#+date: "2021-07-08 17:36:26 +08:00" +#+date_modified: "2021-07-08 19:02:10 +08:00" +#+language: en +#+property: header-args :eval no + + +One of the archivists' best friends. +At least you don't have to go to those shady YouTube conversion sites anymore when you have a [[https://ytdl-org.github.io/youtube-dl/supportedsites.html][complete list of other video sites]] you can download from. + + + + +* Synopsis + +#+begin_src shell +youtube-dl [OPTIONS...] [URLS...] +#+end_src + + + + +* Options + +- =--add-metadata= - add metadata to the resulting file +- =--audio-format [EXTENSION]= - download the video with the select format of "opus", "mp3", "opus", and "vorbis"; but there is also the convenient "best" option +- =--audio-quality [QUALITY]= - quality of the audio from 0 to 9, best to worst respectively; bitrates are also accepted (e.g., =320K=, =1M=) +- =--config-location [PATH]= - set the config to be used; useful for local configs with specific options +- =-F, --list-format= - prints a list of format available for downloading +- =--format [QUALITY]= - download the video with the format shown in =--list-format=; there are convenient options such as =bestaudio= and =bestvideo= referring to the best quality it could find +- =-j, --dump-json= - dry-run and prints in JSON format +- =--no-overwrite= - error if the file already exists which is handy for scripts +- =--write-sub= - writes the subtitle file into disk +- =-x, --extract-audio= - extract only the audio track + + + + +* Examples + +Here is an entryway into your newfound archiving habit. +Enjoy! :) + + +** Download the thumbnail and the audio of the video + +Very simple. +Very useful as most of the thumbnails can go to high resolution and if you need them for some reason. + +#+begin_src shell +youtube-dl --write-thumbnail --extract-audio https://www.youtube.com/watch?v=wy9VvdaLuSs +#+end_src + + +** Download an entire album + +Though, you should look at the supported sites if it supports downloading an album out of the URL. +In this example, we have Bandcamp. + +#+begin_src shell +youtube-dl --output '%(title)s.%(ext)s' --format bestaudio https://gametal.bandcamp.com/album/side-quests-vol-3 +#+end_src + + +** Specific video download requirements + +In this example, I want to download a video with a width of 1080px and the best video and audio at 320Kbit/s. +Oh, and the video should be in MP4 and the audio in Opus. + +This is will only succeed if the format is available to download which you can do with =--list-format=. + +#+begin_src shell +youtube-dl --format 'bestvideo[width=1080,ext=mp4]+bestaudio[abr=320K,ext=opus]' https://www.youtube.com/watch?v=wy9VvdaLuSs +#+end_src diff --git a/structured/cloud.github-actions.org b/structured/cloud.github-actions.org index 6a7ae22..b5447b2 100644 --- a/structured/cloud.github-actions.org +++ b/structured/cloud.github-actions.org @@ -3,7 +3,7 @@ :END: #+title: GitHub Actions #+date: "2021-06-20 18:58:48 +08:00" -#+date_modified: "2021-07-05 01:46:35 +08:00" +#+date_modified: "2021-07-07 16:43:41 +08:00" #+language: en @@ -19,6 +19,7 @@ - each step make uses an action which is basically a script; it can interact with the repo or do something else entirely without ever touching it - you can use already defined actions or with your own +- if you want to explore other options, the [[https://github.com/marketplace][GitHub marketplace]] allows searching for various third-party actions