hon@hon.one %!s(int64=3) %!d(string=hai) anos
pai
achega
7ec89340e7

+ 25 - 0
config/cloud/azure.md

@@ -0,0 +1,25 @@
+---
+title: Azure
+breadcrumbs:
+- title: Configuration
+- title: Cloud
+---
+{% include header.md %}
+
+## Virtual Machines Setup
+
+### Networking
+
+- For IPv6 support, you apparently need to create a new VM.
+- You're forced to use NAT (with an internal network conneted to the VM) both for IPv4 and IPv6 (which is just disgusting).
+- Some guides may tell you that you need to create a load balancer in order to add IPv6 to VMs, but that's avoidable.
+- ICMPv6 is completely broken. You can't ping over IPv6, path MTU discovery (PMTUD) is broken, etc. Broken PMTUD can be avoided by simply setting the link MTU from 1500 to 1280 (the minimum for IPv6).
+- The default ifupdown network config (which uses DHCP for v4 and v6) broke IPv6 connectivity for me after a while for some reason. Switching to systemd-networkd with DHCP and disabling Ifupdown (comment out everything in `/etc/network/interfaces` and mask `ifup@eth0.service`) solved this for me.
+- If you configure non-Azure DNS servers in the VM config, it will seemingly only add one of the configured servers to `/etc/resolv.conf`. **TODO** It stops overriding `/etc/resolv.conf` if using Azure DNS servers?
+- Adding IPv6 to VM:
+    1. Note: This was written afterwards, I may be forgetting some steps.
+    1. Create an IPv4 address and an IPv6 address.
+    1. In the virtual network for the VM, add a ULA IPv6 address space (e.g. an `fdXX:XXXX:XXXX::/48`). Then modify the existing subnet (e.g. `default`), tick the "Add IPv6 address space" box and add a /64 subnet from the address space you just added.
+    1. In the network interface for the VM, configure the primary config to use the private IPv4 subnet and the public IPv4 address. Add a new secondary config for for the IPv6 (private) ULA subnet and the (public) GUA.
+
+{% include footer.md %}

+ 1 - 1
config/general/general.md

@@ -1,5 +1,5 @@
 ---
-title: General Notes
+title: General
 breadcrumbs:
 - title: Configuration
 - title: General

+ 1 - 1
config/linux-server/debian.md

@@ -329,7 +329,7 @@ Everything here is optional.
 
 - Test with `perl -e exit`. It will complain if there's an error.
 - Check the locale: `locale`
-- Comment `AcceptEnv LANG LC_*` in `/etc/ssh/sshd_config` to prevent clients bringing their own locale.
+- Comment `AcceptEnv LANG LC_*` in `/etc/ssh/sshd_config` to prevent remote clients bringing their own locale.
 
 **Boot volume is full**:
 

+ 53 - 0
config/media/ffmpeg.md

@@ -0,0 +1,53 @@
+---
+title: FFmpeg
+breadcrumbs:
+- title: Configuration
+- title: Media
+---
+{% include header.md %}
+
+## Resources
+
+- [steven2358's FFmpeg cheat sheet](https://gist.github.com/steven2358/ba153c642fe2bb1e47485962df07c730)
+
+## General
+
+- **TODO** Find my other FFmpeg notes.
+- Install:
+    - Linux (Ubuntu): `apt install ffmpeg`
+    - Windows: Download the binary.
+- View video feed: `ffplay <dev>`
+    - For some reason this typically uses a limited framerate and resolution.
+- Options:
+    - `-crf 23`: Constant rate factor. Defaults to 23. Set to 0 for lossless video.
+
+## Examples
+
+### Recording
+
+- Record stream to file, automatically split every X seconds, restart if the stream is unavailable:
+    - Script: `while true; do ffmpeg -hide_banner -loglevel error -i http://localhost:5555/ -c copy -map 0 -f segment -segment_time $((5*60)) -segment_format mp4 -strftime 1 "%Y-%m-%d_%H-%M-%S.mp4"; sleep 1; done`
+- Record time lapse at 10x speed without audio:
+    - Command: `ffmpeg -i http://localhost:5555/ -filter:v "setpts=0.1*PTS" -an out.mkv`
+
+## Tasks
+
+### Concatenate Video Files
+
+Useful e.g. to recombine video files for recorders which automatically splits the recording.
+
+1. `ffmpeg -f concat -safe 0 -i <(for f in ./*.MP4; do echo "file '$PWD/$f'"; done) -c copy output.MP4`
+    - For lexicographically sorted files ending in `.MP4`.
+
+### Speed Up/Slow Down Video, but Keep All Frames
+
+Useful e.g. to change the framerate of a video-only timelapse video.
+
+See: [Speeding up/slowing down video (FFmpeg)](https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video)
+
+1. Convert to raw bitstream:
+    - H.264: `ffmpeg -i input.mp4 -map 0:v -c:v copy -bsf:v h264_mp4toannexb raw.h264`
+    - H.265: `ffmpeg -i input.mp4 -map 0:v -c:v copy -bsf:v hevc_mp4toannexb raw.h265`
+1. Generate new video: `ffmpeg -fflags +genpts -r <fps> -i raw.h264 -c:v copy output.mp4` (for desired frame rate `fps`)
+
+{% include footer.md %}

+ 22 - 0
config/media/general.md

@@ -0,0 +1,22 @@
+---
+title: "Media: General"
+breadcrumbs:
+- title: Configuration
+- title: Media
+---
+{% include header.md %}
+
+## Formats
+
+### Video
+
+- MP4 (aka MPEG-4 Part 14):
+    - A container format (using other formats internally like e.g. H.264 for the video part).
+- H.264 (aka AVC):
+    - Aka Advanced Video Coding (AVC) or MPEG-4 Part 10.
+    - One of the most commonly used, implemented in many products.
+- H.265 (aka HEVC):
+    - Aka High-Efficiency Video Coding (HEVC).
+    - The successor to H.264/AVC and better in most ways, but not as popular yet.
+
+{% include footer.md %}

+ 41 - 0
config/media/v4l2.md

@@ -0,0 +1,41 @@
+---
+title: Video4Linux 2 (V4L2)
+breadcrumbs:
+- title: Configuration
+- title: Media
+---
+{% include header.md %}
+
+A tool to manage video input devices (mainly webcams).
+
+## Setup
+
+- Install: `apt install v4l-utils`
+
+## Usage
+
+- Show video devices:
+    - List devices: `v4l2-ctl --list-devices`
+    - Show brief device info: `v4l2-ctl [-d <dev>] --info`
+    - Show extended device info: `v4l2-ctl [-d <dev>] --all`
+    - Show device formats: `v4l2-ctl [-d <dev>] --info --list-formats`
+    - If no device is specified, it defaults to `/dev/video0`.
+    - Certain devices show up as multiple `/dev/video*` files. Typically there's one video capture device and one metadata capture device. Use the command above to find out.
+- Modify video device properties:
+    - Show properties with min, max and current values: `v4l2-ctl [-d <dev>] --all`
+    - Different webcams come with different properties and property names.
+    - Change a property (non-permanent): `v4l2-ctl [-d <dev>] -c <property>=<value>`
+    - Properties may be modified while the device is in use.
+    - As property changes are not permanent, you may want to set them in a script or something.
+    - Higher exposure may lead to reduced frame rate. To make it brighter you may increase the gain instead.
+    - Focus and white balance _can_ typically be left at auto. Brightness, contrast and saturation _should_ typically be left at default.
+    - Logitech C920 and similar:
+        - Disable auto focus: `focus_auto=0`
+        - Disable auto exposure: `exposure_auto=1`
+        - Set exposure manually (after auto is disabled): `exposure_absolute=250`
+        - Set gain: `gain=250`
+        - Disable auto white balance: `white_balance_temperature_auto=0`
+        - Set white balance manually (after auto is disabled): `white_balance_temperature=4000`
+        - Set brightness, contrast and saturation (generally not needed): `brightness=128`, `contrast=128`, `saturation=128`
+
+{% include footer.md %}

+ 3 - 21
config/media/video-processing.md

@@ -6,28 +6,10 @@ breadcrumbs:
 ---
 {% include header.md %}
 
-## FFmpeg
+_See the other pages in this category._
 
-For general notes and streaming video notes, see the [Video Streaming](../video-streaming/) page.
+## General
 
-### Tasks
-
-#### Concatenate Video Files
-
-Useful e.g. to recombine video files for recorders which automatically splits the recording.
-
-1. `ffmpeg -f concat -safe 0 -i <(for f in ./*.MP4; do echo "file '$PWD/$f'"; done) -c copy output.MP4`
-    - For lexicographically sorted files ending in `.MP4`.
-
-#### Speed Up/Slow Down Video, but Keep All Frames
-
-Useful e.g. to change the framerate of a video-only timelapse video.
-
-See: [Speeding up/slowing down video (FFmpeg)](https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video)
-
-1. Convert to raw bitstream:
-    - H.264: `ffmpeg -i input.mp4 -map 0:v -c:v copy -bsf:v h264_mp4toannexb raw.h264`
-    - H.265: `ffmpeg -i input.mp4 -map 0:v -c:v copy -bsf:v hevc_mp4toannexb raw.h265`
-1. Generate new video: `ffmpeg -fflags +genpts -r <fps> -i raw.h264 -c:v copy output.mp4` (for desired frame rate `fps`)
+- Show media info about some media file: `mediainfo <file>` (requires `mediainfo`)
 
 {% include footer.md %}

+ 1 - 32
config/media/video-ripping.md

@@ -6,38 +6,7 @@ breadcrumbs:
 ---
 {% include header.md %}
 
-## Download Videos from YouTube and Sites
-
-Using [youtube-dl](http://ytdl-org.github.io/youtube-dl/) ([repo](https://github.com/ytdl-org/youtube-dl)).
-
-- Examples:
-    - YouTube video/xyz in Docker: `docker run --rm -v//$PWD:/downloads wernight/youtube-dl -iwc -f bestvideo+bestaudio --cookie ~/cookies.txt -o "%(uploader)s (%(upload_date)s) - %(title)s [%(id)s].%(ext)s"`
-    - YouTube video/channel/playlist w/ cookie: `youtube-dl -iwc -f bestvideo+bestaudio --cookie ~/cookies.txt -o "%(uploader)s (%(upload_date)s) - %(title)s [%(id)s].%(ext)s" <url>`
-- Run in Docker:
-    - Using ([wernight's image](https://github.com/wernight/docker-youtube-dl)).
-    - Command prefix: `docker run --rm -v//$PWD:/downloads wernight/youtube-dl <...>`
-- Run binary:
-    - Find the download instructions in the repo.
-    - Install "ffmpeg" to allow downloading best quality audio and video: `apt install ffmpeg`
-- Download single video: `youtube-dl -c <URL>`
-    - `-c`/`--continue` to re-run the command if it previously failed during download.
-- Download full channel or playlist: `youtube-dl -qiwc --no-warnings [-o <format>] <URL>`
-    - `-q`/`--quiet` and `--no-warnings` to only errors. Alternatively, redirect STDERR to a log file and keep STDOUT non-quiet to be able to check the status. There may be videos that fail to download for different reasons, so do watch for errors.
-    - `-i`/`--ignore-errors` to avoid stopping on errors.
-    - `-wc`/`--no-overwrites --continue` to download only new/missing videos.
-    - `-o <format>` to specify the output filename format. See below.
-- Video quality:
-    - Specify `-f bestvideo+bestaudio` to download the best video format and best audio format and (by default) merge them. This is the default, but only as long as "ffmpeg" is installed. If it's not installed and this option is not specified, it may instead download a lower quality format.
-- Download audio from video: `youtube-dl -c --extract-audio --audio-quality 0`
-    - `--audio-format <format>`: Audio format, like "mp3", "wav", etc. Defaults to "best".
-    - `--audio-quality <0-9>`: Audio quality, where 0 is best. Defaults to "5".
-- Modify the output file path and name:
-    - Supports a Python-style format string.
-    - See [output template (youtube-dl)](https://github.com/ytdl-org/youtube-dl#output-template) for a list of variables.
-    - Example: `-o "%(uploader)s (%(upload_date)s) - %(title)s [%(id)s].%(ext)s"`
-- Common warnings and errors:
-    - "*WARNING: Requested formats are incompatible for merge and will be merged into mkv.*": The best quality video and audio are different formats and will therefore be merged into an MKV file. This is completely fine.
-    - "*ERROR: [...]: YouTube said: Unable to extract video data*": Try to open the video in an incognito browser to check what's up with it. If it requires you to log in, you may need to specify cookies and possibly your user agent. To specify cookies, log into a browser (Firefox or Chrome), export the cookies to file using the "cookie.txt" extension, and specify the cookie file for youtube-dl with the `--cookie <file>` option (see [How do I pass cookies to youtube-dl? (youtube-dl)](https://github.com/ytdl-org/youtube-dl/blob/master/README.md#how-do-i-pass-cookies-to-youtube-dl)).
+_See the other pages in this category._
 
 ## Rip DVDs (Linux)
 

+ 3 - 138
config/media/video-streaming.md

@@ -6,6 +6,8 @@ breadcrumbs:
 ---
 {% include header.md %}
 
+_See the other pages in this category._
+
 ## General
 
 - Resources:
@@ -14,143 +16,6 @@ breadcrumbs:
 ## Hardware
 
 - Some webcams come with H264 hardware encoders. Notably, Logitech's C920/C922 had a H264 hardware encoder in earlier versions but then removed it.
-- Webcams may require/reserve a lot of bandwidth, so try to avoid USB hubs.
-
-## VLC
-
-- Resources:
-    - [Command line (VideoLAN)](https://wiki.videolan.org/Documentation:Command_line/)
-    - [Command line streaming (VideoLAN)](https://wiki.videolan.org/Documentation:Streaming_HowTo/Advanced_Streaming_Using_the_Command_Line/)
-    - [Command line streaming examples (VideoLAN)](https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/)
-    - [Streaming over IPv6 (VideoLAN)](https://wiki.videolan.org/Documentation:Streaming_HowTo/Streaming_over_IPv6/)
-- Hide GUI:
-    - Linux: Use `cvlc` instead of `vlc`.
-    - Windows: Specify `-I dummy --dummy-quiet`.
-
-### Access Modules
-
-- Screen capture (`screen`):
-    - [screen module (VideoLAN)](https://wiki.videolan.org/Documentation:Modules/screen/)
-    - Super laggy.
-    - Captures all screens by default. Specify coordinates and dimensions to capture a specific screen or section.
-    - CLI format: `screen//`
-    - CLI example: `screen:// --screen-top=0 --screen-left=1920 --screen-width=1920 --screen-height=1080`
-- Video4Linux 2 (`v4l2`) (Linux):
-    - [v4l2 module (VideoLAN)](https://wiki.videolan.org/Documentation:Modules/v4l2/)
-    - Requires V4L2 to be installed. `v4l2-ctl` can be used to control video/webcamera settings. See separate section about V2L2.
-    - CLI format: `v4l2://<dev> [v4l2-options]`
-    - CLI example: `v4l2:///dev/video0:width=1920:height=1080:fps=30:chroma=mjpg` (**TODO** v4l2 prefix and `--` instead of `:`?)
-    - Specify format: `chroma=<format>` (e.g. `mjpg` or `h264` if supported) (`yuyv` may be the default and gives terrible frame rate)
-    - Specify width, height, frame rate: `width=1920:height=1080:fps=30` (1080p)
-- DirectShow (`dshow`) (Windows):
-    - CLI format: `dshow:// [dshow-options]`
-    - CLI example: `dshow:// --dshow-vdev="Game Capture HD60 S (Video) (#01)" --dshow-adev=none  --dshow-aspect-ratio=16:9 --dshow-fps=60`
-    - You can open "open capture device", select the device and selecting "show more options" in the GUI to find the exact names of the audio and video devices.
-
-### Stream Output Modules
-
-- Specify chain of output modules: `--sout=#module1{options}:module2{options}:module3...`
-- Standard (`standard`/`std`):
-    - Save the stream to file or send it over a network.
-    - HTTP example: `--sout='#[...]:standard{access=http,mux=ts}' --http-host=localhost --http-port=5555`
-    - The `ts` mux is the most common one.
-- Transcode (`transcode`):
-    - Transcode the video.
-    - Codec list: [Codec (VideoLAN)](https://wiki.videolan.org/Codec/)
-    - Specify video codec using `vcodec=` and audio codec using `acodec=`. Use `none` to disable audio or video. Common video codecs include `h264` (very good and very intense), `mp2v` (good quality but bad/small compression) and `mp4v` (better compression).
-    - Specify the video and audio buffer sizes in kB/s using `vb=` and `ab=`.
-    - Specify `deinterlace` when using an interlaced source to improbe the quality a little.
-- Duplicate (`duplicate`):
-    - Duplicate the feed, e.g. to send it to different destinations.
-- Display (`display`):
-    - Show the input stream locally. Can be used to verify that the input or previous parts chain is working as expected. Can be used with `duplicate` to monitor the stream.
-- RTP/RTSP (`rtp`):
-    - Stream as RTP, optionally with RTSP.
-    - Basic example: `rtp{mux=ts,dst=<addr>,port=<port>}`
-    - `dst` must be some destination unicast or multicast address. `port` may be omitted to use the default.
-    - Uses UDP by default.
-
-### Video and Sub Filter Modules
-
-- Specified using `--sub-source=<...>`.
-- Marquee (`marq`):
-    - [marq module (VideoLAN)](https://wiki.videolan.org/Documentation:Modules/marq/)
-    - Show text and/or time on the screen.
-    - For positions and colors, see [time module (VideoLAN)](https://wiki.videolan.org/Documentation:Modules/time/).
-    - To show it in the output stream, specify the `sfilter=marq` transcode option instead of using `--video-filter=logo`.
-    - Example (local): `--sub-source=marq --marq-marquee="%Y-%m-%d, %H:%M:%S" --marq-position=9 --marq-color=0xFFFFFF --marq-size=20`
-- Logo (`logo`):
-    - [logo module (VideoLAN)](https://wiki.videolan.org/Documentation:Modules/logo/)
-    - [HowTo Add a logo (VideoLAN)](https://wiki.videolan.org/VLC_HowTo/Add_a_logo/)
-    - Show one or a series of looping images.
-    - The image doesn't seem to be scalable, so scale the file beforehand.
-    - To show it in the output stream, specify the `sfilter=logo` transcode option instead of using `--video-filter=logo`.
-    - Example (local): `--video-filter=logo --logo-file=/c/Users/1234 --logo-position=0 --logo-opacity=255`
-
-### View Stream
-
-- View stream: `vlc <proto>://<host>[:port][/path]`
-- Specify `--network-caching=100` (milliseconds) to reduce network buffering causing delay (default to 1 second).
-- Use `cvlc` (Linux) or specify `-I dummy --dummy-quiet` to not use the full GUI.
-- Specify `--fullscreen` to start in full screen.
-
-### Stream Examples
-
-- Stream webcam with RTP (no RTSP) (Linux):
-    - Command: `cvlc v4l2:///dev/video0:width=1920:height=1080:fps=30:chroma=mjpg --live-caching=10 --sout='#transcode{vcodec=mp4v,acodec=none}:rtp{mux=ts,dst=localhost}'`
-    - `dst` is the destination unicast or multicast address to continuously stream to.
-- Stream webcam with HTTP (Linux):
-    - Command: `cvlc v4l2:///dev/video0:width=1920:height=1080:fps=30:chroma=mjpg --live-caching=10 --sout='#transcode{vcodec=mp4v,acodec=none}:standard{access=http,mux=ts}' --http-host=localhost --http-port=5555`
-    - HTTP streams may be easily used as sources in e.g. OBS.
-- Stream capture card to display and HTTP stream (Windows):
-    - Command: `./vlc -I dummy --dummy-quiet dshow:// --dshow-vdev="Game Capture HD60 S (Video) (#01)" --dshow-adev=none  --dshow-size=1920x1080 --dshow-aspect-ratio=16:9 --dshow-fps=60  --live-caching=10 --sout='#transcode{vcodec=mp2v,acodec=none,sfilter=logo}:duplicate{dst=display,dst=standard{access=http,mux=ts}}' --http-host=localhost --http-port=5555`
-- Record network stream to file (Linux):
-    - Command: `cvlc <input> --sout='#transcode{vcodec=mp4v,acodec=none}:std{access=file,mux=ps,dst=test.mpg}'`
-
-## FFmpeg
-
-- Install:
-    - Linux (Ubuntu): `apt install ffmpeg`
-    - Windows: Download the binary.
-- View video feed: `ffplay <dev>`
-    - For some reason this typically uses a limited framerate and resolution.
-- Options:
-    - `-crf 23`: Constant rate factor. Defaults to 23. Set to 0 for lossless video.
-
-### Examples
-
-- [steven2358's FFmpeg cheat sheet](https://gist.github.com/steven2358/ba153c642fe2bb1e47485962df07c730)
-- **TODO** Find my other FFmpeg notes.
-- Record stream to file, automatically split every X seconds, restart if the stream is unavailable:
-    - Script: `while true; do ffmpeg -hide_banner -loglevel error -i http://localhost:5555/ -c copy -map 0 -f segment -segment_time $((5*60)) -segment_format mp4 -strftime 1 "%Y-%m-%d_%H-%M-%S.mp4"; sleep 1; done`
-- Record time lapse at 10x speed without audio:
-    - Command: `ffmpeg -i http://localhost:5555/ -filter:v "setpts=0.1*PTS" -an out.mkv`
-
-## Video4Linux 2 (V4L2) (Linux)
-
-- Install: `apt install v4l-utils`
-- Show video devices:
-    - List devices: `v4l2-ctl --list-devices`
-    - Show brief device info: `v4l2-ctl [-d <dev>] --info`
-    - Show extended device info: `v4l2-ctl [-d <dev>] --all`
-    - Show device formats: `v4l2-ctl [-d <dev>] --info --list-formats`
-    - If no device is specified, it defaults to `/dev/video0`.
-    - Certain devices show up as multiple `/dev/video*` files. Typically there's one video capture device and one metadata capture device. Use the command above to find out.
-- Modify video device properties:
-    - Show properties with min, max and current values: `v4l2-ctl [-d <dev>] --all`
-    - Different webcams come with different properties and property names.
-    - Change a property (non-permanent): `v4l2-ctl [-d <dev>] -c <property>=<value>`
-    - Properties may be modified while the device is in use.
-    - As property changes are not permanent, you may want to set them in a script or something.
-    - Higher exposure may lead to reduced frame rate. To make it brighter you may increase the gain instead.
-    - Focus and white balance _can_ typically be left at auto. Brightness, contrast and saturation _should_ typically be left at default.
-    - Logitech C920 and similar:
-        - Disable auto focus: `focus_auto=0`
-        - Disable auto exposure: `exposure_auto=1`
-        - Set exposure manually (after auto is disabled): `exposure_absolute=250`
-        - Set gain: `gain=250`
-        - Disable auto white balance: `white_balance_temperature_auto=0`
-        - Set white balance manually (after auto is disabled): `white_balance_temperature=4000`
-        - Set brightness, contrast and saturation (generally not needed): `brightness=128`, `contrast=128`, `saturation=128`
+- Webcams may use a lot of data, so try to avoid congestion points like USB hubs.
 
 {% include footer.md %}

+ 116 - 0
config/media/vlc.md

@@ -0,0 +1,116 @@
+---
+title: VLC
+breadcrumbs:
+- title: Configuration
+- title: Media
+---
+{% include header.md %}
+
+## Resources
+
+- [Command line (VideoLAN)](https://wiki.videolan.org/Documentation:Command_line/)
+- [Command line streaming (VideoLAN)](https://wiki.videolan.org/Documentation:Streaming_HowTo/Advanced_Streaming_Using_the_Command_Line/)
+- [Command line streaming examples (VideoLAN)](https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/)
+- [Streaming over IPv6 (VideoLAN)](https://wiki.videolan.org/Documentation:Streaming_HowTo/Streaming_over_IPv6/)
+
+## General
+
+- Hide GUI:
+    - Linux: Use `cvlc` instead of `vlc`.
+    - Windows: Specify `-I dummy --dummy-quiet`.
+
+## Access Modules
+
+- Screen capture (`screen`):
+    - [screen module (VideoLAN)](https://wiki.videolan.org/Documentation:Modules/screen/)
+    - Super laggy.
+    - Captures all screens by default. Specify coordinates and dimensions to capture a specific screen or section.
+    - CLI format: `screen//`
+    - CLI example: `screen:// --screen-top=0 --screen-left=1920 --screen-width=1920 --screen-height=1080`
+- Video4Linux 2 (`v4l2`) (Linux):
+    - [v4l2 module (VideoLAN)](https://wiki.videolan.org/Documentation:Modules/v4l2/)
+    - Requires V4L2 to be installed. `v4l2-ctl` can be used to control video/webcamera settings. See separate section about V2L2.
+    - CLI format: `v4l2://<dev> [v4l2-options]`
+    - CLI example: `v4l2:///dev/video0:width=1920:height=1080:fps=30:chroma=mjpg` (**TODO** v4l2 prefix and `--` instead of `:`?)
+    - Specify format: `chroma=<format>` (e.g. `mjpg` or `h264` if supported) (`yuyv` may be the default and gives terrible frame rate)
+    - Specify width, height, frame rate: `width=1920:height=1080:fps=30` (1080p)
+- DirectShow (`dshow`) (Windows):
+    - CLI format: `dshow:// [dshow-options]`
+    - CLI example: `dshow:// --dshow-vdev="Game Capture HD60 S (Video) (#01)" --dshow-adev=none  --dshow-aspect-ratio=16:9 --dshow-fps=60`
+    - You can open "open capture device", select the device and selecting "show more options" in the GUI to find the exact names of the audio and video devices.
+
+## Stream Output Modules
+
+- Specify chain of output modules: `--sout=#module1{options}:module2{options}:module3...`
+- Standard (`standard`/`std`):
+    - Save the stream to file or send it over a network.
+    - HTTP example: `--sout='#[...]:standard{access=http,mux=ts}' --http-host=localhost --http-port=5555`
+    - The `ts` mux is the most common one.
+- Transcode (`transcode`):
+    - Transcode the video.
+    - Codec list: [Codec (VideoLAN)](https://wiki.videolan.org/Codec/)
+    - Specify video codec using `vcodec=` and audio codec using `acodec=`. Use `none` to disable audio or video. Common video codecs include `h264` (very good and very intense), `mp2v` (good quality but bad/small compression) and `mp4v` (better compression).
+    - Specify the video and audio buffer sizes in kB/s using `vb=` and `ab=`.
+    - Specify `deinterlace` when using an interlaced source to improbe the quality a little.
+- Duplicate (`duplicate`):
+    - Duplicate the feed, e.g. to send it to different destinations.
+- Display (`display`):
+    - Show the input stream locally. Can be used to verify that the input or previous parts chain is working as expected. Can be used with `duplicate` to monitor the stream.
+- RTP/RTSP (`rtp`):
+    - Stream as RTP, optionally with RTSP.
+    - Basic example: `rtp{mux=ts,dst=<addr>,port=<port>}`
+    - `dst` must be some destination unicast or multicast address. `port` may be omitted to use the default.
+    - Uses UDP by default.
+
+## Video and Sub Filter Modules
+
+- Specified using `--sub-source=<...>`.
+- Marquee (`marq`):
+    - [marq module (VideoLAN)](https://wiki.videolan.org/Documentation:Modules/marq/)
+    - Show text and/or time on the screen.
+    - For positions and colors, see [time module (VideoLAN)](https://wiki.videolan.org/Documentation:Modules/time/).
+    - To show it in the output stream, specify the `sfilter=marq` transcode option instead of using `--video-filter=logo`.
+    - Example (local): `--sub-source=marq --marq-marquee="%Y-%m-%d, %H:%M:%S" --marq-position=9 --marq-color=0xFFFFFF --marq-size=20`
+- Logo (`logo`):
+    - [logo module (VideoLAN)](https://wiki.videolan.org/Documentation:Modules/logo/)
+    - [HowTo Add a logo (VideoLAN)](https://wiki.videolan.org/VLC_HowTo/Add_a_logo/)
+    - Show one or a series of looping images.
+    - The image doesn't seem to be scalable, so scale the file beforehand.
+    - To show it in the output stream, specify the `sfilter=logo` transcode option instead of using `--video-filter=logo`.
+    - Example (local): `--video-filter=logo --logo-file=/c/Users/1234 --logo-position=0 --logo-opacity=255`
+
+## View Stream
+
+- View stream: `vlc <proto>://<host>[:port][/path]`
+- Specify `--network-caching=100` (milliseconds) to reduce network buffering causing delay (default to 1 second).
+- Use `cvlc` (Linux) or specify `-I dummy --dummy-quiet` to not use the full GUI.
+- Specify `--fullscreen` to start in full screen.
+
+## Examples
+
+### Media Processing
+
+- Convert/transcode or fix badly encoded files (GUI method):
+    1. Note: E.g. when othe programs complain that a GoPro video file is corrupted but VLC still manages to open it somehow.
+    1. Open VLC.
+    1. Go to "File", "Convert".
+    1. Open add the source files.
+    1. Press "Convert/save".
+    1. Select some appropriate profile/formats (use e.g. `mediainfo` to check the format of the source files).
+    1. Wait for the playlist to finish "playing" (kinda weird but whatever).
+- Concatenate files (no transcoding): `cvlc <input-files-ordered> --sout "#gather:std{access=file,dst=full.mp4}" --sout-keep` (**TODO** `cvlc` doesn't exit when done for me, maybe use `vlc` and manually close the window when it's visually done instead.)
+
+### Streaming
+
+- Stream webcam with RTP (no RTSP) (Linux):
+    - Command: `cvlc v4l2:///dev/video0:width=1920:height=1080:fps=30:chroma=mjpg --live-caching=10 --sout='#transcode{vcodec=mp4v,acodec=none}:rtp{mux=ts,dst=localhost}'`
+    - `dst` is the destination unicast or multicast address to continuously stream to.
+- Stream webcam with HTTP (Linux):
+    - Command: `cvlc v4l2:///dev/video0:width=1920:height=1080:fps=30:chroma=mjpg --live-caching=10 --sout='#transcode{vcodec=mp4v,acodec=none}:standard{access=http,mux=ts}' --http-host=localhost --http-port=5555`
+    - HTTP streams may be easily used as sources in e.g. OBS.
+- Stream capture card to display and HTTP stream (Windows):
+    - Command: `./vlc -I dummy --dummy-quiet dshow:// --dshow-vdev="Game Capture HD60 S (Video) (#01)" --dshow-adev=none  --dshow-size=1920x1080 --dshow-aspect-ratio=16:9 --dshow-fps=60  --live-caching=10 --sout='#transcode{vcodec=mp2v,acodec=none,sfilter=logo}:duplicate{dst=display,dst=standard{access=http,mux=ts}}' --http-host=localhost --http-port=5555`
+- Record network stream to file (Linux):
+    - Command: `cvlc <input> --sout='#transcode{vcodec=mp4v,acodec=none}:std{access=file,mux=ps,dst=test.mpg}'`
+
+{% include footer.md %}

+ 101 - 0
config/media/youtube-dl.md

@@ -0,0 +1,101 @@
+---
+title: youtube-dl
+breadcrumbs:
+- title: Configuration
+- title: Media
+---
+{% include header.md %}
+
+A tool for downloading videos from a variety of site (not just YouTube).
+
+## Resources
+
+- [Homepage](http://ytdl-org.github.io/youtube-dl/)
+- [Repo](https://github.com/ytdl-org/youtube-dl)
+
+## Usage
+
+- Run in Docker:
+    - Using ([wernight's image](https://github.com/wernight/docker-youtube-dl)).
+    - Command prefix: `docker run --rm -v//$PWD:/downloads wernight/youtube-dl <...>`
+- Run binary:
+    - Find the download instructions in the repo.
+    - Install "ffmpeg" to allow downloading best quality audio and video: `apt install ffmpeg`
+- Download single video: `youtube-dl -c <URL>`
+    - `-c`/`--continue` to re-run the command if it previously failed during download.
+- Download full channel or playlist: `youtube-dl -qiwc --no-warnings [-o <format>] <URL>`
+    - `-q`/`--quiet` and `--no-warnings` to only errors. Alternatively, redirect STDERR to a log file and keep STDOUT non-quiet to be able to check the status. There may be videos that fail to download for different reasons, so do watch for errors.
+    - `-i`/`--ignore-errors` to avoid stopping on errors.
+    - `-wc`/`--no-overwrites --continue` to download only new/missing videos.
+    - `-o <format>` to specify the output filename format. See below.
+- Video quality:
+    - Specify `-f bestvideo+bestaudio` to download the best video format and best audio format and (by default) merge them. This is the default, but only as long as "ffmpeg" is installed. If it's not installed and this option is not specified, it may instead download a lower quality format.
+- Download audio from video: `youtube-dl -c --extract-audio --audio-quality 0`
+    - `--audio-format <format>`: Audio format, like "mp3", "wav", etc. Defaults to "best".
+    - `--audio-quality <0-9>`: Audio quality, where 0 is best. Defaults to "5".
+- Modify the output file path and name:
+    - Supports a Python-style format string.
+    - See [output template (youtube-dl)](https://github.com/ytdl-org/youtube-dl#output-template) for a list of variables.
+    - Example: `-o "%(uploader)s (%(upload_date)s) - %(title)s [%(id)s].%(ext)s"`
+
+## Examples
+
+- YouTube video/xyz in Docker: `docker run --rm -v//$PWD:/downloads wernight/youtube-dl -iwc -f bestvideo+bestaudio --cookie ~/cookies.txt -o "%(uploader)s (%(upload_date)s) - %(title)s [%(id)s].%(ext)s"`
+- YouTube video/channel/playlist w/ cookie: `youtube-dl -iwc -f bestvideo+bestaudio --cookie ~/cookies.txt -o "%(uploader)s (%(upload_date)s) - %(title)s [%(id)s].%(ext)s" <url>`
+
+## Troubleshooting
+
+- "*WARNING: Requested formats are incompatible for merge and will be merged into mkv.*": The best quality video and audio are different formats and will therefore be merged into an MKV file. This is completely fine.
+- "*ERROR: [...]: YouTube said: Unable to extract video data*": Try to open the video in an incognito browser to check what's up with it. If it requires you to log in, you may need to specify cookies and possibly your user agent. To specify cookies, log into a browser (Firefox or Chrome), export the cookies to file using the "cookie.txt" extension, and specify the cookie file for youtube-dl with the `--cookie <file>` option (see [How do I pass cookies to youtube-dl? (youtube-dl)](https://github.com/ytdl-org/youtube-dl/blob/master/README.md#how-do-i-pass-cookies-to-youtube-dl)).
+
+## Rip DVDs (Linux)
+
+CDs and DVDs use 2048 byte sectors and may have both unintentional and intentional data errors.
+Some will explode in size when you try to rip them.
+There are multiple methods to try.
+I recommend using ddrescue since it's the simplest and because of its error handling features.
+
+Install support for encrypted/protected DVDs:
+- Enable the `contrib` or `non-free` repo areas (I'm not sure which).
+- `apt install libdvd-pkg && dpkg-reconfigure libdvd-pkg`
+
+Gather information about the disc:
+- (Once) `apt install genisoimage`
+- `isoinfo -d -i /dev/sr0`
+
+#### Using dvdbackup
+
+1. (Once) `apt install dvdbackup`
+1. (Optional) Inspect the DVD: `dvdbackup -i /dev/sr0 -I`
+1. Rip the whole DVD to a subdirectory: `dvdbackup -i /dev/sr0 -o . -M`
+1. Make an ISO: `genisoimage -dvd-video -udf -o <name>{.iso,}`
+
+#### Using vobcopy
+
+1. (Once) `apt install vobcopy`
+1. Mount the disc: `mkdir -p /media/dvd && mount /dev/dvd /media/dvd`
+1. Rip it to the current dir: `vobcopy -i /media/dvd -l -m`
+1. Unmount the disc: `umount /media/dvd`
+
+#### Using dd
+
+If the disc is damaged, use ddrescue instead.
+
+1. Find sector size and count: `isosize -x /dev/sr0`
+1. `dd if=/dev/sr0 of=<name>.iso bs=2048 count=3659360 conv=noerror status=progress`
+    - `conv=noerror` prevents halting on error and writes zero to the output instead.
+
+#### Using GNU ddrescue
+
+ddrescue is a sophisticated recovery tool which gracefully handles read errors.
+When using a map file, it can be aborted and run multiple times and using different sources to try to fix corrupt sections.
+A typical way to use this method is to run it with fast options first and then optionally with slower options afterwards.
+When the output is a regular file, the corrupt sectors will contain zeros.
+This method can also be used to backup dying hard drives etc., but the options used below are for CD/DVD discs.
+
+1. (Once) `apt install gddrescue`
+1. Make sure the disk/disc is not mounted.
+1. Run without scraping: `ddrescue -n -b2048 /dev/sr0 <name>.{iso,map}`
+1. Run with direct access: `ddrescue -d -r1 -b2048 /dev/sr0 <name>.{iso,map}`
+
+{% include footer.md %}

+ 154 - 8
config/network/fs-fsos-switches.md

@@ -26,11 +26,141 @@ breadcrumbs:
 
 Using an FS S5860-20SQ.
 
-**TODO**
+Using an FS S3700-24T4F (access) and an FS S5860-20SQ (core).
+
+1. Connect to the switch using serial.
+    - Using RS-232 w/ RJ45, baud 115200, 8 data bits, no parity bits, 1 stop bit, no flow control.
+    - Use `Ctrl+H` for backspace.
+1. You should already be in the unprivileged exec mode (with `FS>` prompt).
+1. Enter privileged exec mode: `enable`
+    - The prompt should change from `>` tp `#`.
+1. (Optional) Show version: `show version`
+    - See the note below on how to upgrade it.
+1. Make sure it's running in standalone mode (no stacking): `switch convert mode standalone`
+1. Enter config mode: `conf`
+    - The prompt should change from `#` tp `(config)#`.
+1. Set hostname:
+1. Enable password services:
+    1. Enable automatic hashing of passwords (using some weak alg.): `service password-encryption`
+1. Add user: `username <username> privilege 15 password 0 <password>`
+1. Disable admin user: `no username admin`
+1. Setup basic authentication (defaults to local):
+    1. Enable new model: `aaa new-model`
+    1. Disable enable authn: `aaa authentication enable default none`
+    1. Enable login authn using local users: `aaa authentication login default local`
+1. Enable login for console:
+    1. Enter line config: `line con 0` (leave with `exit`)
+    1. Use default authentication (e.g. local): `login authentication default`
+1. Disable web server and telnet server, enable SSH server:
+    1. Disable web server: `no enable service web-server`
+    1. Disable telnet server: `no enable service telnet-server`
+    1. Enable SSH server: `enable service ssh-server`
+    1. Enter VTY lines: `line vty 0 35`
+    1. Use default authentication (e.g. local): `login authentication default`
+1. (Optional) Disable inactivity timeout:
+    1. Note: For prod systems you should keep this disabled, but it's really annoying when labbing.
+    1. Enter console line.
+    1. Disable timer: `exec-timeout 0`
+1. (Optional) Disable management interface:
+    1. Enter: `int mgmt 0`
+    1. Disable: `shut`
+    1. Remove address: `no ip addr`
+1. Disable unused interfaces:
+    1. Enter physical interface range (e.g. `int range te0/1-20`).
+    1. Disable them: `shutdown`
+1. (Meta) Setup basic interface:
+    1. Note: Applies to most interfaces.
+    1. Set description: `description <description>`
+    1. Enable or disable: `[no] shutdown`
+1. Setup physical L2 interface:
+    1. (VLAN/LAG/etc. configured later.)
+1. Setup LAGs (LACP):
+    1. Enter member interfaces: `int range te0/3-4` (example)
+    1. (Optional) Enter some description.
+    1. Enable active LACP: `port-group 1 mode active` (for group number `1`)
+    1. Set short LACP period: `lacp short-timeout`
+    1. Enter LAG interface: `int aggregatePort 1`
+    1. Set load balancing method: `aggregate load-balance src-dst-ip`
+    1. Configure as normal switch interface.
+    1. Verify: `show aggregatePort summary` and `show lacp summary`
+1. Setup VLANs:
+    1. Define L2 VLAN and enter section: `vlan <VID>`
+    1. Set name: `name <name>`
+    1. Note: To setup L3 interfaces for VLANs, enter `interface VLAN <VID>`.
+1. Add interfaces to VLANs:
+    1. Enter the interface(s).
+    1. Set the mode: `switchport mode {access|trunk}`
+    1. (Access) Set access VLAN: `switch access vlan <VID>`
+    1. (Trunk) Set native VLAN (if any): `switch trunk native vlan <VID>`
+    1. (Trunk) Set allowed VLANs (defaults to all): `switch trunk allowed only 10,20` (example)
+1. Setup L3 interface:
+    1. Enter the interface (physical, VLAN, etc.).
+    1. Enable L3 mode: `no switchport`
+    1. Set IPv4 address: `ip address <address>/<length>`
+    1. Set IPv6 address: `ipv6 address <address>/<length>`
+    1. Explicitly enable IPv6: `ipv6 enable`
+1. Disable default VLAN interface:
+    1. Enter VLAN: `int VLAN1`
+    1. Disable it: `shutdown`
+1. Set default gateway (and other static routes):
+    1. Set default gateway (IPv4): `ip route 0.0.0.0 0.0.0.0 <next-hop>`
+    1. Set default gateway (IPv6): `ipv6 route ::/0 <next-hop>`
+    1. Note: To avoid leakage, you may want to setup a blackhole route for the site prefixes on the topmost routers.
+1. Enable router advertisements (RAs) for IPv6 L3 interfaces:
+    1. Note: This is required for IPv6 autoconfiguration. Set the two flags for DHCPv6 or unset them for SLAAC.
+    1. Enter the interface.
+    1. (DHCPv6) Set the ND managed flag: `ipv6 nd managed-config-flag`
+    1. (DHCPv6) Set the ND other flag: `ipv6 nd other-config-flag`
+    1. Set DNS servers (RDNSS): `ipv6 nd ra dns server <ipv6-server> infinite sequence 0` (only supports IPv6 addresses) (use sequence 1 for the next server)
+    1. Set DNS search list (DNSSL): `ipv6 nd ra dns search-list <domain> infinite sequence 0`
+    1. (Optional) Disable sending RAs: `suppress-ra` (**TODO** Does this suppress sending or receiving??)
+    1. **TODO** Requires testing.
+1. Set DNS servers:
+    1. Add server (for each one): `ip name-server <ip-address>`
+1. Set time and NTP servers:
+    1. Set time zone: `clock timezone UTC 1 0` (Norway)
+    1. Enable automatic summer time: `clock summer-time CEST start March last Sunday 2:00 end October last Sun 3:00` (Norway)
+    1. Enable SNTP: `sntp enable`
+    1. Set NTP server: `sntp server <hostname>`
+1. (Optional) Add MOTD:
+    1. Start input for login banner: `banner login $` (for delimiter `$` to end input with)
+1. Setup LLDP:
+    1. Enable: `lldp enable`
+1. Setup SNMP:
+    1. **TODO**
+    1. Enable RO for `public` community: `snmp-server community 0 public ro`
+1. Setup STP (802.1W/RSTP):
+    1. **TODO**
+    1. `spanning-tree`
+    1. `errdisable recovery interval 300`
+1. Enable/disable flow control:
+    1. Enter a physical interface range.
+    1. (Optional) Enable auto mode: `flow-control auto`
+    1. (Optional) Disable auto mode: `flow-control off`
+1. (Optional) Setup VRF:
+    1. Create: `vrf definition <name>`
+    1. (Optional) Set a description.
+    1. Enable IPv4: `address-family ipv4`
+    1. Enable IPv6: `address-family ipv6`
+    1. Bind interface to VRF (interface config): `vrf forwarding <vrf-name>` (removes existing IP addresses)
+    1. **TODO** Test
+1. (Optional) Setup RADIUS: **TODO**
+1. (Optional) Setup TACACS+:
+    1. Enable and set server: `tacacs-server host <server> key 0 <key-or-prompt>`
+    1. Set login authn to use TACACS+ and fallback to local: `aaa authentication login default group tacacs+ local`
+    1. **TODO** Set authz too?
+    1. **TODO** Add accounting too?
+    1. **TODO** Test.
+1. Set terminal idle timer:
+    1. Enter console line: `line console 0`
+    1. Set timeout: `exec-timeout <seconds>`
+    1. Enter VTY lines: `line vty 0 31`
+    1. Set timeout (again).
+1. (Optional) Split 40G-interface (QSFP+) into 4x 10G (SFP+): `split interface <if>`
+1. Save the config: `write mem`
 
 Random notes (**TODO**):
 
-1. (Optional) Split 40G-interface (QSFP+) into 4x 10G (SFP+): `split interface <if>`
 1. Configure RSTP:
     - Set protocol: `spanning-tree mode rstp` (default MSTP)
     - Set priority: `spanning-tree priority <priority>` (default 32768, should be a multiple of 4096, use e.g. 32768 for access, 16384 for distro and 8192 for core)
@@ -41,6 +171,11 @@ Random notes (**TODO**):
     - **TODO** Enabled on all interfaces and VLANs by default?
     - **TODO** Portfast for access ports? `spanning-treelink-type ...`
     - **TODO** Guards.
+    - `errdisable recovery interval 300`
+- VRF (avoid DHCP relay on VyOS?)
+- Access lists for SSH etc.
+- Disable mgmt. LAN
+- URPF.
 
 ### Access Switch
 
@@ -92,7 +227,7 @@ Using an FS S3700-24T4F.
     1. Enter the interface (physical, VLAN, etc.).
     1. Set the IPv4 address: `ip address <address> <subnet>`
     1. Set the IPv6 address: `ipv6 address <address>/<prefix-length>`
-    1. Explicitly enable IPv6: `ipv6 enable`
+    1. (Optional) Explicitly enable IPv6 (not required if an address is specified): `ipv6 enable`
     1. Disable directed broadcasts: `no ip directed-broadcast`
     1. **TODO** Test IPv6.
 1. Disable default VLAN:
@@ -110,9 +245,10 @@ Using an FS S3700-24T4F.
     1. Enable RO for `public` community: `snmp-server community 0 public ro`
     1. **TODO** Filter slow OIDs.
 1. Setup STP (802.1W/RSTP): **TODO**
-1. Enable flow control:
+1. Enable/disable flow control:
     1. Enter a physical interface range.
-    1. Enable auto mode: `flow-control auto`
+    1. (Optional) Enable auto mode: `flow-control auto`
+    1. (Optional) Disable auto mode: `flow-control off`
 1. Enable storm control:
     1. Enter an interface range.
     1. Enable for broadcast: `storm-control broadcast threashold <n>` (units of 64kb/s)
@@ -149,12 +285,16 @@ Using an FS S3700-24T4F.
     - Save configuration: `write all`
     - Format system: `format` (**TODO**: Does it keep the software image?)
 - Interfaces:
-    - Show L2 brief: `show int brief`
+    - (Core) Show L2 brief: `show int status`
+    - (Access) Show L2 brief: `show int brief`
     - Show L3 brief: `show ip int brief`
 - STP:
     - Show details: `show spanning-tree`
     - Show overview and interfaces: `show spanning-tree summary`
-- LACP:
+- (Core) LACP:
+    - Show LAG interfaces: `show aggregatePort summary`
+    - Show LACP status: `show lacp summary`
+- (Access) LACP:
     - Show semi-detailed overview: `show aggregator-group [n] brief`
     - Show member ports: `show aggregator-group [n] summary`
 - Reboot: `reboot`
@@ -165,7 +305,13 @@ Using an FS S3700-24T4F.
 
 ## Tasks
 
-### Configure With ZTP
+### Reset the Configuration
+
+1. Check that the startup config `config.txt` actually exists yet: `dir`
+1. Delete startup config: `delete config.text`
+1. Restart: `reload`
+
+### Provision with ZTP
 
 **TODO**
 

+ 13 - 0
config/network/general.md

@@ -0,0 +1,13 @@
+---
+title: "Networking: General"
+breadcrumbs:
+- title: Configuration
+- title: Network
+---
+{% include header.md %}
+
+## Resources
+
+- ICMP blackhole check ([IPv4](http://icmpcheck.popcount.org/), [IPv6](http://icmpcheckv6.popcount.org/))
+
+{% include footer.md %}

+ 6 - 6
config/network/juniper-junos-switches.md

@@ -79,8 +79,8 @@ breadcrumbs:
     1. Delete logical interface: `delete int me0.0`
     1. Disable link-down alarm: `set chassis alarm management-ethernet link-down ignore`
 1. Disable default VLAN:
-    1. Delete logical interface (before disabling): `delete vlan.0`
-    1. Disable logical interface: `set vlan.0 disable`
+    1. Delete logical interface (before disabling): `delete int vlan.0`
+    1. Disable logical interface: `set int vlan.0 disable`
 1. Create VLANs (not interfaces):
     - `set vlans <name> vlan-id <VID>`
 1. Setup port-ranges:
@@ -92,9 +92,9 @@ breadcrumbs:
     1. Set number of available LACP interfaces: `set chassis aggregated-devices ethernet device-count <0-64>`
     1. Add individual Ethernet interfaces (not using interface range):
         1. Delete logical units (or the whole interfaces): `wildcard range delete interfaces ge-0/0/[0-1] unit 0` (example)
-        1. Set as members: `wildcard range set ge-0/0/[0-1] ether-options 802.3ad ae<n>` (for LACP interface ae\<n\>)
+        1. Set as members: `wildcard range set ge-0/0/[0-1] ether-options 802.3ad ae<n>` (for LACP interface `ae<n>`)
     1. Enter LACP interface: `edit interface ae<n>`
-    1. Set description: `desc <desc>`
+    1. Set description: `set desc <desc>`
     1. Set LACP options: `set aggregated-ether-options lacp active`
     1. Setup default logical unit: `edit unit 0`
     1. Setup VLAN/address/etc.
@@ -102,7 +102,7 @@ breadcrumbs:
     1. Setup trunk ports:
         1. Enter unit 0 and `family ethernet-switching` of the physical/LACP interface.
         1. Set mode: `set port-mode trunk`
-        1. Set non-native VLANs: `set vlan members <vlan-name> [members <VLAN-name>]` (once per VLAN or repeated syntax)
+        1. Set non-native VLANs: `set vlan members [<VLAN-name-1> [VLAN-name-2] [...]]` (once per VLAN or repeated syntax)
         1. (Optional) Set native VLAN: `set native-vlan-id <VID>`
     1. Setup access ports:
         1. Enter unit 0 and `family ethernet-switching` of the physical/LACP interface.
@@ -114,7 +114,7 @@ breadcrumbs:
     1. Set IPv6 address: `set family inet6 address <address>/<prefix-length>`
 1. Setup static IP routes:
     1. IPv4 default gateway: `set routing-options rib inet.0 static route 0.0.0.0/0 next-hop <next-hop>`
-    1. IPv6 default gateway: `set routing-options rib inet6.0 static route ::0/0 next-hop <next-hop>`
+    1. IPv6 default gateway: `set routing-options rib inet6.0 static route ::/0 next-hop <next-hop>`
 1. Disable/enable Ethernet flow control:
     - Note: Junos uses the symmetric/bidirectional PAUSE variant of flow control.
     - Note: This simple PAUSE variant does not take traffic classes (for QoS) into account and will pause _all_ traffic for a short period (no random early detection (RED)) if the receiver detects that it's running out of buffer space, but it will prevent dropping packets _within_ the flow control-enabled section of the L2 network. Enabling it or disabling it boils down to if you prefer to pause (all) traffic or drop (some) traffic during congestion. As a guideline, keep it disabled generally (and use QoS or more sophisticated variants instead), but use it e.g. for dedicated iSCSI networks (which handle delays better than drops). Note that Ethernet and IP don't require guaranteed packet delivery.

+ 0 - 1
config/network/tplink-jetstream-switches.md

@@ -125,7 +125,6 @@ breadcrumbs:
     1. Set recurring DST: `system-time dst recurring last Sun Mar 2:00 last Sun Oct 3:00` (Norway)
     1. (Optional) Set time and NTP servers: `system-time ntp UTC+01:00 <ip-1> <ip-2> <update-hours>`
     1. Note: Both NTP servers must be IP addresses and using the same IP version, but they may be the same address.
-1. (Optional) Enable LLDP globally: `lldp`
 1. Enable LLDP:
     1. Enable globally: `lldp`
     1. Enter physical interface configs.

+ 2 - 2
config/network/vyos.md

@@ -65,10 +65,10 @@ An example of a full configuration. Except intuitive stuff I forgot to mention.
     1. (Optional) Commit and log in through SSH instead of the console.
 1. Replace default user:
     1. Note: You may want to skip ahead to the SSHD step so you can paste stuff vis SSH instead of manually writing it into the console.
-    1. Enter new user: `system login user <username>`
+    1. Enter new user: `edit system login user <username>`
     1. Set password: `set authentication plaintext-password "<password>"`
         - Remember quotation marks if the password string spaces.
-        - To generate an `encrypted-password` instead of specifying it as plaintext, run `openssl passwd -6` on a "safe" machine.
+        - To generate an `encrypted-password` instead of specifying it as plaintext, run `openssl passwd -6` on a "safe" machine. (**TODO** Is this broken in 1.3? It only adds the last characters of the supplied text.)
     1. (Optional) Add your personal SSH pubkey:
         1. Set key type: `set authentication public-keys <name> type ssh-rsa`
         1. Set key (only the Base64-encoded part): `set authentication public-keys <name> key <key>`

+ 8 - 0
config/virt-cont/docker.md

@@ -47,6 +47,9 @@ Using **Debian**.
     - It's no longer recommended to keep this enabled, future Docker versions will brobably disable it by default.
     - Disabling it _may_ break your published IPv6 ports, so you may want to test that.
     - In `/etc/docker/daemon.json`, set `"userland-proxy": false`.
+1. (Optional) Change the container network MTU:
+    - Path MTU discovery seems to be broken in Docker networks, causing connection problems when the upstream network is using an MTU lower than 1500.
+    - In `/etc/docker/daemon.json`, set `"mtu": 1280` (for the minimum for IPv6) or similar.
 1. (Optional) Enable Prometheus metrics endpoint:
     - This only exports internal Docker metrics, not anything about the containers (use cAdvisor for that).
     - In `/etc/docker/daemon.json`, set `"experimental": true` and `"metrics-addr": "[::]:9323"`.
@@ -177,6 +180,11 @@ See the [installation guide](https://docs.nvidia.com/datacenter/cloud-native/con
 - IPv6 communication between containers (ICC) on IPv6-enabled _internal_ bridges with IP6Tables enabled is broken, due to IPv6 ND being blocked by the applied IP6Tables rules. On non-internal bridges it works fine. One workaround is to not use IPv6 on internal bridges or to not use internal bridges. (See [libnetwork/issues #2626](https://github.com/moby/libnetwork/issues/2626).)
 - The userland proxy (enabled by default, can be disabled) accepts both IPv4 and IPv6 incoming traffic but uses only IPv4 toward containers, which replaces the IPv6 source address with an internal IPv4 address (I'm not sure which), effectively hiding the real address and may bypass certain defences as it's apparently coming from within the local network. It also has other non-IPv6-related problems. (See [moby/moby #11185](https://github.com/moby/moby/issues/11185), [moby/moby #14856](https://github.com/moby/moby/issues/14856), [moby/moby #17666](https://github.com/moby/moby/issues/17666).)
 
+### Other Problems
+
+- Path MTU discovery seems to be broken in Docker networks, causing connection problems when the upstream network is using an MTU lower than 1500. Set the MTU to 1280 (the IPv6 minimum) to solve this.
+- Docker seems to forget static addresses of containers when changing network properties (**TODO** at least when using the Ansible module, maybe that's what's causing the problem). Re-up everything to fix it.
+
 ## Useful Software
 
 - [watchtower](https://github.com/containrrr/watchtower): Automatically update images and restart containers.

+ 7 - 1
index.md

@@ -10,7 +10,7 @@ Random collection of config notes and miscellaneous stuff. _Technically not a wi
 
 ### General
 
-- [General Notes](/config/general/general/)
+- [General](/config/general/general/)
 - [Linux General Notes](/config/general/linux-general/)
 - [Linux Examples](/config/general/linux-examples/)
 - [Computer Testing](/config/general/computer-testing/)
@@ -63,14 +63,20 @@ Random collection of config notes and miscellaneous stuff. _Technically not a wi
 
 ### Media
 
+- [General](/config/media/general/)
 - [Video Processing](/config/media/video-processing/)
 - [Video Ripping](/config/media/video-ripping/)
 - [Video Streaming](/config/media/video-streaming/)
+- [FFmpeg](/config/media/ffmpeg/)
+- [Video4Linux 2 (V4L2)](/config/media/v4l2/)
+- [VLC](/config/media/vlc/)
+- [youtube-dl](/config/media/youtube-dl/)
 
 ### Network
 
 #### General
 
+- [General](/config/network/general/)
 - [Routing](/config/network/routing/)
 - [Switching](/config/network/switching/)
 - [WLAN](/config/network/wlan/)

+ 19 - 8
it/network/wlan.md

@@ -26,18 +26,29 @@ breadcrumbs:
 |802.11||2.4|22|DSSS/FHSS|
 |802.11ad|WiGig (gen 1)|60|2,160|OFDM|
 
-## Planning & Implementation
-
-- Always perform a survey before to identify internal and external existing WLANs and RF interference.
-- Windows may block relevant frequencies.
+## Channel Planning
+
+- Always perform a survey before to identify internal and external existing WLANs and RF interference (on all relevant bands).
+- RF radiation is weird:
+    - It bounces on stuff and interferes with itself, so it's not always "closer gives better signal".
+    - Windows (not the OS) may block some frequencies.
+    - Changes in the physical environment (e.g. crowds) may cause changes in the WLAN coverage.
+    - It may be very different for 2.4GHz and 5GHz.
+- Generally avoid using automatic channel selection as it typically sucks. Plan manually.
 - Don't set stations' transmit power too high.
     - Other associated stations' max transmit power may be much lower, causing asymmetric connections. They may still roam to them from a more appropriate BSS, though, since the problem is not apparent until after associated.
     - It increases interference with other stations may contribute to the hidden and exposed node problems.
     - It may overheat the device.
     - It may violate regulations.
-- Disable legcy protocols (such as 802.11 a, b and g). Legacy devices take up too much time when accessing the medium.
-- Move as many devices as possible to the 5GHz band. Try to reserve the 2.4GHz band for legacy/simple and distant devices.
-- The 2.4GHz (ISM) band is more susceptible to interference since the frequency is used by e.g. Bluetooth and microwave ovens.
-- Changes in the physical environment may cause changes in the WLAN coverage.
+- Use wider channel bands for better bandwidth (duh) if you can afford the band width usage and know there doesn't exist interference within the chosen band.
+- 5GHz has way more channels than 2.4GHz. 2.4GHz in the US (the de facto standard) only has three non-overlapping channels (1, 6, and 11). 2.4GHz in certain countries like Norway has four non-overlapping channels (1, 5, 9 and 13).
+- Disable 2.4GHz if you're not going to use it as it interferes with more stuff than 5GHz. Cheap IoT-stuff still uses only 2.4GHz though, so you may want a 2.4GHz IoT WLAN. Users with modern equipment can typically be pushed onto 5GHz only.
+
+## Other
+
+- If you don't need them, disable legacy protocols (such as 802.11 a, b and g). Legacy devices take up too much time when accessing the medium.
+- If you don't need it, disable broadcast from LAN to WLAN. WLAN is semi-duplex and using a single collision domain (similar to an Ethernet hub, not a switch), so useless broadcasts will temporarily cripple the whole channel.
+- If stations don't need to communicate between themselves, enable client isolation (whatever your WLAN solution calls it). This avoids unnecessary broadcast/multicast traffic and frees up the channel.
+- Certain 5GHz channels are subject to dynamic frequency selection (DFS). This means that they will try to avoid interfering with RADAR signals and in practice that it will take some extra time before WLANs on these channels to come up after a reconfiguration.
 
 {% include footer.md %}

+ 1 - 0
se/lang-plat/go.md

@@ -15,6 +15,7 @@ breadcrumbs:
 - Cleanup dependencies: `go mod tidy`
     - Unused dependencies are removed from `go.mod`.
 - Lint (using `golint`): `golint ./...`
+- Vet: `go vet ./...`
 - Build: `go build -o <binary> <main-file>`
 
 {% include footer.md %}