//pwshnotes.flounder.online/gemlog

<name>pwshnotes</name>

<title>Demonstrate uname Options</title>

<updated>2024-09-03T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2024-09-03:/gemlog/2024-09-03.gmi</id>

<content type="text/plain">&#xA;# Demonstrate uname Options&#xA;&#xA;Personally, I never made a habit of using the uname command on Linux. &#xA;&#xA;uname is a basic utility which is primarily used to print the kernel version. But, there are other options available. &#xA;&#xA;I typically use the -a option which prints everything. &#xA;&#xA;But, today, I sat down and tried every option to see what they all did. Note that uname with no supplied option implies -s. &#xA;&#xA;To make displaying every option easier, I wrote a PowerShell one-liner that demonstrates every uname option. &#xA;&#xA;You can find an explanation of each part in the sections below. &#xA;&#xA;As you can see, if I want just the kernel version then I can use uname -r&#xA;&#xA;``` PowerShell&#xA;@(&#39;a&#39;,&#39;s&#39;,&#39;n&#39;,&#39;r&#39;,&#39;v&#39;,&#39;m&#39;,&#39;p&#39;,&#39;i&#39;,&#39;o&#39;) | foreach-object { &#34;$_`n$(uname -$_)`n&#34; }&#xA;&#xA;&#xA;a&#xA;Linux john.local 6.10.5-1-default #1 SMP PREEMPT_DYNAMIC Fri Aug 16 11:15:41 UTC 2024 (30fd964) x86_64 x86_64 x86_64 GNU/Linux&#xA;&#xA;s&#xA;Linux&#xA;&#xA;n&#xA;john.local&#xA;&#xA;r&#xA;6.10.5-1-default&#xA;&#xA;v&#xA;#1 SMP PREEMPT_DYNAMIC Fri Aug 16 11:15:41 UTC 2024 (30fd964)&#xA;&#xA;m&#xA;x86_64&#xA;&#xA;p&#xA;x86_64&#xA;&#xA;i&#xA;x86_64&#xA;&#xA;o&#xA;GNU/Linux&#xA;&#xA;```&#xA;&#xA;&#xA;&#xA;## uname&#xA;&#xA;Let&#39;s start with the uname manual page. &#xA;&#xA;``` Bash&#xA;man uname &#xA;&#xA;```&#xA;&#xA;Once the manual page loads, you will see the command options in the description section. This gives us the letters that we will use later as inputs. For example, -a or -s. &#xA;&#xA;``` UNAME(1) Manual Page&#xA;UNAME(1)                         User Commands                         UNAME(1)&#xA;&#xA;NAME&#xA;       uname - print system information&#xA;&#xA;SYNOPSIS&#xA;       uname [OPTION]...&#xA;&#xA;DESCRIPTION&#xA;       Print certain system information.  With no OPTION, same as -s.&#xA;&#xA;       -a, --all&#xA;              print all information, in the following order, except omit -p and&#xA;              -i if unknown:&#xA;&#xA;       -s, --kernel-name&#xA;              print the kernel name&#xA;&#xA;       -n, --nodename&#xA;              print the network node hostname&#xA;&#xA;       -r, --kernel-release&#xA;              print the kernel release&#xA;&#xA;       -v, --kernel-version&#xA;              print the kernel version&#xA;&#xA;       -m, --machine&#xA;              print the machine hardware name&#xA;&#xA;       -p, --processor&#xA;              print the processor type (non-portable)&#xA;&#xA;       -i, --hardware-platform&#xA;              print the hardware platform (non-portable)&#xA;&#xA;       -o, --operating-system&#xA;              print the operating system&#xA;&#xA;       --help display this help and exit&#xA;&#xA;       --version&#xA;              output version information and exit&#xA;&#xA;```&#xA;&#xA;&#xA;&#xA;## Array&#xA;&#xA;From a programmer&#39;s perspective, the letters change for each uname option listed above: a, s, n, r, ... So, I&#39;ll want to collect those letters and use them later. &#xA;&#xA;Using the PowerShell array operator @( ) allows us to create an array of single-character strings. For example, &#39;a&#39; and &#39;s&#39; are full string objects in PowerShell instead of chars like in other programming languages. &#xA;&#xA;Commas separate the elements of the array. &#xA;&#xA;``` PowerShell&#xA;@(&#39;a&#39;,&#39;s&#39;,&#39;n&#39;,&#39;r&#39;,&#39;v&#39;,&#39;m&#39;,&#39;p&#39;,&#39;i&#39;,&#39;o&#39;)&#xA;&#xA;```&#xA;&#xA;&#xA;&#xA;## Pipeline&#xA;&#xA;PowerShell typically processes information in a pipeline. Along with objects, pipelines are a central feature of PowerShell and are regularly used. &#xA;&#xA;Conceptually, pipelines connect the output from one command to the input of another command. &#xA;&#xA;It is also important to understand that, in PowerShell, collections like our array are passed down the pipeline one array element at a time. So, two things will happen to the next command in the pipeline. One, the next command in the pipeline will be invoked once for each value passing through the pipeline. And, two, the command will receive one element of data as input during each invocation. So, in our case, the next command in the pipeline will receive one letter with each invocation. &#xA;&#xA;Sending collections down the pipeline one element at a time is a useful default behavior. And this lets pipelines take the general form of: &#xA;&#xA;* Placing a collection of data at the beginning of the pipeline. &#xA;* And, using subsequent pipeline commands to process or filter individual elements of that collection. &#xA;&#xA;That&#39;s what we will do in our example today. &#xA;&#xA;Since PowerShell is object-oriented, even data--like our array--have implicit outputs. What that means is, simply putting the array at the beginning of a pipeline will pass the individual array elements (letters in our case) to the next command in the pipeline. &#xA;&#xA;So a simple solution to our problem would be to feed the letters in the array into a command which used each letter as a uname option. That&#39;s the basic approach I&#39;ll follow here. &#xA;&#xA;To tell PowerShell to link the array with a following command as a pipeline, we use the pipe symbol or vertical bar |  On US keyboards, you typically hold Shift and press Backslash together to produce a pipe symbol. &#xA;&#xA;In our example, the pipe will connect the implicit output of the array--the letters--and the input to our command. &#xA;&#xA;``` PowerShell&#xA;@(&#39;a&#39;,&#39;s&#39;,&#39;n&#39;,&#39;r&#39;,&#39;v&#39;,&#39;m&#39;,&#39;p&#39;,&#39;i&#39;,&#39;o&#39;) | # some command&#xA;&#xA;```&#xA;&#xA;Also, to refer to each input in later pipeline commands, we will use the $_ automatic variable. $_ represents the current object traveling down the pipeline. For example, $_ might represent the letter &#39;a&#39; when pipeline command is invoked for the first time. This gives you a convenient way to refer to input from the pipeline inside your command. Just type dollar sign and underscore to refer to the automatic variable. &#xA;&#xA;``` PowerShell&#xA;@(&#39;a&#39;,&#39;s&#39;,&#39;n&#39;,&#39;r&#39;,&#39;v&#39;,&#39;m&#39;,&#39;p&#39;,&#39;i&#39;,&#39;o&#39;) | ForEach-Object { &#34;The current letter in the pipeline is $_&#34; } &#xA;&#xA;&#xA;The current letter in the pipeline is a&#xA;The current letter in the pipeline is s&#xA;The current letter in the pipeline is n&#xA;The current letter in the pipeline is r&#xA;The current letter in the pipeline is v&#xA;The current letter in the pipeline is m&#xA;The current letter in the pipeline is p&#xA;The current letter in the pipeline is i&#xA;The current letter in the pipeline is o&#xA;&#xA;```&#xA;&#xA;&#xA;&#xA;## ForEach-Object&#xA;&#xA;ForEach-Object is a PowerShell cmdlet (pronounced &#34;command-let&#34;). cmdlets are PowerShell commands. &#xA;&#xA;ForEach-Object allows you to add custom code to a pipeline. Inside a ForEach-Object code block, you can write any valid PowerShell code. Code blocks consist of PowerShell code between matching curly braces { } &#xA;&#xA;For example, below is how our pipeline would look with ForEach-Object added to the end. &#xA;&#xA;&gt; Note: cmdlet names are not case-sensitive. &#xA;&#xA;``` PowerShell&#xA;@(&#39;a&#39;,&#39;s&#39;,&#39;n&#39;,&#39;r&#39;,&#39;v&#39;,&#39;m&#39;,&#39;p&#39;,&#39;i&#39;,&#39;o&#39;) | foreach-object { &lt;# custom code #&gt; }&#xA;&#xA;```&#xA;&#xA;&#xA;## Output String &#xA;&#xA;Let&#39;s focus on getting our custom code to work for one letter of input. And, let&#39;s start with something simple like a string. We&#39;ll start with just one of the uname options. &#xA;&#xA;We create a PowerShell string by placing double-quotes before and after the text. &#xA;&#xA;``` PowerShell&#xA;&#34;a&#34;&#xA;&#xA;```&#xA;&#xA;Now, inside our string, let&#39;s pretend to invoke uname. &#xA;&#xA;``` PowerShell&#xA;&#34;uname -a&#34;&#xA;&#xA;```&#xA;&#xA;If we were to invoke that command for real then we would receive the output of the command. That&#39;s normal. But, in our case, it might be confusing to see only the output of commands without seeing the commands themselves. &#xA;&#xA;If we want to see the commands then we&#39;ll have to add them ourselves to the output. Or, as I&#39;ve done, I will just output the letter so that you can tell which uname option was used. &#xA;&#xA;So, let&#39;s add a placeholder to our mock-up. And let that placeholder represent the option used in the command. So, if I use the -a option then I should see both the option &#39;a&#39;, and the output of the command. &#xA;&#xA;For now, let&#39;s use the following as our string. &#xA;&#xA;``` PowerShell&#xA;&#34;(the option a) (the output from uname -a)&#34;&#xA;&#xA;```&#xA;&#xA;One thing we can do with our string is put the option and command output on different lines. &#xA;&#xA;Programming languages typically have an escape sequence that allows you to insert a newline into string output. PowerShell uses the escape sequence `n  where ` is the backtick character and n is the literal &#39;n&#39; character. Backtick can be typed by pressing the tilde ~ key which is to the left of the 1 key. &#xA;&#xA;&gt; Note: For clarity, the backtick ` key produces backtick by default. And holding Shift and pressing backtick produces tilde ~ instead.  &#xA;&#xA;We can use `n to separate the option from the output. And, we can add a newline to the end of the string to add a buffer between outputs. &#xA;&#xA;``` PowerShell&#xA;&#34;(the option a) `n (the output from uname -a) `n&#34;&#xA;&#xA;```&#xA;&#xA;Let&#39;s run this and see how it behaves with our pipeline. &#xA;&#xA;``` PowerShell&#xA;@(&#39;a&#39;,&#39;s&#39;,&#39;n&#39;,&#39;r&#39;,&#39;v&#39;,&#39;m&#39;,&#39;p&#39;,&#39;i&#39;,&#39;o&#39;) | foreach-object { &#34;(the option a) `n (the output from uname -a) `n&#34; }&#xA;&#xA;&#xA;(the option a) &#xA; (the output from uname -a) &#xA;&#xA;(the option a) &#xA; (the output from uname -a) &#xA;&#xA;(the option a) &#xA; (the output from uname -a) &#xA;&#xA;(the option a) &#xA; (the output from uname -a) &#xA;&#xA;(the option a) &#xA; (the output from uname -a) &#xA;&#xA;(the option a) &#xA; (the output from uname -a) &#xA;&#xA;(the option a) &#xA; (the output from uname -a) &#xA;&#xA;(the option a) &#xA; (the output from uname -a) &#xA;&#xA;(the option a) &#xA; (the output from uname -a) &#xA;&#xA;```&#xA;&#xA;This output is basically correct. &#xA;&#xA;* There are nine outputs: one for each input. &#xA;* The text we entered is showing. &#xA;* The lines are broken up and spaced with the newline `n escape sequences we used. &#xA;&#xA;Also, notice that I just have a simple string as the only object inside the code block { }. This works because ForEach-Object returns the string object. And, PowerShell implicitly prints the string without an explicit command to do so. &#xA;&#xA;&#xA;Continuing, let&#39;s try using the $_ automatic variable to replace our letter &#39;a&#39; with the actual input. &#xA;&#xA;``` PowerShell&#xA;@(&#39;a&#39;,&#39;s&#39;,&#39;n&#39;,&#39;r&#39;,&#39;v&#39;,&#39;m&#39;,&#39;p&#39;,&#39;i&#39;,&#39;o&#39;) | foreach-object { &#34;$_ `n uname -$_ `n&#34; }&#xA;&#xA;&#xA;a &#xA; uname -a &#xA;&#xA;s &#xA; uname -s &#xA;&#xA;n &#xA; uname -n &#xA;&#xA;r &#xA; uname -r &#xA;&#xA;v &#xA; uname -v &#xA;&#xA;m &#xA; uname -m &#xA;&#xA;p &#xA; uname -p &#xA;&#xA;i &#xA; uname -i &#xA;&#xA;o &#xA; uname -o &#xA;&#xA;```&#xA;&#xA;I can see that the inputs are now being formatted by our string and output by the pipeline. &#xA;&#xA;&#xA;&#xA;## Subexpression Operator &#xA;&#xA;At this point, the output string looks fine. And we just need to solve the problem of actually running the uname command with an option. &#xA;&#xA;While ForEach-Object can run code directly, I&#39;ve chosen to use a simple string as the only code within the code block. &#xA;&#xA;So, let&#39;s continue with that string. And, let&#39;s try to run some code inside the string. &#xA;&#xA;We can run code inside of a string with the subexpression operator $( )  For example, &#34;$(uname -a)&#34; runs the uname -a command. &#xA;&#xA;And, if we keep the $_ automatic variable then we&#39;ll have a command that automatically updates for each letter in our array. &#xA;&#xA;&gt; Note: Below, I&#39;ve removed some spaces to match my original one-liner. If you prefer the spacing from the previous example then feel free to add the spaces back in. &#xA;&#xA;&#xA;This is the final command as shown at the top of the gemlog. &#xA;&#xA;``` PowerShell&#xA;@(&#39;a&#39;,&#39;s&#39;,&#39;n&#39;,&#39;r&#39;,&#39;v&#39;,&#39;m&#39;,&#39;p&#39;,&#39;i&#39;,&#39;o&#39;) | foreach-object { &#34;$_`n$(uname -$_)`n&#34; }&#xA;&#xA;&#xA;a&#xA;Linux john.local 6.10.5-1-default #1 SMP PREEMPT_DYNAMIC Fri Aug 16 11:15:41 UTC 2024 (30fd964) x86_64 x86_64 x86_64 GNU/Linux&#xA;&#xA;s&#xA;Linux&#xA;&#xA;n&#xA;john.local&#xA;&#xA;r&#xA;6.10.5-1-default&#xA;&#xA;v&#xA;#1 SMP PREEMPT_DYNAMIC Fri Aug 16 11:15:41 UTC 2024 (30fd964)&#xA;&#xA;m&#xA;x86_64&#xA;&#xA;p&#xA;x86_64&#xA;&#xA;i&#xA;x86_64&#xA;&#xA;o&#xA;GNU/Linux&#xA;&#xA;```&#xA;&#xA;As you can now see, each option is provided by the array to the pipeline. And, ForEach-Object lets us run code against each value flowing down the pipeline: in this case, each letter. &#xA;&#xA;The string in the code block outputs the uname option, uses a subexpression $( ) operator to run a command, and uses the `n escape sequence to put each output on its own line. &#xA;&#xA;&#xA;&#xA;## References &#xA;&#xA;=&gt; https://www.baeldung.com/linux/man-command    Linux man Command | Baeldung on Linux&#xA;=&gt; https://man.archlinux.org/man/uname.1    uname | Arch Manual Pages&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_arrays    @( )  about_Arrays | Microsoft&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_pipelines    about_Pipelines | Microsoft&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_psitem    $_  about_PSItem | Microsoft&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/foreach-object    ForEach-Object | Microsoft&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_script_blocks    { }  about_Script_Blocks | Microsoft&#xA;=&gt; https://learn.microsoft.com/powershell/scripting/lang-spec/chapter-02#223-comments    &lt;# #&gt;  Comments | Language Specification | Microsoft&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_quoting_rules    &#34; &#34;  Strings | about_Quoting_Rules | Microsoft&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_special_characters    `n  about_Special_Characters | Microsoft&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_operators#subexpression-operator--    $( )  Subexpression Operator | about_Operators | Microsoft&#xA;&#xA;&#xA;Created: Tuesday, September 3, 2024 &#xA;Updated: Tuesday, September 3, 2024 &#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2024-09-03.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Change Virtual Console Font Size</title>

<updated>2024-07-16T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2024-07-16:/gemlog/2024-07-16-console-font.gmi</id>

<content type="text/plain">&#xA;# Change Virtual Console Font Size&#xA;&#xA;openSUSE Tumbleweed follows a rolling release update cycle. And, when there are major updates to KDE, I like to switch to the virtual console (Ctrl+Alt+F1) to run zypper so that the update doesn&#39;t fail. Sometimes KDE will reset (and kill the update process) if one of its critical files is updated. So, using the virtual console avoids that potential issue. &#xA;&#xA;The problem I&#39;m having is that the virtual console is impossible to read. The font size is too small. Or, the display resolution is too high. And, I need some way to make the console more readable. &#xA;&#xA;&#xA;## setfont&#xA;&#xA;The easiest and fastest way to fix the issue is to issue the setfont command from within a virtual console. Use the -d option to double the default font size: &#xA;&#xA;``` Bash&#xA;setfont -d &#xA;&#xA;```&#xA;&#xA;&#xA;## vconsole.conf&#xA;&#xA;If you want to permanently change the font size, you&#39;ll have to modify the relevant systemd configuration file. The relevant file is vconsole.conf: &#xA;&#xA;&gt; /etc/vconsole.conf&#xA;&#xA;Before you do that, you&#39;ll probably want to list the potential fonts. In PowerShell, you can list the contents of the consolefonts directory and look for Lat15 fonts which correspond to English: &#xA;&#xA;``` PowerShell&#xA;Get-ChildItem -Path /usr/share/kbd/consolefonts -Filter Lat15*&#xA;&#xA;   Directory: /usr/share/kbd/consolefonts&#xA;&#xA;UnixMode   User Group   LastWriteTime Size Name&#xA;--------   ---- -----   ------------- ---- ----&#xA;-rw-r--r-- root root  10/1/2023 06:32 2438 Lat15-Fixed13.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2573 Lat15-Fixed14.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2540 Lat15-Fixed15.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2543 Lat15-Fixed16.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2579 Lat15-Fixed18.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2374 Lat15-Terminus12x6.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2439 Lat15-Terminus14.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2465 Lat15-Terminus16.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2936 Lat15-Terminus18x10.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2962 Lat15-Terminus20x10.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 3185 Lat15-Terminus22x11.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 3212 Lat15-Terminus24x12.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 3498 Lat15-Terminus28x14.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 3827 Lat15-Terminus32x16.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2441 Lat15-TerminusBold14.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2477 Lat15-TerminusBold16.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2986 Lat15-TerminusBold18x10.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 3014 Lat15-TerminusBold20x10.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 3228 Lat15-TerminusBold22x11.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 3265 Lat15-TerminusBold24x12.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 3676 Lat15-TerminusBold28x14.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 3791 Lat15-TerminusBold32x16.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2450 Lat15-TerminusBoldVGA14.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2477 Lat15-TerminusBoldVGA16.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2477 Lat15-VGA14.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2543 Lat15-VGA16.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 3220 Lat15-VGA28x16.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 3312 Lat15-VGA32x16.psf.gz&#xA;-rw-r--r-- root root  10/1/2023 06:32 2243 Lat15-VGA8.psf.gz&#xA;&#xA;```&#xA;&#xA;Linux fonts are stored as bitmaps. So, each font file contains one font with a fixed height and width. The file names typically reflect the font size. &#xA;&#xA;TerminusBold32x16 has one of the largest font sizes available from the console fonts. &#xA;&#xA;If we specify the full font name in vconsole.conf then the virtual consoles should use that font file and therefore font size. &#xA;&#xA;To modify vconsole.conf, you&#39;ll need super user access. I&#39;ll use sudo and vim to edit the file: &#xA;&#xA;``` PowerShell&#xA;sudo vim /etc/vconsole.conf&#xA;&#xA;```&#xA;&#xA;The default configuration looks like this: &#xA;&#xA;``` vconsole.conf&#xA;KEYMAP=us&#xA;FONT=eurlatgr.psfu&#xA;FONT_MAP=&#xA;FONT_UNIMAP=&#xA;XKBLAYOUT=us&#xA;XKBMODEL=pc105+inet&#xA;XKBOPTIONS=terminate:ctrl_alt_bksp&#xA;&#xA;```&#xA;&#xA;We&#39;ll just change the FONT= variable to use the font with a larger size. &#xA;&#xA;``` vconsole.conf&#xA;KEYMAP=us&#xA;FONT=Lat15-TerminusBold32x16&#xA;FONT_MAP=&#xA;FONT_UNIMAP=&#xA;XKBLAYOUT=us&#xA;XKBMODEL=pc105+inet&#xA;XKBOPTIONS=terminate:ctrl_alt_bksp&#xA;&#xA;```&#xA;&#xA;This change will take effect after you reboot. &#xA;&#xA;Or, you can apply the changes immediately by restarting the appropriate systemd service: &#xA;&#xA;``` PowerShell&#xA;sudo systemctl restart systemd-vconsole-setup&#xA;&#xA;```&#xA;&#xA;&#xA;## console-setup&#xA;&#xA;You can also use the third-party console-setup utility. &#xA;&#xA;From the README: &#xA;&#xA;&gt; This package provides the console with the same keyboard configuration&#xA;&gt; scheme that X Window System has. In result, there is no need to&#xA;&gt; duplicate or change the console keyboard files just to make simple&#xA;&gt; customizations such as the use of dead keys, the key functioning as&#xA;&gt; AltGr or Compose key, the key(s) to switch between Latin and non-Latin&#xA;&gt; layouts, etc.  Besides the keyboard, the package configures also the&#xA;&gt; font on the console.  It includes a rich collection of fonts and&#xA;&gt; supports several languages that would be otherwise unsupported on the&#xA;&gt; console (such as Armenian, Georgian, Lao and Thai). &#xA;&gt; &#xA;&#xA;Install the console-setup package. It seems to be available for Debian, Ubuntu, and openSUSE. Below, I use zypper on openSUSE Tumbleweed: &#xA;&#xA;``` PowerShell&#xA;sudo zypper install console-setup&#xA;&#xA;```&#xA;&#xA;The configuration file is simply called &#34;console-setup&#34;. &#xA;&#xA;``` PowerShell&#xA;sudo vim /etc/default/console-setup&#xA;&#xA;```&#xA;&#xA;The default settings are: &#xA;&#xA;``` console-setup (file)&#xA;# CONFIGURATION FILE FOR SETUPCON&#xA;&#xA;# Consult the console-setup(5) manual page.&#xA;&#xA;ACTIVE_CONSOLES=guess&#xA;&#xA;CHARMAP=guess&#xA;&#xA;CODESET=guess&#xA;FONTFACE=TerminusBold&#xA;FONTSIZE=16&#xA;&#xA;VIDEOMODE=&#xA;&#xA;# The following is an example how to use a braille font&#xA;# FONT=&#39;lat9w-08.psf.gz brl-8x8.psf&#39;&#xA;&#xA;```&#xA;&#xA;You can change the FONTSIZE value to one of the accepted values mentioned in the manual page (eg man console-setup(5)). &#xA;&#xA;For example: &#xA;&#xA;&gt; FONTSIZE=16x32&#xA;&#xA;Then, save the changes to the console-setup file. &#xA;&#xA;After switching to a virtual console (eg Ctrl+Alt+F1) and logging in, you can apply the console-setup configuration with the setupcon command. The -f option limits the changes to just the console font. &#xA;&#xA;``` PowerShell&#xA;setupcon -f&#xA;&#xA;```&#xA;&#xA;Unlike using the vconsole.conf file, console-setup does not have a way to permanently change the font. You will have to run the setupcon command each time you log into a virtual console. &#xA;&#xA;&#xA;## video=&#xA;&#xA;Another option is to use the video kernel parameter. &#xA;&#xA;This solves the problem in a different way. Instead, of increasing the font size, the video option allows you to reduce the screen resolution in the virtual consoles. This has the effect of enlarging the text. &#xA;&#xA;Normally, you would have to modify your boot loader configuration and apply the changes. Since I&#39;m using Tumbleweed, I&#39;ll take advantage of the YaST Boot Loader applet. You will be prompted to enter your password--just like when using sudo. &#xA;&#xA;* In YaST Boot Loader, I&#39;ll click on the Kernel Parameters tab. &#xA;* Then I can add a space and then my parameter to the Optional Kernel Command Line Parameter field: being careful to leave the current parameters untouched. &#xA;&#xA;By default, my Parameter field looked like this: &#xA;&#xA;&gt; splash=silent quiet security=apparmor&#xA;&#xA;Then I added the video= kernel parameter: &#xA;&#xA;&gt; splash=silent quiet security=apparmor video=1024x768&#xA;&#xA;Some other common values are: &#xA;&#xA;* 640x480&#xA;* 800x600  &#xA;* 1024x768 &#xA;* 1280x1024&#xA;&#xA;* Continuing, I click the OK button in YaST Boot Loader. This will apply the changes to my boot loader for me. &#xA;&#xA;When I reboot, the virtual consoles will use this resolution. &#xA;&#xA;The only problem I found with this approach is that using a lower resolution means that your video card will have to switch modes when switching to the virtual console. So, once you press Ctrl+Alt+F1, instead of switching immediately, the system will take a moment to switch video modes. And, you&#39;ll have the same problem when switching back to the desktop. &#xA;&#xA;Otherwise, Wayland did not have a problem with the video= parameter being present. And my login screen and desktop were fine with the video kernel parameter applied. &#xA;&#xA;&#xA;## Shell Profile&#xA;&#xA;For commands like setfont and setupcon, you might take advantage of your shell profile to automatically run these commands. Your shell profile is a script that runs when you log in. &#xA;&#xA;In PowerShell, we typically refer to the profile using the PowerShell automatic variable $profile which resolves to your profile file path. &#xA;&#xA;Make sure that $profile exists or create it: &#xA;&#xA;``` PowerShell&#xA;if (!(Test-Path -Path $PROFILE)) &#xA;{&#xA;   New-Item -ItemType File -Path $PROFILE -Force&#xA;}&#xA;&#xA;```&#xA;&#xA;Then edit $profile: &#xA;&#xA;``` PowerShell&#xA;vim $profile&#xA;&#xA;```&#xA;&#xA;I&#39;ll add a line to my file and instruct PowerShell to run either setfont or setupcon: &#xA;&#xA;``` $profile&#xA;setfont -d&#xA;&#xA;```&#xA;&#xA;And, since it only makes sense to run this command while logging into a virtual console, we can check the XDG_SESSION_TYPE environment variable for the value &#39;tty&#39; before running the command. &#xA;&#xA;``` $profile&#xA;if (&#39;tty&#39; -eq $Env:XDG_SESSION_TYPE)&#xA;{  setfont -d  }&#xA;&#xA;```&#xA;&#xA;By convention in PowerShell, we place the variable on the right side of the comparison operator to force a scalar comparison. This will output $True or $False and allow the if statement to work properly. &#xA;&#xA;Also, PowerShell uses the Env:\ ($Env:) provider to access environment variables. For Windows users, this can be understood as a type of &#39;letter drive&#39; that allows you to access environment variables. &#xA;&#xA;By default, Linux uses the Bash shell. So, these changes to my PowerShell profile will only take effect if I change my login shell or if I launch pwsh after logging in. That&#39;s fine for me. &#xA;&#xA;I&#39;m less familiar with Bash profiles. Though, if you want to use Bash then I&#39;m sure you can find an appropriate example online: including how to check the value of an environment variable. Your Bash profile probably already has default stuff in it from your Linux distribution. So, add your changes to the bottom of the file.  &#xA;&#xA;&#xA;## References &#xA;&#xA;Main Methods&#xA;&#xA;=&gt; https://man.archlinux.org/man/setfont.8    setfont | Arch Manual Pages&#xA;=&gt; https://man.archlinux.org/man/vconsole.conf.5    vconsole.conf | Arch Manual Pages&#xA;=&gt; https://manpages.debian.org/testing/console-setup/console-setup.5.html    console-setup | Debian Manpages&#xA;=&gt; https://docs.kernel.org/fb/modedb.html    Video Kernel Parameter | Linux Kernel Documentation&#xA;&#xA;Q&amp;A&#xA;&#xA;=&gt; https://linux.codidact.com/posts/290199?sort=active    How to change resolution of virtual terminal? | Linux Systems&#xA;=&gt; https://unix.stackexchange.com/questions/77049/how-do-i-change-the-screen-font-size-when-using-a-virtual-console    Virtual Console Font Size | Unix &amp; Linux Stack Exchange&#xA;=&gt; https://unix.stackexchange.com/questions/17027/how-to-set-the-resolution-in-text-consoles-troubleshoot-when-any-vga-fail    Mentions Kernel Mode Setting | Unix &amp; Linux Stack Exchange&#xA;=&gt; https://unix.stackexchange.com/questions/49779/can-i-change-the-font-of-the-text-mode-console    Can I change the font of the text-mode console? | Unix &amp; Linux Stack Exchange&#xA;&#xA;PowerShell&#xA;&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles    about_Profiles | Microsoft Learn&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_environment_variables    about_Environment_Variables | Microsoft Learn&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comparison_operators    about_Comparison_Operators | Microsoft Learn&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_if    about_If | Microsoft Learn&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_providers    about_Providers | Microsoft Learn&#xA;&#xA;Background &#xA;&#xA;=&gt; https://newbe.dev/where-is-bash-profile    Where is .bash_profile? | NewbeDev&#xA;=&gt; http://mywiki.wooledge.org/DotFiles    Explanation of Linux Shell Profiles | Greg&#39;s Wiki&#xA;=&gt; https://wiki.archlinux.org/title/Linux_console    Virtual Console | ArchWiki&#xA;=&gt; https://wiki.archlinux.org/title/Kernel_Mode_Setting    Kernel Mode Setting | ArchWiki&#xA;=&gt; https://en.wikipedia.org/wiki/Direct_Rendering_Manager    Direct Rendering Manager | Wikipedia&#xA;=&gt; https://www.techinfected.net/2015/06/how-to-change-tty-virtual-console-font.html    sudo dpkg-reconfigure console-setup | TechInfected&#xA;=&gt; https://salsa.debian.org/installer-team/console-setup    console-setup Source | Debian GitLab&#xA;=&gt; https://en.wikipedia.org/wiki/PC_Screen_Font    PC Screen Font | Wikipedia&#xA;=&gt; https://en.wikipedia.org/wiki/Iso_8859-1    ISO/IEC 8859-1 | Wikipedia&#xA;&#xA;&#xA;Created: Tuesday, July 16, 2024&#xA;Updated: Tuesday, July 16, 2024&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2024-07-16-console-font.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Soldering</title>

<updated>2024-05-30T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2024-05-30:/gemlog/2024-05-30-soldering.gmi</id>

<content type="text/plain">&#xA;# Soldering&#xA;&#xA;I&#39;m terrible at soldering. And, I ruined two soldering iron tips on my small project this week. &#xA;&#xA;I did collect some useful information while researching. But, I don&#39;t have a complete set of advice that works. &#xA;&#xA;Here&#39;s what I learned so far. &#xA;&#xA;&#xA;## Heat Transfer&#xA;&#xA;A soldering iron is a tool for heat transfer. &#xA;&#xA;Much of the advice given about soldering technique relates to heat transfer. And, without understanding this, that advice can seem confusing or irrelevant. &#xA;&#xA;For example, &#34;tinning&#34; the tip of the soldering iron does several things related to heat transfer. Tinning enhances heat transfer by creating a continuous bridge of metal to transfer heat from the iron into the joint. Tinning prevents oxidation by sealing the tip of the soldering iron with solder. Oxidation greatly reduces heat transfer. So, that&#39;s why we are interested in preventing oxidation. Oxidation turns the tip of the soldering iron dark as the soldering iron heats up and the metal interacts with the oxygen in the air. &#xA;&#xA;&#xA;## Tinning the Tip&#xA;&#xA;The tip of the soldering iron can be thought of as the entire piece of metal sticking out of the heating element on your soldering iron. &#xA;&#xA;But &#34;tinning the tip&#34; doesn&#39;t refer to this, so far as I can tell. &#xA;&#xA;Instead, it is important to understand that the tip is made of a core of copper meant for heat transfer; the copper is clad in elemental iron, which is also meant for heat transfer; and, finally, the iron is then plated with nickel and chrome which is meant to keep the tip free of solder. Only the extreme edge of the tip exposes the iron cladding. My understanding is only this small, exposed area is used to transfer heat. In my experience, the plated sides of the tip are not a good conductor of heat. &#xA;&#xA;When you attempt to tin the plating (as I did), the solder will run off as it is meant to. Where I did succeed in tinning the side of my soldering iron tip, I just ruined the tip by creating pits which exposed the iron and copper inside. You should replace a soldering iron tip when it becomes pitted.  &#xA;&#xA;&#xA;## Replacing the Tip&#xA;&#xA;Soldering iron tips are not a standardized size. And, especially, the cheap hobby irons I&#39;ve bought are difficult to find replacement tips for. I found one iron at my hobby shop where replacement tips are for sale. That&#39;s the iron I bought after I ruined the tip on my first iron. &#xA;&#xA;There are much higher quality irons like the ones from Hakko and Weller. I have no experience with these. I can only assume the higher quality translates into less frustration. &#xA;&#xA;&#xA;## Cold Joints and Dry Joints&#xA;&#xA;While I&#39;ve focused on technique, there is also advice about the results. &#xA;&#xA;On printed circuit board through holes, a good solder joint is described as a shiny volcano with the component lead sticking through the top of the volcano. Wire-to-wire solder joints should also be shiny. And the fibers of stranded wire should absorb solder during the tinning process and while being joined. (Yes, wires should be tinned before joining.) &#xA;&#xA;Two common defects in soldered joints are cold joints and dry joints. &#xA;&#xA;A cold joint is one which was never properly heated. The result is a fragile connection which will fail early. A simple fix is to heat the joint and melt the solder. Then, leave the iron applied for an extra second to give the metal a chance to properly bond (known as wetting). The solder should take on a smooth appearance and maintain its smoothness after cooling. Solder should flow into and fill any gaps in a joint. &#xA;&#xA;A dry joint is just a connection without enough solder. On a PCB soldering pad, there might be a hole where the solder has not completely covered the pad. When connecting components or wires, there might not be enough solder to fill all the gaps in the joint and create a solid and reliable connection. A simple fix is to reheat the joint and to add a little solder at a time until these gaps are filled in. It is possible to add too much. In that case, you&#39;ll need to use desoldering braid or a desoldering pump to remove excess solder. These are extra tools that allow you to remove molten solder. &#xA;&#xA;Another problem are disturbed joints where the solder was moved or vibrated while cooling. Apply heat to remelt the solder and avoid disturbing the joint while it cools. &#xA;&#xA;&#xA;## Closing Remarks&#xA;&#xA;Soldering is a useful skill which I aspire to learn. But, my experience with soldering has been discouraging. I&#39;ve spent time trying to learn about soldering. But then that knowledge doesn&#39;t match up with my experience, or key details are missing or glossed over. And I appear to be disadvantaged by poor tools and training. &#xA;&#xA;In my situation, I think I should set my expectations low and not expect to master soldering from books. I think I can get my projects to work. But, the process won&#39;t be as pretty as the ideal in my mind.  &#xA;&#xA;This is important because I think it is better to cope with setbacks and to make progress than to be permanently discouraged by conflicting information and poor results. &#xA;&#xA;In the end, I got my project working. And that&#39;s more meaningful than trying to figure out all the ways in which things aren&#39;t working. &#xA;&#xA;&#xA;## References &#xA;&#xA;=&gt; https://www.hakko.com/english/support/maintenance/detail.php?seq=183    Soldering Iron Maintenance | HAKKO Corporation&#xA;=&gt; https://cdn.shopify.com/s/files/1/0273/4614/1297/files/inland-craft-soldering-iron-and-tip-care-guide.pdf?v=1588693123   Soldering Iron and Tip Care | Inland | PDF&#xA;=&gt; https://nerdytechy.com/are-soldering-iron-tips-universal/    Are Soldering Iron Tips Universal? | NerdyTechy&#xA;=&gt; https://www.ourpcb.com/cold-solder-joint.html    Cold and Dry Solder Joints | OurPCB&#xA;=&gt; https://www.makerspaces.com/how-to-solder/    How To Solder: A Complete Beginners Guide | Makerspaces.com&#xA;=&gt; https://www.circuitrework.com/guides/7-1-1.html    Soldering Basics | Circuit Technology Center&#xA;=&gt; https://www.kingbass.com/soldering101.html    Soldering 101 | David King&#xA;=&gt; https://scanditronictech.com/resources/soldering-iron-tips/    Everything You Need to Know About Soldering Iron Tips | Scanditronic&#xA;&#xA;Nelson, David Erik. Soldering. 21st Century Skills Innovation Library: Makers as Innovators, hoopla Digital, e-book, Cherry Lake Publishing, 2015, www.hoopladigital.com/ebook/soldering-david-erik-nelson/11415522. Accessed 30 May 2024. &#xA;&#xA;Created: Thursday, May 30, 2024 &#xA;Updated: Thursday, May 30, 2024 &#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2024-05-30-soldering.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>How to Clean a Flashlight Lens</title>

<updated>2024-05-20T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2024-05-20:/gemlog/2024-05-20-clean-lens.gmi</id>

<content type="text/plain">&#xA;# How to Clean a Flashlight Lens&#xA;&#xA;Here are the steps I follow to clean the glass lenses on my flashlights. &#xA;&#xA;&#xA;## Materials &#xA;&#xA;You should be able to find these materials in a drugstore or supermarket. &#xA;&#xA;&#xA;* Lens cleaning spray. &#xA;&#xA;This is the same stuff you use to clean eyeglasses. Make sure it is &#34;safe&#34; for coated lenses. &#xA;&#xA;&#xA;* Lens cloth. &#xA;&#xA;These are the small cloths which come with eyeglasses or professional optics. &#xA;&#xA;&#xA;## Steps &#xA;&#xA;* Run the lens under water to remove any grains of sand. &#xA;&#xA;Grains of sand or other unseen particles can scratch the lens during cleaning. It is important to remove these particles first. &#xA;&#xA;&#xA;* Spray lens cleaner on the lens. &#xA;&#xA;I hold my flashlight with the lens facing up. And I spray the lens so that the fluid is trapped on top. &#xA;&#xA;&#xA;* Rub the lens to remove dirt. &#xA;&#xA;I simply use my finger to agitate the cleaning fluid on the lens. &#xA;&#xA;&#xA;* Rinse the lens in running water. &#xA;&#xA;This removes the cleaning fluid and dirt. &#xA;&#xA;&#xA;* Dry the lens with the lens cloth. &#xA;&#xA;Wipe the lens with a clean, dry lens cloth. This prevents water spots. &#xA;&#xA;&#xA;## Preventing Damage&#xA;&#xA;If your flashlight is not waterproof or if you&#39;re unsure, then you might have to find a different way to maintain your flashlight. For abrasive particles stuck to the lens, you can try blowing them off with compressed air. For rinsing, you can use a second, moist lens cloth to remove any soap and then dry with a separate clean, dry cloth. Whatever you do, don&#39;t allow water inside your flashlight.  &#xA;&#xA;Avoid harsh chemicals. Some soaps and glass cleaners will destroy the coating on your lens. Instead, use lens cleaning fluid to clean your lens. &#xA;&#xA;Avoid abrasive fabrics. Paper towels and napkins contain small wood fibers which will scratch your lens over time. Also, don&#39;t use cotton swabs or wipe your lens with clothing. Instead, use a clean finger to clean the lens. And, use a lens cloth to dry your lens. &#xA;&#xA;Don&#39;t run a hot flashlight under cold water, or the reverse; don&#39;t run a cold flashlight under warm water. The temperature difference can cause the lens to crack. Instead, wait until the flashlight reaches room temperature before cleaning it. &#xA;&#xA;&#xA;## Tips &#xA;&#xA;If the flashlight lens comes out dirty after drying it then try cleaning and drying the lens cloth. I use dish soap and clean water to handwash my cloth as needed. Make sure the cloth is dry before using it. &#xA;&#xA;I prefer a lens cloth where each side is a different color or has some other distinguishing mark. The reason is, I prefer to always hold the cloth on the same side to prevent oil from getting on both sides. This way, I can use the lens cloth for longer periods before I have to wash it. &#xA;&#xA;I prefer to buy the 8oz bottles of cleaning fluid which are a better value. &#xA;&#xA;As long as the lens cleaner is &#34;safe&#34; on coated lenses, it is not necessary to buy a special formula to prevent streaks. When using my method, streaks should be cleared by the final rinse and dry. &#xA;&#xA;&#xA;&#xA;Created: Monday, May 20, 2024&#xA;Updated: Monday, May 20, 2024&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2024-05-20-clean-lens.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Remove openSUSE Pattern</title>

<updated>2024-02-01T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2024-02-01:/gemlog/2024-02-01-remove-opensuse-pattern.gmi</id>

<content type="text/plain">&#xA;# Remove openSUSE Pattern&#xA;&#xA;I wanted to remove XFCE since I wasn&#39;t using it. Simply removing &#34;xfce&#34; at the command line only removed SuSE&#39;s &#34;pattern&#34; package: a placeholder that pulls in dependencies. Use --clean-deps to remove all the packages associated with a pattern. &#xA;&#xA;``` PowerShell&#xA;sudo zypper remove --clean-deps --type pattern xfce&#xA;&#xA;Reading installed packages...&#xA;Resolving package dependencies...&#xA;&#xA;The following 159 packages are going to be REMOVED:&#xA;  blueman cups-pk-helper evince evince-plugin-pdfdocument file-roller galculator&#xA;  ...&#xA;&#xA;The following pattern is going to be REMOVED:&#xA;  xfce&#xA;&#xA;159 packages to remove.&#xA;After the operation, 60.7 MiB will be freed.&#xA;Continue? [y/n/v/...? shows all options] (y): &#xA;&#xA;```&#xA;&#xA;&#xA;## References &#xA;&#xA;=&gt; https://en.opensuse.org/SDB:Zypper_manual    man zypper | openSuSE Wiki&#xA;&#xA;Created: Thursday, February 1, 2024 &#xA;Updated: Thursday, February 1, 2024 &#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2024-02-01-remove-opensuse-pattern.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Wayland Video Playback</title>

<updated>2024-01-31T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2024-01-31:/gemlog/2024-01-31-wayland-video.gmi</id>

<content type="text/plain">&#xA;# Wayland Video Playback&#xA;&#xA;I have an AMD Ryzen 7 6800H mini PC. This has a modest integrated graphics card. And, one of the things holding me back from switching to Wayland was video playback. When I watch a video on Wayland, there is a loss of frame rate to the point where I get motion sick. &#xA;&#xA;I was recently watching RetroBytes&#39; &#34;The History of X11&#34;. And it suddenly occurred to me that the problem might be that I&#39;m using an application compiled for X11. And that is forcing my video to be emulated by XWayland. This might be a source of the latency I experience. &#xA;&#xA;I&#39;m using openSUSE which comes with a Wayland version of KDE. I logged into &#34;Plasma (Wayland)&#34;. And I watched a video--specifically in Firefox. Firefox enabled Wayland support by default starting last December. &#xA;&#xA;Watching a video on Firefox was fine. &#xA;&#xA;Watching on YouTube, I tried to summon the Stats for Nerds. But it wouldn&#39;t launch. I&#39;m not very sophisticated in terms of graphics. So, I don&#39;t have a frame rate number to give. &#xA;&#xA;I can&#39;t be sure of the problem I was experiencing before. And I don&#39;t blame XWayland, Vivaldi, or whatever was causing the latency. But, my deal-breaking issue is solved. And, I feel comfortable switching to Wayland now. &#xA;&#xA;&#xA;## Firefox Support&#xA;&#xA;Firefox version 121 and later come with Wayland support enabled by default. &#xA;&#xA;You can check what protocol Firefox is using by opening a new tab and going to the address &#34;about:support&#34;. That internal Firefox diagnostic tab has a line called &#34;Window Protocol&#34;. The Window Protocol line should simply read &#34;Wayland&#34; if that&#39;s what you&#39;re using (instead of &#34;x11&#34;). &#xA;&#xA;You can see an example of this output in the Phoronix article below. The about:support page is shown in the background of a screen capture there. &#xA;&#xA;&#xA;## References &#xA;&#xA;=&gt; https://www.phoronix.com/news/Firefox-121-Available    Firefox 121 Now Available With Wayland Enabled By Default | Phoronix&#xA;=&gt; https://www.youtube.com/watch?v=R-N-fgKWYGU    The History of X11 | RetroBytes | YouTube&#xA;=&gt; https://www.amd.com/en/products/apu/amd-ryzen-7-6800h    AMD Ryzen 7 6800H Mobile Processor Specifications | AMD&#xA;=&gt; https://www.techpowerup.com/gpu-specs/radeon-680m.c3871    AMD Radeon 680M Specs | TechPowerUp GPU Database&#xA;&#xA;Created: Wednesday, January 31, 2024&#xA;Updated: Wednesday, January 31, 2024 &#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2024-01-31-wayland-video.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Working around suse.vimrc</title>

<updated>2024-01-18T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2024-01-18:/gemlog/2024-01-18-opensuse-vim.gmi</id>

<content type="text/plain">&#xA;# Working around suse.vimrc&#xA;&#xA;I use the command-line editor Vim. And, when I switched to openSuSE, I was stuck with a bunch of default Vim options I didn&#39;t like. For example, pressing Esc takes a second to work where doing the same thing on Manjaro worked immediately. Using the :scriptnames Vim command, I could see that $VIMRUNTIME/suse.vimrc was being run. But it wasn&#39;t clear how to disable it. I assume that any updates to the package would overwrite any changes made directly to suse.vimrc  &#xA;&#xA;I contacted a SuSE developer and asked about this. I was told that suse.vimrc was hardcoded into Vim&#39;s initialization via a patch. And I should open a bug to get suse.vimrc fixed. But, when I looked, there were already some bugs open. And they were a few years old. &#xA;&#xA;So, I decided to switch to Flatpak instead. The Flatpak won&#39;t reference suse.vimrc  And the bothersome options should go away. &#xA;&#xA;I&#39;m using PowerShell. So, I&#39;ll need a Flatpak alias there. &#xA;&#xA;&#xA;## Remove Vim RPM&#xA;&#xA;Let me uninstall the Vim RPMs. &#xA;&#xA;``` PowerShell&#xA;sudo zypper remove vim gvim vim-data vim-data-common&#xA;&#xA;Reading installed packages...&#xA;Resolving package dependencies...&#xA;&#xA;The following 4 packages are going to be REMOVED:&#xA;  gvim vim vim-data vim-data-common&#xA;&#xA;4 packages to remove.&#xA;After the operation, 45.3 MiB will be freed.&#xA;Continue? [y/n/v/...? shows all options] (y): &#xA;(1/4) Removing gvim-9.1.0000-1.1.x86_64 ..................................[done]&#xA;(2/4) Removing vim-9.1.0000-1.1.x86_64 ...................................[done]&#xA;(3/4) Removing vim-data-9.1.0000-1.1.noarch ..............................[done]&#xA;(4/4) Removing vim-data-common-9.1.0000-1.1.noarch .......................[done]&#xA;Running post-transaction scripts .........................................[done]&#xA;&#xA;```&#xA;&#xA;&#xA;## Install Vim Flatpak&#xA;&#xA;Let&#39;s install the Vim Flatpak. &#xA;&#xA;``` PowerShell&#xA;sudo flatpak install flathub org.vim.Vim  &#xA;&#xA;Looking for matches…&#xA;&#xA;org.vim.Vim permissions:&#xA;    ipc                   network       x11       file access [1]&#xA;    dbus access [2]&#xA;&#xA;    [1] /tmp, /var/tmp, host&#xA;    [2] org.freedesktop.Flatpak&#xA;&#xA;&#xA;        ID               Branch      Op      Remote       Download&#xA; 1. [✓] org.vim.Vim      stable      i       flathub      9.3 MB / 14.8 MB&#xA;&#xA;Installation complete.&#xA;&#xA;```&#xA;&#xA;&#xA;## Create PowerShell Alias&#xA;&#xA;The PowerShell alias is a bit of a pain. &#xA;&#xA;``` PowerShell&#xA;Function vim { /usr/bin/flatpak run org.vim.Vim @Args }&#xA;&#xA;```&#xA;&#xA;Remember, you need an alias in your shell or you have to type the full Flatpak command each time. &#xA;&#xA;In PowerShell, you cannot create an alias with parameters as you can in Bash, Zsh, and Fish. Instead, you have to use a function. Then, the function won&#39;t pass parameters through to Vim. So, you have to include @Args. The PowerShell documentation doesn&#39;t give a complete example in one place. And, I had to bounce around before I collected the necessary pieces. &#xA;&#xA;Place the function in your PowerShell profile or run it once at the command line. Then you can call Vim with parameters (vim -p *.txt), and that should work. &#xA;&#xA;&#xA;## Remove Flatpak&#xA;&#xA;If you want to remove the Flatpak in the future, you can use this command. &#xA;&#xA;``` PowerShell&#xA;sudo flatpak uninstall org.vim.Vim        &#xA;&#xA;        ID               Branch      Op&#xA; 1. [-] org.vim.Vim      stable      r&#xA;&#xA;Uninstall complete.&#xA;&#xA;```&#xA;&#xA;&#xA;## References &#xA;&#xA;=&gt; https://www.pragmaticlinux.com/2021/01/how-to-install-flatpak-applications-from-flathub/    How to install Flatpak applications from Flathub | PragmaticLinux&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/set-alias#example-5-create-an-alias-for-a-command-with-parameters    Example 5: Create an alias for a command with parameters | Microsoft Learn&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions#using-splatting-to-represent-command-parameters    Using @Args to Pass Parameters | Microsoft Learn&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_profiles    PowerShell Profiles | Microsoft Learn&#xA;&#xA;Created: Thursday, January 18, 2024 &#xA;Updated: Thursday, January 18, 2024 &#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2024-01-18-opensuse-vim.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>List Running Images</title>

<updated>2024-01-13T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2024-01-13:/gemlog/2024-01-13-list-process.gmi</id>

<content type="text/plain">&#xA;# List Running Images&#xA;&#xA;I wanted to generate a list of running processes. But, instead of getting 300 Firefox processes, this PowerShell one-liner lists each image uniquely. &#xA;&#xA;``` PowerShell&#xA;Get-Process | Select-Object -Property Name,Path | Sort-Object -Property Path -Unique                                         &#xA;&#xA;Name                           Path&#xA;----                           ----&#xA;(sd-pam)                       &#xA;chrome_crashpad_handler        /opt/vivaldi/chrome_crashpad_handler&#xA;Vivaldi-Zygote                 /opt/vivaldi/vivaldi-bin&#xA;pwsh                           /snap/powershell/261/opt/powershell/pwsh&#xA;akonadi_akonotes_resource      /usr/bin/akonadi_akonotes_resource&#xA;akonadi_archivemail_agent      /usr/bin/akonadi_archivemail_agent&#xA;...&#xA;&#xA;```&#xA;&#xA;## References &#xA;&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-process    Get-Process | Microsoft Learn&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-member    Get-Member | Microsoft Learn&#xA;=&gt; https://learn.microsoft.com/powershell/module/Microsoft.PowerShell.Utility/Select-Object    Select-Object | Microsoft Learn&#xA;=&gt; https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/sort-object    Sort-Object | Microsoft Learn&#xA;&#xA;Created: Saturday, January 13, 2024&#xA;Updated: Saturday, January 13, 2024&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2024-01-13-list-process.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>KDE plasmashell High CPU Usage Work-around</title>

<updated>2023-12-07T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2023-12-07:/gemlog/2023-12-07-plasmashell-cpu.gmi</id>

<content type="text/plain">&#xA;# KDE plasmashell High CPU Usage Work-around&#xA;&#xA;I updated openSUSE today. And I can see my &#34;plasmashell&#34; process is maxing out one of my CPU cores and causing KDE to run slowly. I can also hear my CPU fan running on high. &#xA;&#xA;I tried logging on as a different user. And I did not have a problem. &#xA;&#xA;I&#39;m assuming there is some KDE configuration problem specific to the affected user. After removing their configuration and rebooting, that user no longer had a problem. &#xA;&#xA;Note you can use KDE&#39;s &#34;System Monitor&#34; (plasma-systemmonitor) to view CPU usage in a desktop environment. Otherwise &#34;top&#34; or a similar command-line program can show CPU usage. &#xA;&#xA;I&#39;m using plasmashell version 5.27.9  &#xA;&#xA;&#xA;## Back Up and Remove KDE Configuration  &#xA;&#xA;Since my other login did not have a problem, I assumed the software and hardware were working but one particular configuration was broken. &#xA;&#xA;While I don&#39;t know the precise KDE configuration causing the problem, renaming the entire configuration directory is a quick way to restore the performance of KDE. &#xA;&#xA;These same steps can be done with any file explorer or shell. In a graphical file explorer, you might have to change a setting to &#39;Show Hidden Files&#39; before you will see directories like .config   &#xA;&#xA;I&#39;ve chosen to make the changes with PowerShell. Let&#39;s rename (or move) that user&#39;s entire ~/.config folder. &#xA;&#xA;Below I have some comments, a command like &#34;Get-ChildItem -Force&#34;, and the output from the command. I put a few empty lines between different commands that I ran. &#xA;&#xA;``` PowerShell&#xA;# List the contents of the home directory (~/). &#xA;# Using &#39;-Force&#39; with Get-ChildItem will show hidden items like the&#xA;# &#39;~/.config&#39; directory. &#xA;Get-ChildItem -Force&#xA;&#xA;Directory: /home/michael&#xA;&#xA;UnixMode   User    Group      LastWriteTime   Size Name&#xA;--------   ----    -----      -------------   ---- ----&#xA;drwx------ michael michael  12/7/2023 13:23   1178 .cache&#xA;drwx------ michael michael  12/7/2023 13:27   2872 .config&#xA;drwxr-xr-x michael michael  7/20/2023 13:15     58 .frozen-bubble&#xA;...&#xA;&#xA;&#xA;# Use Move-Item to rename the directory. &#xA;# Moving resets the configuration while backing up the existing settings. &#xA;Move-Item .config .config-backup&#xA;&#xA;&#xA;# Check for the changes. &#xA;# .config is now .config-backup&#xA;Get-ChildItem -Force&#xA;&#xA;Directory: /home/michael&#xA;&#xA;UnixMode   User    Group      LastWriteTime   Size Name&#xA;--------   ----    -----      -------------   ---- ----&#xA;drwx------ michael michael  12/7/2023 13:31   1178 .cache&#xA;drwx------ michael michael  12/7/2023 13:33   2872 .config-backup&#xA;drwxr-xr-x michael michael  7/20/2023 13:15     58 .frozen-bubble&#xA;...&#xA;&#xA;```&#xA;&#xA;After renaming the directory, I rebooted my computer. &#xA;&#xA;The next time I logged in as that user, I did not have high CPU usage from the plasmashell process. So, my problem is solved now. &#xA;&#xA;After the steps earlier, logging in should create a new ~/.config with the default settings. &#xA;&#xA;``` PowerShell&#xA;# After rebooting, a new .config directory is created. &#xA;Get-ChildItem -Force&#xA;&#xA;Directory: /home/michael&#xA;&#xA;UnixMode   User    Group      LastWriteTime   Size Name&#xA;--------   ----    -----      -------------   ---- ----&#xA;drwx------ michael michael  12/7/2023 13:31   1178 .cache&#xA;drwx------ michael michael  12/7/2023 13:40   2872 .config&#xA;drwx------ michael michael  12/7/2023 13:33   2872 .config-backup&#xA;drwxr-xr-x michael michael  7/20/2023 13:15     58 .frozen-bubble&#xA;...&#xA;&#xA;```&#xA;&#xA;&#xA;## Restoring Application Configurations&#xA;&#xA;Renaming the entire ~/.config directory will cause many programs to lose their settings. &#xA;&#xA;You can restore the settings for individual applications by copying from ~/.config-backup to ~/.config&#xA;&#xA;For example, to restore the settings for the Vivaldi web browser, I might copy the &#34;~/.config-backup/vivaldi/&#34; directory to &#34;~/.config/&#34;  That would create a new directory there: ~/.config/vivaldi/ &#xA;&#xA;You might be prompted to overwrite when pasting into ~/.config  This is normal if an application ran at least once since rebooting and created a default configuration. As long as you preserve a copy of ~/.config-backup, you should eventually be able to troubleshoot and restore your application settings. &#xA;&#xA;Now that KDE is performing normally, it is faster and easier to use the file browser (KDE Dolphin) to copy these folders and restore settings. Just remember to turn the &#34;Show Hidden Files&#34; setting on to be able to see .config and .config-backup in your home directory (eg /home/michael). &#xA;&#xA;&#xA;Created: Thursday, December 7, 2023&#xA;Updated: Thursday, December 7, 2023&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2023-12-07-plasmashell-cpu.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Nation Books</title>

<updated>2023-11-18T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2023-11-18:/gemlog/2023-11-18-nation-books.gmi</id>

<content type="text/plain"># Nation Books&#xA;&#xA;I was reading a book which invited me to visit the publisher: Nation Books. Searching online, I did not immediately find what I was looking for. However, if you visit the web address directly, you are redirected to Type Media Center&#39;s Bold Type Books imprint. My book is listed there. And Bold Type Books appears to be the successor to Nation Books. I&#39;m leaving this breadcrumb to help others find the current publisher. &#xA;&#xA;=&gt; https://typemediacenter.org/boldtypebooks/    Books - Type Media Center&#xA;&#xA;Created: Saturday, November 18, 2023&#xA;Updated: Saturday, November 18, 2023&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2023-11-18-nation-books.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>USB Charging Standards</title>

<updated>2023-10-13T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2023-10-13:/gemlog/2023-10-13-usb-charging.gmi</id>

<content type="text/plain">&#xA;# USB Charging Standards &#xA;&#xA;I collect high quality flashlights (torches) as a hobby. And, as a result, I&#39;ve been trying to make sense of the USB charging standards. What I found was confusing and, frankly, not standard. Here&#39;s what I found. &#xA;&#xA;&#xA;## USB &#xA;&#xA;The oldest voltage and amperage standard for USB is 5 volts and 500 milliamps or 0.5 amps. &#xA;&#xA;This is just meant to power a keyboard or mouse. And, it is not really useful for charging modern devices. &#xA;&#xA;&#xA;## 5V/2A or iPad Compatible &#xA;&#xA;As far as I can tell, the next most relevant standard for charging is a de facto standard that Apple created. Some older Apple chargers and Apple devices (iPhone, iPad) would support charging at up to 10 watts. This is commonly referred to as &#34;iPad compatible&#34; or &#34;5V/2A&#34;. &#xA;&#xA;While I found charging at 10W referred to as &#34;USB standard charging&#34;, there is no 5V/2A USB standard as far as I can tell. Instead, this charging scheme is something Apple developed.  &#xA;&#xA;&#xA;## Quick Charge (QC)&#xA;&#xA;The next most relevant standard is Qualcomm&#39;s proprietary Quick Charge standard. This is common on Android phones. And some flashlights explicitly support QC. The device and the charger both explicitly have to be QC for this to work. &#xA;&#xA;One important warning is that QC 4 is not backwards compatible. So, you might want to choose QC 3, QC 4+, or QC 5 chargers which are backwards compatible. The QC 4+ standard appears to have fixed the compatibility issue from QC 4. &#xA;&#xA;Something else to watch out for are chargers with multiple ports. Cheaper chargers will only support Quick Charge on one port while the other ports will be 5V/2A. Make sure to check how many charging ports support QC if you intend to charge multiple Quick Charge devices at the same time. &#xA;&#xA;&#xA;### Quick Charge USB Cables &#xA;&#xA;I want to buy a new charging cable. But, I wasn&#39;t sure what the cable requirements are for Quick Charge. From the Qualcomm FAQ:&#xA;&#xA;&gt; Q: Does it matter what type of charging cable is used with a Quick Charge adapter?&#xA;&gt; &#xA;&gt; A: Quick Charge is designed to be connector- and current-independent. ... Quick Charge high-voltage operation is designed to minimize charging issues associated with long or thin cables, allowing for a superior charging experience, independent of cable type or cable current capability.&#xA;&#xA;That&#39;s not very precise. And, it leaves a lot of room for misinterpretation and poor consumer experience. &#xA;&#xA;After shopping for a while, I did find a few references to either Quick Charge or the charging capacity in watts claimed by the cable manufacturer. But, these claims seemed dated: reflecting the dates when these products came on the market. It doesn&#39;t seem like much attention is paid to whether or not a particular cable is Quick Charge compatible. And, Qualcomm&#39;s data doesn&#39;t allow cable manufacturers to give a definitive answer like &#34;This cable is compatible with QC 3.0.&#34; &#xA;&#xA;My best guess is that most cables will support Quick Charge. And, if you spend more than $10 on a cable then you should be fine. But, that dollar amount is arbitrary; I based it more on reviewers who said their cheap cables fell apart than anything to do with charging. &#xA;&#xA;Update: I bought a combination cable with three different ends--USB-C/Micro USB/Lightning--so I could also charge some old devices without swapping the cable. The product description reads &#34;Compatible with fast-charging devices.&#34; I&#39;m not sure about 5V/2A. But, I am not able to Quick Charge over the cable. My TM9K TAC will indicate when it is fast charging. But, it indicates slow charging while connected to a Quick Charger over this cable. I probably need a normal USB-A to USB-C cable for Quick Charge. So, watch out for these non-standard multi-cables. &#xA;&#xA;&#xA;## USB Battery Charging&#xA;&#xA;Eventually, the USB Implementers Forum standardized charging with &#34;USB Battery Charging&#34;. This charging standard does not appear to be used much because I never heard of it before today. Also, it is capped at 7.5W which can&#39;t quickly charge the high capacity batteries commonly used today. &#xA;&#xA;&#xA;## USB Power Delivery (USB-PD) &#xA;&#xA;USB Power Delivery doesn&#39;t appear to be relevant for charging mobile devices or flashlights. It supports much higher wattages (100W). I have not seen any mobile devices say they are compatible with USB-PD. And it seems mostly aimed at either charging laptops or providing wire line power for monitors or external hard drives which would otherwise need a separate power cable. &#xA;&#xA;&#xA;## USB-C to USB-C Charging&#xA;&#xA;As a further wrinkle, all my lights shipped with a USB-A to USB-C charging cable. And they can charge at full speed with those cables. &#xA;&#xA;While I don&#39;t charge with a C-to-C cable, many people have reported that charging with a USB C-to-C cable doesn&#39;t work. So, device compatibility with a C-to-C cable is something you have to check for before you buy. &#xA;&#xA;If you are purchasing a charger, I would stick with chargers that provide USB-A ports as those seem to be the most compatible. &#xA;&#xA;&#xA;## Gallium Nitride (GaN)&#xA;&#xA;While researching chargers, you might see the term &#34;GaN&#34; used. Gallium nitride (GaN) chargers use a newer technology that lets them operate at a high wattage while remaining cool. GaN chargers are superior to older silicon chargers. But, you don&#39;t need to replace your charger if you don&#39;t want to. GaN is a nice upgrade, but it is not required especially if you already have a charger that is compatible with your device. &#xA;&#xA;&#xA;## Example &#xA;&#xA;To make sense of this, let&#39;s take a look at my three lights. &#xA;&#xA;One light says it supports 5V/2A charging. &#xA;One light says it supports QC 2.0, QC 3.0, or 5V/2A. and&#xA;One light says it supports &#34;QC&#34; or 5V/2A. &#xA;&#xA;The &#34;5V/2A&#34; corresponds to that Apple de facto charging standard and will work with chargers that either explicitly list &#34;5V/2A&#34; or that make some comment about being Apple or iPhone/iPad compatible. So, I can charge all these lights with an Apple compatible charger since they all list 5V/2A as an option. &#xA;&#xA;It was a relief to read &#34;QC 2.0 and QC 3.0&#34; compatible because that was the clearest claim I read today. That light is compatible with those standards. Just make sure the charger is not using QC 4 because that standard is not backward compatible. I would use a QC 3, QC 4+, or QC 5 charger with this light.  &#xA;&#xA;The final light doesn&#39;t specify which Quick Charge standard it is compatible with. Realistically, the light probably can&#39;t charge faster than QC 2 or 3. So, I would look for a QC 3 charger to pair with this light. &#xA;&#xA;That&#39;s it. I hope this clears up some of the confusion around phone (and flashlight) charging. &#xA;&#xA;&#xA;## References&#xA;&#xA;=&gt; https://en.wikipedia.org/wiki/USB_hardware#Power    USB Power | Wikipedia&#xA;=&gt; https://www.qualcomm.com/products/features/quick-charge    Quick Charge | Qualcomm &#xA;=&gt; https://www.qualcomm.com/products/features/quick-charge/faq    Quick Charge FAQ | Qualcomm&#xA;=&gt; https://en.wikipedia.org/wiki/Quick_Charge    Quick Charge | Wikipedia&#xA;=&gt; https://www.reddit.com/r/flashlight/comments/tk4d4y/lights_that_dodont_support_ctoc_charging/    Lights that do/don&#39;t support C-to-C charging | Reddit &#xA;=&gt; https://electronics.stackexchange.com/questions/585691/do-all-usb-c-to-usb-c-cables-support-qc-3-0-what-about-pd-3-0    USB-C to USB-C Charging Cables | Stack Exchange&#xA;=&gt; https://www.howtogeek.com/509209/what-is-a-gan-charger-and-why-will-you-want-one/    What Is a GaN Charger, and Why Will You Want One? | How-To Geek&#xA;&#xA;Created: Friday, October 13, 2023 &#xA;Updated: Friday, May 24, 2024 &#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2023-10-13-usb-charging.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Updating macOS from the Terminal</title>

<updated>2023-07-25T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2023-07-25:/gemlog/2023-07-25-update-macos.gmi</id>

<content type="text/plain">&#xA;# Updating macOS from the Terminal &#xA;&#xA;It is possible to update macOS from the Terminal. &#xA;&#xA;## Simple Example &#xA;&#xA;### Update All&#xA;&#xA;``` zsh&#xA;softwareupdate -i -a&#xA;&#xA;```&#xA;&#xA;### Update One &#xA;&#xA;Use softwareupdate with the lowercase L option to list possible updates. &#xA;&#xA;Then, use the lowercase I option with the name of an update. Use quotes to escape spaces in the update name. &#xA;&#xA;``` zsh&#xA;softwareupdate -l &#xA;* macOS Update One&#xA;&#xA;softwareupdate -i &#34;macOS Update One&#34; &#xA;&#xA;```&#xA;&#xA;## Complete Example &#xA;&#xA;Commands that change the system must be run as root. In practice, this means you must be logged on as an administrator. And, most commands must be run with sudo. &#xA;&#xA;Note: The first user created on new a Mac is an administrator. &#xA;&#xA;``` zsh&#xA;# An unprivileged user can list updates. &#xA;softwareupdate -l &#xA;* macOS Update One&#xA;&#xA;# To install updates, log in as an administrator. &#xA;su adminuser&#xA;&#xA;# You must use sudo with the softwareupdate -i option. &#xA;sudo softwareupdate -i &#34;macOS Update One&#34; &#xA;&#xA;# Or&#xA;sudo softwareupdate -i -a&#xA;&#xA;```&#xA;&#xA;## Notes &#xA;&#xA;I expect to be able to update the system from the terminal with a simple command: &#xA;&#xA;* Issue the command. &#xA;* Download. &#xA;* Update. &#xA;* Reboot. &#xA;&#xA;This would mirror what happens when using System Settings &gt; Software Update. &#xA;&#xA;Unfortunately, updating from the terminal works in unexpected and unhelpful ways. &#xA;&#xA;For example, while updating through System Settings can be done by an unprivileged user, updating from the terminal must be done with sudo. That also means the user must be in the sudoers file. In other words, they must be an administrator. So, you must first log in as an administrator, which forces you to type your password. And, you must use sudo, which forces you to type your password again. So, compared to a graphical update, you must type your password twice to do the same thing. &#xA;&#xA;A further wrinkle is that the graphical Software Update is supported by Power Nap. And an update will continue in the background if initiated there. Whereas, Terminal commands will be interrupted when your Mac goes to sleep. And you will have to begin the download or installation from scratch. You can change your sleep settings, but then you must change them back after the update. This is a bad workflow. &#xA;&#xA;There are also unanswered questions. For example, does Software Update (graphical) compete with softwareupdate (terminal)? For example, if I begin an update from the terminal then is that downloading a duplicate copy of the same file as Software Update? I don&#39;t know the answer to that question. But the programs don&#39;t appear to share state. If I start an update with one, that is not reflected by the other program. This just creates confusion and needlessly doubles the amount of data downloaded. &#xA;&#xA;I wish there was a clear and reliable procedure for updating a Mac from the terminal. &#xA;&#xA;With the way things stand, I recommend enabling Power Nap and then updating through System Settings. This seems to be the upgrade path that is best supported by recent versions of macOS. &#xA;&#xA;&#xA;## References &#xA;&#xA;=&gt; https://www.macrumors.com/how-to/update-macos-terminal-command/    How to Update macOS Using a Simple Terminal Command | MacRumors&#xA;=&gt; https://forums.macrumors.com/threads/big-sur-softwareupdate-a-i-restart.2287244/    Big Sur &amp; &#34;softwareupdate -a -i --restart&#34; ? | MacRumors Forums&#xA;=&gt; https://support.apple.com/guide/mac-help/aside/gloscddf7f3c/13.0/mac/13.0    Administrator | Apple Support&#xA;=&gt; https://apple.stackexchange.com/questions/62558/how-to-prevent-mac-sleep-from-command-line    How to prevent Mac sleep from command line? | Stack Exchange &#xA;=&gt; https://support.apple.com/HT201541    Update macOS on Mac | Apple Support&#xA;=&gt; https://support.apple.com/guide/mac-help/what-is-power-nap-mh40773/mac    What is Power Nap on Mac? | Apple Support&#xA;&#xA;Created: Tuesday, July 25, 2023 &#xA;Updated: Tuesday, July 25, 2023 &#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2023-07-25-update-macos.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Web API Articles</title>

<updated>2023-07-18T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2023-07-18:/gemlog/2023-07-18-web-api-articles.gmi</id>

<content type="text/plain">&#xA;# Web API Articles&#xA;&#xA;From time to time I need to work with web APIs. These normally allow computers to communicate online. But, it might be necessary for people to work with APIs to connect a business to a new service or to automate tasks. &#xA;&#xA;Below are some articles that I found helpful while learning about APIs. &#xA;&#xA;&#xA;## HTTP Methods &#xA;&#xA;RESTful APIs are built on HTTP methods. It is important to understand what HTTP methods are so that you can understand how different technologies relate and build on each other. An HTTP method is part of an HTTP message, and some articles talk about methods in the section on messages. HTTP methods are sometimes called verbs. &#xA;&#xA;=&gt; https://en.wikipedia.org/wiki/Representational_state_transfer    Representational state transfer (REST) | Wikipedia&#xA;=&gt; https://en.wikipedia.org/wiki/HTTP#HTTP/1.1_request_messages    HTTP Request Messages | Wikipedia&#xA;=&gt; https://developer.mozilla.org/en-US/docs/Web/HTTP/Messages    HTTP Messages | Mozilla Developer Network&#xA;=&gt; https://www.w3schools.com/tags/ref_httpmethods.asp    HTTP Methods | W3Schools&#xA;&#xA;&#xA;## Finding Undocumented APIs &#xA;&#xA;A journalist from The Markup wrote an introduction to APIs. In particular, the author focused on undocumented APIs. These are APIs from large companies which are available to the public but which are mostly used by the company itself. &#xA;&#xA;One useful website mentioned was cURL Converter. This takes cURL commands as input and outputs web requests in a coding language such as Python or PowerShell. This is useful because the Developer Tools in Firefox and Chrome can capture and output a request as a cURL command. So, there is a way to go from a real request to working code in a few steps. &#xA;&#xA;=&gt; https://inspectelement.org/apis.html#tutorial    Finding Undocumented APIs | Inspect Element&#xA;=&gt; https://curlconverter.com/    Convert curl commands to code | cURL Converter&#xA;&#xA;&#xA;## Basic Types of API Requests&#xA;&#xA;This short YouTube video gives an overview of the basic types of API requests (API architectural styles). You are most likely to encounter a RESTful API while interacting with a service. However, other types are used in specialized circumstances. &#xA;&#xA;=&gt; https://www.youtube.com/watch?v=4vLxWqE94l4    Top 6 Most Popular API Architecture Styles | ByteByteGo | YouTube&#xA;&#xA;&#xA;## JSON Web Tokens&#xA;&#xA;JSON Web Tokens (JWT) are often used by RESTful APIs to authenticate requests. &#xA;&#xA;=&gt; https://en.wikipedia.org/wiki/JSON_Web_Token    JSON Web Token | Wikipedia&#xA;=&gt; https://jwt.io/introduction    Introduction to JSON Web Tokens | jwt.io&#xA;&#xA;&#xA;## Postman&#xA;&#xA;One program I found useful was the Postman app. This allows you to build and store API templates in a graphical development environment. This helps people organize and test their API requests. &#xA;&#xA;=&gt; https://www.postman.com/downloads/    Download App | Postman &#xA;&#xA;&#xA;## cURL&#xA;&#xA;curl is a command-line tool that can be used to interact with web APIs. The command-line nature allows curl commands to be used in shell scripts like batch files or Bash scripts. Most operating systems come with a version of curl preinstalled. &#xA;&#xA;If you need help with curl, try asking on Stack Overflow. &#xA;&#xA;=&gt; https://curl.se/    cURL&#xA;=&gt; https://stackoverflow.com/tags/curl/info    curl tag | Stack Overflow&#xA;&#xA;&#xA;## PowerShell Cmdlets&#xA;&#xA;I prefer to use PowerShell for scripting. Here is the help article for the API cmdlet in PowerShell. &#xA;&#xA;=&gt; https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod    Invoke-RestMethod | Microsoft Learn&#xA;=&gt; https://curl.se/windows/microsoft.html    curl Alias in PowerShell | cURL&#xA;&#xA;&#xA;Created: Tuesday, July 18, 2023&#xA;Updated: Tuesday, July 18, 2023&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2023-07-18-web-api-articles.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Fix Vivaldi Graphical Corruption after Linux Update</title>

<updated>2023-07-14T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2023-07-14:/gemlog/2023-07-14-fix-vivaldi-graphics.gmi</id>

<content type="text/plain">&#xA;# Fix Vivaldi Graphical Corruption after Linux Update&#xA;&#xA;I updated openSUSE today. And, after launching the Vivaldi web browser, there was clear graphical corruption within the Vivaldi window immediately after launch. &#xA;&#xA;This issue can also be triggered by a Vivaldi update. I originally experienced this issue a month ago when I updated Vivaldi on a different system. &#xA;&#xA;The problem appears to be an underlying graphics upgrade which invalidates Vivaldi&#39;s graphics cache. &#xA;&#xA;## Solution &#xA;&#xA;The solution was to: &#xA;&#xA;* Close Vivaldi. &#xA;* Open your file browser. &#xA;* Navigate to ~/.config/vivaldi &#xA;* Search for &#34;GPUCache&#34; folders. &#xA;  The search results should include subfolders. &#xA;* Delete the GPUCache folders.&#xA;* Launch Vivaldi. &#xA;&#xA;Vivaldi should look ok now. &#xA;&#xA;## References &#xA;&#xA;=&gt; https://forum.vivaldi.net/topic/87925/vivaldi-is-corrupted/3    Vivaldi is corrupted | Vivaldi Forum&#xA;&#xA;Created: Friday, July 14, 2023&#xA;Updated: Friday, July 14, 2023&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2023-07-14-fix-vivaldi-graphics.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Chrooting into BTRFS</title>

<updated>2023-06-25T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2023-06-25:/gemlog/2023-06-25-chroot-btrfs.gmi</id>

<content type="text/plain">&#xA;# Chrooting into BTRFS&#xA;&#xA;I was trying to rescue my new Manjaro installation. But, I had never tried chrooting into a BTRFS volume before. &#xA;&#xA;chroot lets you rebase the file system from a running system (like a live USB flash drive) to the file system of a stopped system (like a broken Linux installation on your hard drive). By changing the root (chroot), utilities run inside the chrooted environment act as if they were being run on the computer that you are troubleshooting. So, if my Manjaro installation is not working, I can use my installation disc, chroot into my system, and run updates, check the logs, or run other utilities. In this way, chroot combines the functioning of the live system with the file system of the broken installation. &#xA;&#xA;Note that chroot is a terminal command. And only terminal commands run from a chrooted shell will affect the troubled system. Graphical utilities will affect the live system. &#xA;&#xA;After mounting the troubled file system, what confused me were the &#34;@&#34; directories. There were entries like @, @home, @log, and @cache. The names were familiar to me. These are common directories on Linux. What I did not understand was the significance of @ and how that related to BTRFS. &#xA;&#xA;## What are @ Directories?&#xA;&#xA;Directories preceded with @ are subvolumes in BTRFS. For example, @ (the root directory), @home, @log (/var/log), and @cache (/var/cache). &#xA;&#xA;As far as I can tell, @ doesn&#39;t have any special meaning. It is just a naming convention used to differentiate subvolumes from other directories. This naming convention ended up helping me by giving me something to search for online. But, in principle, subvolumes can look just like normal directories. &#xA;&#xA;I first saw @ directories by directly mounting the BTRFS volume and listing its contents. Below, I mount my BTRFS volume from /dev/nvme0n1p2 which represents a partition on my NVMe drive. Your drive and partition will be different. For example, /dev/sda1 would represent a SATA drive and partition. &#xA;&#xA;``` Bash &#xA;# Open a terminal. &#xA;# Log in as root on the live system. &#xA;sudo -i &#xA;# Make a directory to mount the file system to. &#xA;mkdir /chroot&#xA;# Mount the file system. &#xA;mount /dev/nvme0n1p2 /chroot&#xA;# List the contents of the file system. &#xA;ls -l /chroot&#xA;&#xA;```&#xA;&#xA;I don&#39;t have a working example at the moment. But, listing the contents of /chroot should produce directories like @, @home, @log, and @cache. &#xA;&#xA;While the BTRFS volume is mounted like this, you can also use the btrfs command to list the subvolumes. For example, this would be helpful if the subvolumes did not use @ in their names and there was no other way to tell which directories were subvolumes. &#xA;&#xA;``` Bash&#xA;# List the subvolumes at the mount point I created. &#xA;btrfs subvolume list /chroot&#xA;&#xA;```&#xA;&#xA;Note that the BTRFS volume is useless to us in this configuration. So, we unmount the volume as a last step. &#xA;&#xA;``` Bash &#xA;umount /chroot&#xA;&#xA;```&#xA;&#xA;&#xA;## How to chroot into BTRFS&#xA;&#xA;To get chroot working, I had to combine advice from different sources. &#xA;&#xA;Below are the commands that worked for me on my NVMe drive. &#xA;&#xA;The key is using the subvol= mount option to specify the BTRFS subvolume. Then, attach that subvolume to the correct location in the file system. &#xA;For example, @home to /chroot/home  &#xA;&#xA;&#xA;``` Bash &#xA;# Skip these first two steps if you&#39;ve already done them. &#xA;#sudo -i &#xA;#mkdir /chroot&#xA;# Mount the boot partition. Note I&#39;m mounting ...n1p1 instead of n1p2. &#xA;mount /dev/nvme0n1p1 /chroot/boot/efi &#xA;# Mount the root subvolume. &#xA;mount /dev/nvme0n1p2 /chroot/ -o subvol=@&#xA;# Mount the /home, /var/log, and /var/cache subvolumes. &#xA;mount /dev/nvme0n1p2 /chroot/home      -o subvol=@home&#xA;mount /dev/nvme0n1p2 /chroot/var/log   -o subvol=@log&#xA;mount /dev/nvme0n1p2 /chroot/var/cache -o subvol=@cache&#xA;# Clone the hardware devices into the chroot environment. &#xA;mount --bind /dev  /chroot/dev&#xA;mount --bind /sys  /chroot/sys&#xA;mount --bind /proc /chroot/proc&#xA;# Copy the network configuration from the live system. Note the trailing slash for /etc/&#xA;cp /etc/resolv.conf /chroot/etc/&#xA;&#xA;# Finally, chroot. &#xA;chroot /chroot&#xA;&#xA;```&#xA;&#xA;Now you are chrooted into the host file system. And, you can run utilities like pacman as if the host system were working. &#xA;&#xA;Since we are in a live system, you can simply reboot when you are done. All the changes above are specific to that ephemeral system and will be discarded after rebooting. &#xA;&#xA;If you want to interact with the live system while working, simply open a new terminal or use the graphical desktop environment. &#xA;&#xA;&#xA;## References &#xA;&#xA;=&gt; https://en.wikipedia.org/wiki/Chroot    chroot | Wikipedia&#xA;=&gt; https://unix.stackexchange.com/questions/18925/how-to-mount-a-device-in-linux    How to mount a device in Linux? | Unix &amp; Linux Stack Exchange&#xA;=&gt; https://askubuntu.com/questions/1443947/what-does-the-symbol-mean-when-in-front-of-a-directory-e-g-home#comment2519709_1443947    What does the &#34;@&#34; symbol mean when in front of a directory, e.g. &#34;@home&#34;? | Comment Link | Ask Ubuntu&#xA;=&gt; https://btrfs.readthedocs.io/en/stable/Subvolumes.html    Subvolumes | BTRFS Documentation&#xA;=&gt; https://forum.manjaro.org/t/howto-chroot-from-or-into-any-linux-distribution/34071    [HowTo] Chroot from or into any Linux distribution | Tutorials | Manjaro Linux Forum&#xA;=&gt; https://fedoramagazine.org/os-chroot-101-covering-btrfs-subvolumes/    OS Chroot 101: Covering BTRFS Subvolumes | Fedora Magazine&#xA;&#xA;Created: Sunday, June 25, 2023&#xA;Updated: Sunday, June 25, 2023&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2023-06-25-chroot-btrfs.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Killing All Processes When Logging Out</title>

<updated>2023-03-05T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2023-03-05:/gemlog/2023-03-05-terminate-on-logout.gmi</id>

<content type="text/plain">&#xA;# Killing All Processes When Logging Out&#xA;&#xA;I happened to run the Xfce Task Manager to troubleshoot an unrelated issue. And I noticed that the previous user of my computer had processes running in the background. I thought this was strange because my assumption is that all processes are terminated when a user logs off. In this case, I&#39;m sure the user logged out instead of switching users. &#xA;&#xA;It turns out that Arch Linux and Manjaro have a different default configuration. By default, Arch and Manjaro allow their service manager, systemd, to run in the background after logging off. The reason given is this allows terminal multiplexers--like tmux and screen--to work. So, in my case, it was systemd and a group of child processes that I saw running in the background. &#xA;&#xA;Below, I demonstrate two ways to reconfigure your system so that all processes are terminated when a user logs off. Both are based on the logind.conf file.  &#xA;&#xA;If you have a problem with these steps then check out the links in the References section. Those web pages contain useful information about other options and troubleshooting steps. For example, you can change the default and then create a list of users who are excluded from that setting. &#xA;&#xA;Also note that I used the Xfce application &#34;Task Manager&#34; to troubleshoot this issue. If you&#39;re not using the Xfce desktop environment then you can use &#34;ps aux&#34; as root in a terminal to list all processes. This should work for everyone. &#xA;&#xA;``` Bash&#xA;sudo ps aux&#xA;&#xA;[sudo] password for michael: &#xA;&#xA;USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND&#xA;root           1  0.0  0.0 169404 13784 ?        Ss   Feb25   0:02 /sbin/init&#xA;root           2  0.0  0.0      0     0 ?        S    Feb25   0:00 [kthreadd]&#xA;root           3  0.0  0.0      0     0 ?        I&lt;   Feb25   0:00 [rcu_gp]&#xA;root           4  0.0  0.0      0     0 ?        I&lt;   Feb25   0:00 [rcu_par_gp]&#xA;...&#xA;&#xA;```&#xA;&#xA;## Terminate Processes for All Users&#xA;&#xA;These instructions tell you how to change the default setting. By changing this setting, all processes will terminate when a user logs off. &#xA;&#xA;* Edit the logind.conf file while logged in as root. &#xA;&#xA;&gt; /etc/systemd/logind.conf&#xA;&#xA;For example, I can use the &#34;sudo&#34; command-line utility to invoke the advanced text editor Vim. And, I can include the file path in the same command. Below, I&#39;m prompted by sudo for my regular user password. After entering my password, Vim opens logind.conf with the correct permissions. &#xA;&#xA;``` PowerShell&#xA;sudo vim /etc/systemd/logind.conf&#xA;&#xA;[sudo] password for michael: &#xA;&#xA;# Vim opens the logind.conf file. &#xA;# ... &#xA;&#xA;```&#xA;&#xA;The logind.conf file requires some explanation. First, the comment symbol for this type of file is the number sign or hash symbol #. And you will notice that logind.conf lists all the default settings. But, each setting is disabled with a leading #. These disabled defaults provide a convenient way of viewing the settings and making changes. &#xA;&#xA;* Search inside logind.conf for the &#34;KillUserProcesses&#34; setting. &#xA;&#xA;Remember the line will begin with a # and it will have its default setting. &#xA;&#xA;It should look like this: &#xA;&#xA;&gt; #KillUserProcesses=no&#xA;&#xA;* Delete the comment symbol at the beginning of the line to enable this setting, and change &#39;no&#39; to &#39;yes&#39;. &#xA;&#xA;After making the changes, the line should look like this: &#xA;&#xA;&gt; KillUserProcesses=yes&#xA;&#xA;* Save your changes to the file. &#xA;&#xA;* Restart your computer to apply the new settings. &#xA;&#xA;By making this change, all processes will terminate when a user logs off. &#xA;&#xA;You can confirm this by checking your task manager. For example, I use Xfce on Manjaro. So I can log on as two different users. Then I can log off one of them. Next, I can run the &#34;Task Manager&#34; app with its &#34;Show all processes&#34; option set. I will see processes running under accounts that I don&#39;t recognize. This is normal. But, importantly, I won&#39;t see any processes running as the user that I logged off. That&#39;s what I expect to see now. &#xA;&#xA;## Terminate Processes for Select Users&#xA;&#xA;These instructions tell you how to change the logoff behavior for specific users. This was a better match for my situation where one user rarely logs on and it makes sense for their processes to terminate when they log off. &#xA;&#xA;* Edit the /etc/systemd/logind.conf file as root. &#xA;* Search for the &#34;KillOnlyUsers&#34; setting. &#xA;&#xA;It should look like this. &#xA;&#xA;&gt; #KillOnlyUsers=&#xA;&#xA;* Remove the leading number sign, and add a user to the setting. &#xA;&#xA;Keep in mind these users will have all their processes terminate when they log off. And other users will not be affected. &#xA;&#xA;For example, if I want to change the behavior when Bob logs off then I add the &#39;bob&#39; user to the setting.  &#xA;&#xA;&gt; KillOnlyUsers=bob&#xA;&#xA;Additional users can be added. Separate each user with a space. &#xA;&#xA;I am sure there is some official way to list the user names present on a system. But, my system is relatively simple. So, I just navigated to the /home/ directory and copied the user name from there. The name of each home directory is based on the user name. So this provides a convenient list of user names with the correct spelling and capitalization. Linux is case-sensitive. &#xA;&#xA;* Save your changes to the file. &#xA;&#xA;* Restart the computer. &#xA;&#xA;Now, after Bob logs off, all his user processes are closed. And I can confirm this by using the Xfce Task Manager while logged on as myself. &#xA;&#xA;## References &#xA;&#xA;=&gt; https://wiki.archlinux.org/title/Systemd/User#Kill_user_processes_on_logout    &#39;Kill user processes on logout&#39; | systemd | ArchWiki&#xA;=&gt; https://man.archlinux.org/man/logind.conf    Manual Page for logind.conf&#xA;=&gt; https://www.hostinger.com/tutorials/vps/how-to-manage-processes-in-linux-using-command-line    Help with the &#39;ps&#39; command | Hostinger&#xA;&#xA;Created: Sunday, March 5, 2023 &#xA;Updated: Sunday, March 5, 2023 &#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2023-03-05-terminate-on-logout.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Eliminating PulseAudio Pops</title>

<updated>2022-12-25T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-12-25:/gemlog/2022-12-25-pulseaudio-pops.gmi</id>

<content type="text/plain">&#xA;# Eliminating PulseAudio Pops&#xA;&#xA;After a brief pause in sound playback, my speakers make a popping sound. My operating system is Manjaro Linux 22.0 &#34;Sikaris&#34;. &#xA;&#xA;I believe the underlying cause is that the PulseAudio service puts my audio hardware to sleep. &#xA;&#xA;In principle, I would like to increase the timeout so that my sound card stays powered for longer periods after playing a sound. &#xA;&#xA;Unfortunately, I only found instructions for disabling the suspend-on-idle module. I searched for information on timeouts, but I only found information relating to PipeWire. I don&#39;t believe the PipeWire instructions apply to me. &#xA;&#xA;Below, I follow the instructions to disable PulseAudio&#39;s suspend-on-idle module. Note that Manjaro is based on Arch Linux. So, I can follow these instructions which come from the Arch wiki. &#xA;&#xA;## Create a User Configuration&#xA;&#xA;I created the following empty file in my home folder. &#xA;&#xA;If you have trouble finding the .config directory, remember that it is hidden by default. &#xA;&#xA;&gt; ~/.config/pulse/default.pa&#xA;&#xA;Then, I edited the file so that it contains the lines below. &#xA;&#xA;``` &#xA;.include /etc/pulse/default.pa&#xA;.nofail&#xA;unload-module module-suspend-on-idle&#xA;.fail&#xA;&#xA;```&#xA;&#xA;## Restart PulseAudio&#xA;&#xA;To apply the configuration change, I restarted the two PulseAudio systemd user units. &#xA;&#xA;Remember to use the &#34;--user&#34; flag with the systemctl command. &#xA;&#xA;And press &#39;q&#39; to leave the systemctl pager after checking the status. &#xA;&#xA;``` Shell&#xA;# Restart PulseAudio&#xA;systemctl --user restart pulseaudio.socket pulseaudio.service&#xA;&#xA;# No output. &#xA;&#xA;&#xA;# Check the PulseAudio status. &#xA;# Use &#39;q&#39; to exit. &#xA;systemctl --user status pulseaudio.socket pulseaudio.service&#xA;&#xA;● pulseaudio.socket - Sound System&#xA;     Loaded: loaded (/usr/lib/systemd/user/pulseaudio.socket; enabled; preset: &gt;&#xA;     Active: active (running) since Sat 2022-12-24 19:41:27 CST; 11s ago&#xA;      Until: Sat 2022-12-24 19:41:27 CST; 11s ago&#xA;   Triggers: ● pulseaudio.service&#xA;     Listen: /run/user/1000/pulse/native (Stream)&#xA;     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/pulseaudio&gt;&#xA;&#xA;Dec 24 19:41:27 Edward systemd[1341]: Listening on Sound System.&#xA;&#xA;● pulseaudio.service - Sound Service&#xA;     Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; disabled; preset&gt;&#xA;     Active: active (running) since Sat 2022-12-24 19:41:28 CST; 10s ago&#xA;TriggeredBy: ● pulseaudio.socket&#xA;   Main PID: 56725 (pulseaudio)&#xA;      Tasks: 6 (limit: 28809)&#xA;     Memory: 14.3M&#xA;        CPU: 213ms&#xA;     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pulsea&gt;&#xA;             ├─56725 /usr/bin/pulseaudio --daemonize=no --log-target=journal&#xA;             └─56731 /usr/lib/pulse/gsettings-helper&#xA;&#xA;Dec 24 19:41:27 Edward systemd[1341]: Starting Sound Service...&#xA;Dec 24 19:41:28 Edward pulseaudio[56725]: stat(&#39;/etc/pulse/default.pa.d&#39;): No s&gt;&#xA;&#xA;```&#xA;&#xA;You might notice an error during startup: &#xA;&#xA;&gt; Dec 24 19:41:28 Edward pulseaudio[56725]: stat(&#39;/etc/pulse/default.pa.d&#39;): No such file or directory &#xA;&#xA;I believe this is inherited from the last line in the default user configuration: &#xA;&#xA;&gt; /etc/pulse/default.pa&#xA;&#xA;``` &#xA;### Allow including a default.pa.d directory, which if present, can be used&#xA;### for additional configuration snippets.&#xA;.nofail&#xA;.include /etc/pulse/default.pa.d&#xA;&#xA;```&#xA;&#xA;This error probably existed the whole time, and I never had a reason to look at this log. So, the new configuration is not to blame. And I don&#39;t see any other problems. &#xA;&#xA;After creating the user configuration and restarting PulseAudio, the pops should be eliminated. &#xA;&#xA;## References &#xA;&#xA;=&gt; https://wiki.archlinux.org/title/PulseAudio/Troubleshooting#Pops_when_starting_and_stopping_playback    PulseAudio Instructions | ArchWiki&#xA;=&gt; https://wiki.archlinux.org/title/PulseAudio#Stopping    PulseAudio Service Names | ArchWiki&#xA;=&gt; https://wiki.archlinux.org/title/Systemd#Basic_systemctl_usage    Basic systemd Commands | ArchWiki&#xA;=&gt; https://support.system76.com/articles/audio/#configuration-tweaks    Advice About PipeWire Timeouts | System76 Support&#xA;=&gt; https://ask.fedoraproject.org/t/18076    Another Example of Changing the PipeWire Timeout | Ask Fedora&#xA;&#xA;Created: Saturday, December 24, 2022&#xA;Updated: Wednesday, January 4, 2023&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-12-25-pulseaudio-pops.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Cleaning Up an Old Kernel in Manjaro</title>

<updated>2022-12-24T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-12-24:/gemlog/2022-12-24-manjaro-old-kernel.gmi</id>

<content type="text/plain">&#xA;# Cleaning Up an Old Kernel in Manjaro&#xA;&#xA;I was updating Manjaro and received the following errors: &#xA;&#xA;``` Shell&#xA;(11/23) Updating linux initcpios...&#xA;==&gt; Building image from preset: /etc/mkinitcpio.d/linux515.preset: &#39;default&#39;&#xA;  -&gt; -k /boot/vmlinuz-5.15-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.15-x86_64.img&#xA;==&gt; ERROR: specified kernel image does not exist: `/boot/vmlinuz-5.15-x86_64&#39;&#xA;==&gt; Building image from preset: /etc/mkinitcpio.d/linux515.preset: &#39;fallback&#39;&#xA;  -&gt; -k /boot/vmlinuz-5.15-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.15-x86_64-fallback.img -S autodetect&#xA;==&gt; ERROR: specified kernel image does not exist: `/boot/vmlinuz-5.15-x86_64&#39;&#xA;&#xA;```&#xA;&#xA;Previously, I installed the Linux 5.15 kernel to troubleshoot an unrelated issue. And I uninstalled 5.15 using the &#34;Kernel&#34; applet within the Manjaro Settings Manager. It seems like one of the uninstallation scripts did work correctly because I&#39;ve had two issues since then. One, I still had the option to boot 5.15 from GRUB. So the boot menu was not updated. Two, I noticed the error above while updating Manjaro. &#xA;&#xA;I&#39;m not familiar with the GRUB bootloader. And I did not see clear instructions for fixing the boot menu. So, I installed and uninstalled the 5.15 kernel again. That fixed the boot menu at the cost of downloading the 5.15 kernel. &#xA;&#xA;Below are the steps to address the &#34;specified kernel image does not exist&#34; error from the pacman output (Manjaro update). &#xA;&#xA;## Specified Kernel Image Does Not Exist&#xA;&#xA;To begin my troubleshooting, I noticed the error refers to the file &#34;/etc/mkinitcpio.d/linux515.preset&#34;. So, I opened a shell and looked at the parent directory to see what was there.  &#xA;&#xA;``` PowerShell&#xA;PowerShell 7.3.1&#xA;&gt; Set-Location /etc/mkinitcpio.d/   &#xA;&gt; Get-ChildItem&#xA;&#xA;   Directory: /etc/mkinitcpio.d&#xA;&#xA;UnixMode   User Group    LastWriteTime Size Name&#xA;--------   ---- -----    ------------- ---- ----&#xA;-rw-r--r-- root root    9/4/2021 12:26  396 linux513.preset.pacsave&#xA;-rw-r--r-- root root  12/23/2021 11:06  396 linux515.preset&#xA;-rw-r--r-- root root   4/15/2022 03:59  396 linux517.preset.pacsave&#xA;-rw-r--r-- root root   6/15/2022 17:01  396 linux518.preset.pacsave&#xA;-rw-r--r-- root root    8/8/2022 00:54  396 linux519.preset.pacsave&#xA;-rw-r--r-- root root  10/10/2022 19:59  392 linux60.preset&#xA;-rw-r--r-- root root  12/20/2022 15:19  395 linux61.preset&#xA;&#xA;```&#xA;&#xA;That shows me the file exists: &#xA;&#xA;``` PowerShell&#xA;-rw-r--r-- root root  12/23/2021 11:06  396 linux515.preset&#xA;&#xA;```&#xA;&#xA;This listing also shows me that one preset is created for each version of the kernel that was installed. &#xA;&#xA;I recognize linux60 and linux61 as the two kernels I have installed now. &#xA;&#xA;I also noticed that some of the presets have an additional &#34;.pacsave&#34; file extension. And those files correspond to kernels I uninstalled. So, for example, I used to have Linux 5.17 installed, and now I see the &#34;linux517.preset.pacsave&#34; file.  &#xA;&#xA;I&#39;m not familiar with the &#34;/etc/mkinitcpio.d/&#34; directory. So, I searched the Manjaro forum for more information. &#xA;&#xA;I found a thread that said: &#xA;&#xA;&gt; Check what you got under /usr/lib/modules. If there are no linux## folders there then you can remove related files in /boot and /etc/mkinitcpio.d manually. Otherwise, you need to uninstall the linux package with pacman.&#xA;&#xA;This seemed like good information. &#xA;&#xA;Also, further down, someone mentioned &#34;sudo mhwd-kernel -li&#34; as a way to list the installed kernels. I have not used the mhwd-kernel command before. And I thought this was worth running.  &#xA;&#xA;``` PowerShell&#xA;PowerShell 7.3.1&#xA;&gt; # Check /usr/lib/modules. &#xA;&gt; Get-ChildItem /usr/lib/modules&#xA;&#xA;   Directory: /usr/lib/modules&#xA;&#xA;UnixMode   User Group    LastWriteTime Size Name&#xA;--------   ---- -----    ------------- ---- ----&#xA;drwxr-xr-x root root  12/24/2022 01:30 4096 6.0.15-1-MANJARO&#xA;drwxr-xr-x root root  12/20/2022 15:19 4096 6.1.0-1-MANJARO&#xA;drwxr-xr-x root root  12/24/2022 01:30 4096 6.1.1-1-MANJARO&#xA;drwxr-xr-x root root  12/24/2022 01:30 4096 extramodules-6.0-MANJARO&#xA;drwxr-xr-x root root  12/24/2022 01:30 4096 extramodules-6.1-MANJARO&#xA;&#xA;&gt; # I don&#39;t see any kernel 5.15 files in /usr/lib/modules &#xA;&gt; # So, it is ok to remove any 5.15 files from /boot and /etc/mkinitcpio.d&#xA;&#xA;&#xA;&gt; # Remove related files in /boot. &#xA;&gt; Get-ChildItem /boot&#xA;&#xA;   Directory: /boot&#xA;&#xA;UnixMode   User Group    LastWriteTime     Size Name&#xA;--------   ---- -----    -------------     ---- ----&#xA;drwxr-xr-x root root  12/24/2022 01:31     4096 grub&#xA;drwxr-xr-x root root  11/14/2022 09:34     4096 memtest86+&#xA;-rw------- root root  12/24/2022 01:30 38851001 initramfs-6.0-x86_64-fallback.img&#xA;-rw------- root root  12/24/2022 01:30  9116804 initramfs-6.0-x86_64.img&#xA;-rw------- root root  12/24/2022 01:31 39141988 initramfs-6.1-x86_64-fallback.img&#xA;-rw------- root root  12/24/2022 01:30  9116633 initramfs-6.1-x86_64.img&#xA;-rw-r--r-- root root   11/8/2022 13:02  5678080 intel-ucode.img&#xA;-rw-r--r-- root root  12/21/2022 15:13       21 linux60-x86_64.kver&#xA;-rw-r--r-- root root  12/21/2022 15:26       20 linux61-x86_64.kver&#xA;-rw-r--r-- root root  12/24/2022 01:30 11136192 vmlinuz-6.0-x86_64&#xA;-rw-r--r-- root root  12/24/2022 01:30 11178848 vmlinuz-6.1-x86_64&#xA;&#xA;&gt; # I don&#39;t see any 5.15 files in /boot&#xA;&gt; # There is nothing to do in the /boot directory. &#xA;&#xA;&#xA;&gt; # Check the mhwd-kernel -li output. &#xA;&gt; sudo mhwd-kernel -li&#xA;[sudo] password for michael: &#xA;Currently running: 6.1.0-1-MANJARO (linux61)&#xA;The following kernels are installed in your system:&#xA;   * linux60&#xA;   * linux61&#xA;&#xA;&gt; # Only Linux 6.0 and Linux 6.1 show which are the kernels I recognize as installed. &#xA;&#xA;```&#xA;&#xA;At this point I&#39;ve followed the advice I found. And I did not find any Linux 5.15 files under /usr/lib/modules or /boot. &#xA;&#xA;The advice says to remove the linux515.preset file. &#xA;&#xA;But, the original poster points out that other kernels use the .pacsave extension to signify that they are uninstalled. And it seemed like a good idea to follow this pattern. &#xA;&#xA;I agree. &#xA;&#xA;So, I also renamed my linux515.preset file to &#34;linux515.preset.pacsave&#34; &#xA;&#xA;Note that I give myself a root shell so my PowerShell cmdlets work: sudo -k pwsh  The trade-off is I lose the logging sudo would normally do for each command. &#xA;&#xA;``` PowerShell&#xA;PowerShell 7.3.1&#xA;&gt; sudo -k pwsh&#xA;[sudo] password for michael: &#xA;&#xA;&#xA;PowerShell 7.3.1&#xA;PS /etc/mkinitcpio.d# Set-Location /etc/mkinitcpio.d/&#xA;PS /etc/mkinitcpio.d# Get-ChildItem&#xA;   Directory: /etc/mkinitcpio.d&#xA;&#xA;UnixMode   User Group    LastWriteTime Size Name&#xA;--------   ---- -----    ------------- ---- ----&#xA;-rw-r--r-- root root    9/4/2021 12:26  396 linux513.preset.pacsave&#xA;-rw-r--r-- root root  12/23/2021 11:06  396 linux515.preset&#xA;-rw-r--r-- root root   4/15/2022 03:59  396 linux517.preset.pacsave&#xA;-rw-r--r-- root root   6/15/2022 17:01  396 linux518.preset.pacsave&#xA;-rw-r--r-- root root    8/8/2022 00:54  396 linux519.preset.pacsave&#xA;-rw-r--r-- root root  10/10/2022 19:59  392 linux60.preset&#xA;-rw-r--r-- root root  12/20/2022 15:19  395 linux61.preset&#xA;&#xA;&#xA;PS /etc/mkinitcpio.d# # Rename linux515.preset&#xA;PS /etc/mkinitcpio.d# Move-Item ./linux515.preset ./linux515.preset.pacsave&#xA;PS /etc/mkinitcpio.d# Get-ChildItem&#xA;&#xA;   Directory: /etc/mkinitcpio.d&#xA;&#xA;UnixMode   User Group    LastWriteTime Size Name&#xA;--------   ---- -----    ------------- ---- ----&#xA;-rw-r--r-- root root    9/4/2021 12:26  396 linux513.preset.pacsave&#xA;-rw-r--r-- root root  12/23/2021 11:06  396 linux515.preset.pacsave&#xA;-rw-r--r-- root root   4/15/2022 03:59  396 linux517.preset.pacsave&#xA;-rw-r--r-- root root   6/15/2022 17:01  396 linux518.preset.pacsave&#xA;-rw-r--r-- root root    8/8/2022 00:54  396 linux519.preset.pacsave&#xA;-rw-r--r-- root root  10/10/2022 19:59  392 linux60.preset&#xA;-rw-r--r-- root root  12/20/2022 15:19  395 linux61.preset&#xA;&#xA;PS /etc/mkinitcpio.d# &#xA;&#xA;```&#xA;&#xA;Since this issue only occurs during an update, I don&#39;t have a convenient way to test this change. The next time I update my computer, I will come back here and report the result. &#xA;&#xA;## References &#xA;&#xA;=&gt; https://forum.manjaro.org/t/mkinitcpio-tries-to-work-on-uninstalled-kernels/54399    Mkinitcpio tries to work on uninstalled kernels - Support - Manjaro Linux Forum&#xA;=&gt; https://www.sudo.ws/about/intro/    A Short Introduction | Sudo&#xA;&#xA;Created: Saturday, December 24, 2022&#xA;Updated: Saturday, December 24, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-12-24-manjaro-old-kernel.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Update Proprietary Media Codec for Vivaldi on Manjaro</title>

<updated>2022-12-07T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-12-07:/gemlog/2022-12-07-vivaldi-codec.gmi</id>

<content type="text/plain">&#xA;# Update Proprietary Media Codec for Vivaldi on Manjaro&#xA;&#xA;I noticed that the Vivaldi package on Manjaro stopped updating the proprietary media codec after installing or updating. It appears that some Linux distributions have gotten spooked. And maintainers have started to withdraw support for proprietary codecs in general. &#xA;&#xA;On my system, hardware acceleration is provided by a proprietary Nvidia driver. So, I just need the codec to restore video performance. &#xA;&#xA;You can update the Vivaldi codec yourself by running the update script like the package used to. &#xA;&#xA;## Update Codec&#xA;&#xA;Vivaldi ships with a script which updates the proprietary media codec it uses. Here is a shell session where I update my codec and poke around the file system a bit. &#xA;&#xA;``` PowerShell&#xA;&#xA;&gt; cd /opt/vivaldi&#xA;&#xA;&gt; ./update-ffmpeg&#xA;You may need to be root (or rerun this command with sudo)&#xA;rm: cannot remove &#39;/var/opt/vivaldi/media-codecs-ba918b1de5d2d2525de9b6ee1cd8434&#xA;ad90bebc107f927c1e23069fbf00ef8b6/libffmpeg.so&#39;: Permission denied&#xA;&#xA;&gt; sudo ./update-ffmpeg&#xA;[sudo] password for michael: &#xA;--2022-12-07 14:59:38--  https://launchpadlibrarian.net/628079667/chromium-codec&#xA;s-ffmpeg-extra_108.0.5327.0-0ubuntu9.18.04_amd64.deb&#xA;Loaded CA certificate &#39;/etc/ssl/certs/ca-certificates.crt&#39;&#xA;Resolving launchpadlibrarian.net (launchpadlibrarian.net)... 2620:2d:4000:1001::&#xA;8007, 2620:2d:4000:1001::8008, 185.125.189.228, ...&#xA;Connecting to launchpadlibrarian.net (launchpadlibrarian.net)|2620:2d:4000:1001:&#xA;:8007|:443... connected.&#xA;HTTP request sent, awaiting response... 200 OK&#xA;Length: 1213456 (1.2M) [application/x-debian-package]&#xA;Saving to: ‘STDOUT’&#xA;&#xA;-                   100%[===================&gt;]   1.16M  2.08MB/s    in 0.6s    &#xA;&#xA;2022-12-07 14:59:39 (2.08 MB/s) - written to stdout [1213456/1213456]&#xA;&#xA;Proprietary media codecs (108.0.5327.0) has been installed (PLEASE RESTART VIVAL&#xA;DI)&#xA;&#xA;&gt; cd /var/opt/vivaldi&#xA;&#xA;&gt; Get-ChildItem | Format-Table -AutoSize&#xA;&#xA;   Directory: /var/opt/vivaldi&#xA;&#xA;UnixMode   User Group   LastWriteTime Size Name&#xA;--------   ---- -----   ------------- ---- ----&#xA;drwxr-xr-x root root  12/7/2022 14:59 4096 media-codecs-61e498d3770eb4d4fd1f37f&#xA;                                           3eafce82433d8de0f51229c53bdfb3e7eb0e&#xA;                                           6a3ca&#xA;&#xA;&gt; cd ./media-codecs-61e498d3770eb4d4fd1f37f3eafce82433d8de0f51229c53bdfb3e7eb0e6&#xA;a3ca/&#xA;&#xA;&gt; Get-ChildItem | Format-Table -AutoSize&#xA;&#xA;   Directory: /var/opt/vivaldi/media-codecs-61e498d3770eb4d4fd1f37f3eafce82433d&#xA;8de0f51229c53bdfb3e7eb0e6a3ca&#xA;&#xA;UnixMode   User Group   LastWriteTime    Size Name&#xA;--------   ---- -----   -------------    ---- ----&#xA;-rw-r--r-- root root  12/7/2022 14:59 3338296 libffmpeg.so&#xA;&#xA;```&#xA;&#xA;Looking inside the script, I noticed it checks for a --user flag. So, it seems like you could update the codec just for yourself as an unprivileged user. I haven&#39;t tried it but it would look something like this: &#xA;&#xA;``` PowerShell&#xA;&gt; cd /opt/vivaldi&#xA;&#xA;&gt; ./update-ffmpeg --user&#xA;&#xA;```&#xA;&#xA;## References &#xA;&#xA;=&gt; https://gitlab.manjaro.org/packages/community/vivaldi/-/commit/eaf0e6ef58ddba75f15a7d5358a23fd77cecbcdc    Vivaldi Commit | Manjaro GitLab&#xA;=&gt; https://forum.manjaro.org/t/testing-update-2022-12-04-kernels-systemd-mesa-gnome/128325/    Codec Discussion | Testing Update | Manjaro Discourse&#xA;=&gt; https://lwn.net/Articles/910978/    News Article | LWN&#xA;&#xA;Created: Wednesday, December 7, 2022&#xA;Updated: Wednesday, December 7, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-12-07-vivaldi-codec.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Disable PowerShell Predictions</title>

<updated>2022-11-10T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-11-10:/gemlog/2022-11-10 - disable predictions.gmi</id>

<content type="text/plain">&#xA;# Disable PowerShell Predictions&#xA;&#xA;PowerShell IntelliSense is turned on by default starting in PowerShell v7.3.0. I find IntelliSense to be very distracting. &#xA;&#xA;To disable IntelliSense / predictions / suggestions, add the following lines to your profile: &#xA;&#xA;``` PowerShell&#xA;# Disable IntelliSense&#xA;Set-PSReadLineOption -PredictionSource None&#xA;&#xA;```&#xA;&#xA;You can also type that at the command line to disable IntelliSense for the current session. &#xA;&#xA;## References&#xA;&#xA;=&gt; https://devblogs.microsoft.com/powershell/announcing-psreadline-2-1-with-predictive-intellisense/    Announcing PSReadLine 2.1+ with Predictive IntelliSense | PowerShell Blog &#xA;=&gt; https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles    about_Profiles | Microsoft Docs&#xA;&#xA;Created: Thursday, November 10, 2022&#xA;Updated: Thursday, November 10, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-11-10%20-%20disable%20predictions.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Vim Menu for Tab Completion</title>

<updated>2022-10-23T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-10-23:/gemlog/2022-10-23-vim-wildmenu.gmi</id>

<content type="text/plain">&#xA;# Vim Menu for Tab Completion &#xA;&#xA;When you are working on the Vim command line, you can press the Tab key to complete the current command. Vim will fill in a complete file name or option depending on what letters you&#39;ve typed so far. Then, each press of Tab will cycle through the possible completions. Each time the command will be fully typed. And each possible completion is based on only what the user typed. &#xA;&#xA;One way to preview possible completions is by using Ctrl-D. To see this, type as much of your command as you want. Then press Ctrl-D. This prints all the options above the command line. But none of these can be selected. They&#39;re just visual aids for you. &#xA;&#xA;It would be nice if I could select from among the possible completions. &#xA;&#xA;## Set &#39;wildmenu&#39; &#xA;&#xA;Vim is able to provide a dynamic menu which will give you a list of options. This list pops up above the command line. And you can use the arrow keys or tab key to select which option you want. After selecting your option, you would press the Enter key to execute the complete command. &#xA;&#xA;You need a vimrc file. I have mine saved here: &#xA;&#xA;&gt; $HOME/.vim/vimrc&#xA;&#xA;To enable the menu, you have to add the following options to your vimrc file and save. &#xA;&#xA;``` vimrc &#xA;set wildmenu&#xA;set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx&#xA;&#xA;```&#xA;&#xA;&#39;wildignore&#39; specifies a list of file types which won&#39;t be offered while using tab completion. &#xA;&#xA;After saving your vimrc, close Vim and reopen it. &#xA;&#xA;Now, when you press Tab to complete a command, you will be presented with a menu. &#xA;&#xA;For example, pressing Tab after &#34;:help vimrc&#34; shows the following options above the command line: &#xA;&#xA;``` Vim&#xA;vimrc  .vimrc  _vimrc  vimrc-intro  vimrc-filetype  vimrc_example.vim ...&#xA;:help vimrc&#xA;&#xA;```&#xA;&#xA;## Vertical Menu &#xA;&#xA;By default, the &#39;wildmenu&#39; option shows possible completions horizontally. There is an alternative menu which will show completions vertically. &#xA;&#xA;Add the pum option to show the vertical menu instead. &#xA;&#xA;``` vimrc&#xA;set wildmenu&#xA;set wildoptions=pum&#xA;set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx&#xA;&#xA;```&#xA;&#xA;&#xA;&#xA;## References &#xA;&#xA;=&gt; https://vimhelp.org/usr_20.txt.html#20.3    Tab Completion | Vim Help &#xA;=&gt; https://vimhelp.org/cmdline.txt.html#c_CTRL-D    c_Ctrl-D | Vim Help &#xA;=&gt; https://www.freecodecamp.org/news/vimrc-configuration-guide-customize-your-vim-editor/    &#39;wildmenu&#39; example | freeCodeCamp&#xA;=&gt; https://vimhelp.org/starting.txt.html#vimrc    vimrc | Vim Help &#xA;=&gt; https://vimhelp.org/options.txt.html#%27wildmenu%27    &#39;wildmenu&#39; and &#34;pum&#34; menu | Vim Help&#xA;=&gt; https://vimhelp.org/options.txt.html#%27wildoptions%27    &#39;wildoptions&#39; | Vim Help &#xA;=&gt; https://vimhelp.org/options.txt.html#%27wildmode%27    &#39;wildmode&#39; | Vim Help &#xA;&#xA;Created: Sunday, October 23, 2022&#xA;Updated: Sunday, October 23, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-10-23-vim-wildmenu.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>How To Downgrade The Manjaro Kernel</title>

<updated>2022-10-16T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-10-16:/gemlog/2022-10-16-downgrade-kernel.gmi</id>

<content type="text/plain">&#xA;# How To Downgrade The Manjaro Kernel&#xA;&#xA;I am having a problem with my current kernel. I&#39;d like to downgrade. And I prefer to use Manjaro&#39;s graphical tools. &#xA;&#xA;The basic process is to manually boot into the old kernel using GRUB, and then disable the newer kernel. &#xA;&#xA;## Boot Older Kernel&#xA;&#xA;Before starting, make sure the old kernel is installed. &#xA;&#xA;* Open the Manjaro Settings Manager app. &#xA;* Open the Kernel applet. &#xA;* Make sure the older kernel is installed. &#xA;&#xA;Inside the Kernel app, there should be a label next to the older kernel which reads &#34;Installed&#34;. &#xA;&#xA;Alternatively, click the Install button and authenticate to install the older kernel. &#xA;&#xA;* Reboot your computer. &#xA;* Hold the Esc key while booting. &#xA;&#xA;The GRUB menu should load. &#xA;&#xA;* Choose the &#34;Advanced Options&#34; menu item. &#xA;&#xA;Use the arrow keys to select a menu option in GRUB. And press Enter to choose that option. &#xA;&#xA;* Choose the older kernel in the GRUB menu interface. &#xA;&#xA;Use the arrow keys to select the kernel. Press Enter to boot that kernel. &#xA;&#xA;There might be two versions of a kernel listed. &#xA;&#xA;In my case there were: &#xA;&#xA;&gt; Manjaro Linux (Kernel: 5.19.16-2-MANJARO x64)&#xA;&gt; Manjaro Linux (Kernel: 5.19.16-2-MANJARO x64 - fallback initramfs)&#xA;&#xA;I chose the standard option: without &#34;fallback initramfs&#34;. &#xA;&#xA;## Remove Newer Kernel &#xA;&#xA;At this point, you should have successfully booted the old kernel and logged into your desktop environment (ex GNOME, KDE, Xfce). &#xA;&#xA;* Return to the Manjaro Settings Manager &gt; Kernel applet. &#xA;* Click the &#34;Remove&#34; button next to the newer kernel. &#xA;&#xA;By default, Manjaro will boot into the newest kernel available. By removing the newer kernel, you will prevent Manjaro from booting into it. &#xA;&#xA;It is possible to change the default kernel by modifying GRUB. But the steps above are easier and more compatible with Manjaro&#39;s scripting. &#xA;&#xA;You might have to download the newer kernel again if you want to switch back. I&#39;m not sure if the kernel package is cached by the Manjaro package manager. &#xA;&#xA;## References&#xA;&#xA;=&gt; https://wiki.manjaro.org/index.php/Manjaro_Kernels    Kernels | Manjaro Wiki&#xA;&#xA;Created: Saturday, October 15, 2022&#xA;Updated: Saturday, October 15, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-10-16-downgrade-kernel.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Git Pull Before Checkout</title>

<updated>2022-10-16T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-10-16:/gemlog/2022-10-16-auto-pull.gmi</id>

<content type="text/plain">&#xA;# Git Pull Before Checkout&#xA;&#xA;VS Code introduced a feature to synchronize before switching branches: &#xA;&#xA;&gt; Pull before checkout&#xA;&gt; &#xA;&gt; This milestone we added a new setting, git.pullBeforeCheckout, to streamline the process of switching branches. When this setting is enabled, if there are no outgoing commits, we will pull from the remote and fast-forward the branch before checking it out.&#xA;&#xA;``` JSON &#xA;&#34;git.pullBeforeCheckout&#34;: true&#xA;&#xA;```&#xA;&#xA;## References &#xA;&#xA;=&gt; https://code.visualstudio.com/updates/v1_72#_pull-before-checkout    Pull Before Checkout | September 2022 Update&#xA;=&gt; https://git-scm.com/docs/git-checkout    checkout | Git Documentation&#xA;=&gt; https://git-scm.com/docs/git-pull    pull | Git Documentation&#xA;=&gt; https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging    &#34;fast-forward&#34; | Basic Branching and Merging | Git Book&#xA;=&gt; https://git-scm.com/docs/git-merge#_fast_forward_merge    &#34;fast-forward&#34; | merge | Git Documentation&#xA;&#xA;Created: Sunday, October 16, 2022&#xA;Updated: Sunday, October 16, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-10-16-auto-pull.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Find a URL in a Document While Using Vim</title>

<updated>2022-10-08T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-10-08:/gemlog/2022-10-08-search-url.gmi</id>

<content type="text/plain">&#xA;# Find a URL in a Document While Using Vim &#xA;&#xA;&gt; https://example.org/&#xA;&#xA;The forward slashes in a URL affect the search operator in Vim. And you won&#39;t be able to match the entire URL without using escape sequences. &#xA;&#xA;Below, I discuss different ways to search for a URL in Vim. &#xA;&#xA;## Use Escape Sequences&#xA;&#xA;The proper way to match a URL is to escape any characters which have special meaning using a backslash \  In our case, we escape the period \. and the forward slash \/ &#xA;&#xA;Press the forward slash to begin a search in Vim. Then type your search pattern. Then press the Enter key. &#xA;&#xA;So, if we are searching for this URL: &#xA;&#xA;&gt; https://example.org/&#xA;&#xA;Then we type these characters into Vim from Normal mode: &#xA;&#xA;``` Vim&#xA;/https:\/\/example\.org\/&#xA;&#xA;```&#xA;&#xA;Escaping always works. &#xA;&#xA;Here, we escape the period . which is a wildcard within regular expressions. &#xA;&#xA;And we escape the forward slash / which is the delimiter for the search command / &#xA;&#xA;Which characters you have to escape depends on the current &#34;magic&#34; setting for Vim. See References below. &#xA;&#xA;## Search for Unique Strings&#xA;&#xA;One shortcut you can take is that if your URL contains a unique string of characters then you can search for that string and ignore the rest of the URL. &#xA;&#xA;&gt; https://example.org/unique_path&#xA;&#xA;``` Vim&#xA;/unique_path&#xA;&#xA;```&#xA;&#xA;## Use the Search Backward Command &#xA;&#xA;If your URL is relatively simple then you can use the search backward command which begins with the question mark. &#xA;&#xA;In this case, use N to search forward and n to search backward. &#xA;&#xA;&gt; https://example.org/&#xA;&#xA;``` Vim&#xA;?https://example\.org/&#xA;&#xA;```&#xA;&#xA;If you feel comfortable dropping the literal period in the URL then you can also drop the escape sequence for the period. Just keep in mind that will now match any character between the &#34;example&#34; and &#34;org&#34;. &#xA;&#xA;&gt; https://example.org/&#xA;&gt; https://exampleAorg/&#xA;&gt; https://exampleBorg/&#xA;&gt; https://exampleCorg/&#xA;&#xA;``` Vim&#xA;?https://example.org/&#xA;&#xA;```&#xA;&#xA;## Use Wildcards for All Symbols &#xA;&#xA;A quick way to search for a URL is to replace any special characters with periods. &#xA;&#xA;The periods in the pattern below are wildcards. And that means any character could occupy those places. But the most likely outcome is that the pattern will only match the URL you are looking for. &#xA;&#xA;&gt; https://example.org/&#xA;&#xA;``` Vim&#xA;/https...example.org.&#xA;&#xA;```&#xA;&#xA;## Set the Search Register Directly&#xA;&#xA;If you have a more complicated URL, you can set the search register directly. &#xA;&#xA;Here we use \V in front of the pattern and single quotes around the pattern. &#xA;&#xA;This saves you from almost every escape sequence. &#xA;&#xA;&gt; http://example.org/path?q=query&#xA;&#xA;``` Vim&#xA;:let @/=&#39;\Vhttp://example.org/path?q=query&#39;&#xA;&#xA;```&#xA;&#xA;## What to do About Backslashes &#xA;&#xA;In Vim, you always have to escape backslashes while searching. &#xA;&#xA;In this case, just double up any backslashes. And escape any other characters depending on which search strategy you are using. &#xA;&#xA;Note dollar sign $ is a special character in Vim. &#xA;&#xA;&gt; \\fileshare\c$\windows\mspaint.exe&#xA;&#xA;``` Vim&#xA;/\\\\fileshare\\c\$\\windows\\mspaint\.exe&#xA;&#xA;..fileshare.c..windows.mspaint.exe&#xA;&#xA;:let @/=&#39;\V\\\\fileshare\\c$\\windows\\mspaint.exe&#39;&#xA;&#xA;```&#xA;&#xA;For clarity, that register string begins with: &#xA;&#xA;```&#xA;&#39;-\-V-\-\-\-\-f-i-l-e-s-h-a-r-e&#xA;  \ V 1 2 3 4 fileshare&#xA;&#xA;```&#xA;&#xA;## References&#xA;&#xA;=&gt; https://vimhelp.org/pattern.txt.html#%2Fmagic    Magic | Vim Help&#xA;=&gt; https://vimhelp.org/pattern.txt.html#%2F%5C.    \. | Vim Help &#xA;=&gt; https://vimhelp.org/pattern.txt.html#search-commands    Search Commands | Vim Help &#xA;=&gt; https://vimhelp.org/intro.txt.html#vim-modes-intro    Vim Modes | Vim Help &#xA;=&gt; https://stackoverflow.com/questions/16554010/vim-how-to-search-for-url/16554986#16554986    Set the search register directly | Peter Rincker | Stack Overflow&#xA;=&gt; https://vimhelp.org/eval.txt.html#%3Alet-%40    :let @/= Syntax | Vim Help &#xA;=&gt; https://vimhelp.org/eval.txt.html#literal-string    Single Quotes | Vim Help &#xA;=&gt; https://vimhelp.org/change.txt.html#pattern-delimiter    Pattern Delimiter | Vim Help &#xA;&#xA;Created: Saturday, October 8, 2022&#xA;Updated: Saturday, October 8, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-10-08-search-url.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Windows Programs</title>

<updated>2022-09-15T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-09-15:/gemlog/2022-09-15-windows-programs.gmi</id>

<content type="text/plain"># Windows Programs&#xA;&#xA;=&gt; https://chris.dziemborowicz.com/apps/hourglass/    Hourglass | Timer for Windows&#xA;=&gt; http://meldmerge.org/    Meld | Diff Tool&#xA;=&gt; https://notepad-plus-plus.org/    Notepad++ | Advanced Text Editor&#xA;=&gt; https://www.chiark.greenend.org.uk/~sgtatham/putty/    PuTTY | SSH and Telnet&#xA;=&gt; https://docs.microsoft.com/en-us/sysinternals/    Sysinternals | Windows Utilities&#xA;=&gt; https://www.getpaint.net/    Paint.NET &#xA;=&gt; https://www.sumatrapdfreader.org/    Sumatra PDF&#xA;=&gt; https://www.deluge-torrent.org/    Deluge BitTorrent Client&#xA;&#xA;Created: Thursday, September 15, 2022&#xA;Updated: Wednesday, November 8, 2023 &#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-09-15-windows-programs.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Managing PowerShell Modules</title>

<updated>2022-09-09T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-09-09:/gemlog/2022-09-09-powershell-modules.gmi</id>

<content type="text/plain">&#xA;# Managing PowerShell Modules&#xA;&#xA;PowerShell code is packaged as modules. &#xA;&#xA;Note: I&#39;m talking about packages for PowerShell itself opposed to packages for Windows. Windows packages might come from the Microsoft Store, Chocolatey, WinGet, MSIX or other sources. &#xA;&#xA;Managing modules is confusing because the cmdlets were developed incrementally before Microsoft contemplated online repositories. &#xA;&#xA;So, there is a historical set of cmdlets which were designed to manage local modules. &#xA;&#xA;There is a set of cmdlets to manage repositories. For example, there are cmdlets to add or remove repositories. Repositories are places from which you can download modules. &#xA;&#xA;And there is a set of cmdlets to manage modules downloaded from those repositories. &#xA;&#xA;Each of these collections is technically an assembly. (But, Microsoft will often refer to them as modules.) If the cmdlet you&#39;re looking for does not exist in one assembly then you will have to look in the others. &#xA;&#xA;I&#39;ve never mastered managing modules in PowerShell. &#xA;&#xA;My goal for this gemlog is to provide instructions for common tasks and to add new instructions over time. &#xA;&#xA;## List the Available Commands&#xA;&#xA;A basic skill is to list the cmdlets available for managing modules. &#xA;&#xA;If there is some issue that I don&#39;t address, you can use this to begin looking for a solution. &#xA;&#xA;Use the example below to list the module cmdlets. Make sure to type or copy the leading ampersand &amp;. Here, I include the output from my system. &#xA;&#xA;``` PowerShell&#xA;&amp; { Get-Command -Module Microsoft.PowerShell.Core -Noun Module ;  &#xA;Get-Command -Module PackageManagement ;  &#xA;Get-Command -Module PowerShellGet -Noun Module, PSRepository, InstalledModule ; &#xA;} | Format-Table -AutoSize &#xA;&#xA;CommandType Name                     Version   Source&#xA;----------- ----                     -------   ------&#xA;Cmdlet      Get-Module               7.2.6.500 Microsoft.PowerShell.Core&#xA;Cmdlet      Import-Module            7.2.6.500 Microsoft.PowerShell.Core&#xA;Cmdlet      New-Module               7.2.6.500 Microsoft.PowerShell.Core&#xA;Cmdlet      Remove-Module            7.2.6.500 Microsoft.PowerShell.Core&#xA;Cmdlet      Find-Package             1.4.7     PackageManagement&#xA;Cmdlet      Find-PackageProvider     1.4.7     PackageManagement&#xA;Cmdlet      Get-Package              1.4.7     PackageManagement&#xA;Cmdlet      Get-PackageProvider      1.4.7     PackageManagement&#xA;Cmdlet      Get-PackageSource        1.4.7     PackageManagement&#xA;Cmdlet      Import-PackageProvider   1.4.7     PackageManagement&#xA;Cmdlet      Install-Package          1.4.7     PackageManagement&#xA;Cmdlet      Install-PackageProvider  1.4.7     PackageManagement&#xA;Cmdlet      Register-PackageSource   1.4.7     PackageManagement&#xA;Cmdlet      Save-Package             1.4.7     PackageManagement&#xA;Cmdlet      Set-PackageSource        1.4.7     PackageManagement&#xA;Cmdlet      Uninstall-Package        1.4.7     PackageManagement&#xA;Cmdlet      Unregister-PackageSource 1.4.7     PackageManagement&#xA;Function    Find-Module              2.2.5     PowerShellGet&#xA;Function    Get-InstalledModule      2.2.5     PowerShellGet&#xA;Function    Get-PSRepository         2.2.5     PowerShellGet&#xA;Function    Install-Module           2.2.5     PowerShellGet&#xA;Function    Publish-Module           2.2.5     PowerShellGet&#xA;Function    Register-PSRepository    2.2.5     PowerShellGet&#xA;Function    Save-Module              2.2.5     PowerShellGet&#xA;Function    Set-PSRepository         2.2.5     PowerShellGet&#xA;Function    Uninstall-Module         2.2.5     PowerShellGet&#xA;Function    Unregister-PSRepository  2.2.5     PowerShellGet&#xA;Function    Update-Module            2.2.5     PowerShellGet&#xA;&#xA;```&#xA;&#xA;## Browse Cmdlets Online &#xA;&#xA;You can browse the available cmdlets online. &#xA;&#xA;Below, you can find the home page for each assembly. &#xA;&#xA;Note that some of the cmdlets shown are not related to managing PowerShell modules. Some of the assemblies have multiple roles. &#xA;&#xA;=&gt; https://docs.microsoft.com/powershell/module/microsoft.powershell.core/    Microsoft.PowerShell.Core | Microsoft Docs&#xA;&#xA;On this page, look for &#34;*-Module&#34; cmdlets where the asterisk * can stand for any PowerShell verb like Get (Get-Module) or Import (Import-Module). &#xA;&#xA;=&gt; https://docs.microsoft.com/powershell/module/packagemanagement/    PackageManagement | Microsoft Docs&#xA;&#xA;All the cmdlets in PackageManagement are relevant. &#xA;&#xA;=&gt; https://docs.microsoft.com/powershell/module/powershellget/    PowerShellGet | Microsoft Docs&#xA;&#xA;Look for &#34;*-Module&#34;, &#34;*-PSRepository&#34;, and &#34;*-InstalledModule&#34; cmdlets here. &#xA;&#xA;## List Downloaded Modules &#xA;&#xA;If you want to list modules that you&#39;ve installed from online repositories, use the Get-InstalledModule cmdlet: &#xA;&#xA;``` PowerShell&#xA;Get-InstalledModule | Format-Table -AutoSize&#xA;&#xA;Version Name                                 Repository Description&#xA;------- ----                                 ---------- -----------&#xA;7.8.0   ImportExcel                          PSGallery  PowerShell module to i…&#xA;0.7.2   Microsoft.PowerShell.ConsoleGuiTools PSGallery  Cross-platform Console…&#xA;&#xA;```&#xA;&#xA;## Update Downloaded Modules&#xA;&#xA;To update the modules you&#39;ve installed, use Update-Module. &#xA;&#xA;A progress bar will show while the cmdlet is working. &#xA;&#xA;Modules that are updated will be output. If all modules are up-to-date then there is no output. &#xA;&#xA;``` PowerShell&#xA;Update-Module&#xA;&#xA;...&#xA;&#xA;```&#xA;&#xA;## Uninstall Downloaded Module &#xA;&#xA;If you&#39;ve downloaded a module from a repository, Uninstall-Package appears to be the correct cmdlet to uninstall the module. &#xA;&#xA;``` PowerShell&#xA;# List Installed Modules&#xA;Get-InstalledModule | Format-Table -AutoSize  &#xA;&#xA;Version         Name                                 Repository Description&#xA;-------         ----                                 ---------- -----------&#xA;7.8.1           ImportExcel                          PSGallery  PowerShell mod…&#xA;1.1.0-Preview01 Microsoft.PowerShell.Crescendo       PSGallery  Module that im…&#xA;0.4.0           Microsoft.PowerShell.WhatsNew        PSGallery  The Get-WhatsN…&#xA;0.7.2           Microsoft.PowerShell.ConsoleGuiTools PSGallery  Cross-platform…&#xA;&#xA;&#xA;# Uninstall WhatsNew using the full assembly name. &#xA;Uninstall-Package Microsoft.PowerShell.WhatsNew      &#xA;&#xA;Name                           Version          Source           Summary&#xA;----                           -------          ------           -------&#xA;Microsoft.PowerShell.WhatsNew  0.4.0            https://www.pow… The Get-Whats…&#xA;&#xA;&#xA;# List Installed Modules&#xA;Get-InstalledModule | Format-Table -AutoSize  &#xA;&#xA;Version         Name                                 Repository Description&#xA;-------         ----                                 ---------- -----------&#xA;7.8.1           ImportExcel                          PSGallery  PowerShell mod…&#xA;1.1.0-Preview01 Microsoft.PowerShell.Crescendo       PSGallery  Module that im…&#xA;0.7.2           Microsoft.PowerShell.ConsoleGuiTools PSGallery  Cross-platform…&#xA;&#xA;```&#xA;&#xA;## References &#xA;&#xA;See the &#34;Browse Cmdlets Online&#34; section above for more information. &#xA;&#xA;=&gt; https://docs.microsoft.com/powershell/module/powershellget/update-module    Update-Module | Microsoft Docs&#xA;=&gt; https://docs.microsoft.com/powershell/module/powershellget/get-installedmodule    Get-InstalledModule | Microsoft Docs&#xA;=&gt; https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/format-table    Format-Table | Microsoft Docs&#xA;=&gt; https://chocolatey.org/    Chocolatey: The package manager for Windows&#xA;=&gt; https://github.com/microsoft/winget-cli#readme    WinGet | GitHub&#xA;=&gt; https://docs.microsoft.com/windows/msix/overview    What is MSIX? | Microsoft Docs&#xA;=&gt; https://github.com/PowerShell/GraphicalTools#readme    GraphicalTools Module | GitHub&#xA;=&gt; https://github.com/dfinke/ImportExcel#readme    dfinke/ImportExcel: PowerShell module to import/export Excel spreadsheets, without Excel | GitHub&#xA;=&gt; https://docs.microsoft.com/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands    PowerShell Verbs | Microsoft Docs&#xA;&#xA;Created: Thursday, September 8, 2022&#xA;Updated: Tuesday, December 6, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-09-09-powershell-modules.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Anonymous Functions in PowerShell</title>

<updated>2022-09-01T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-09-01:/gemlog/2022-09-01-anonymous-function.gmi</id>

<content type="text/plain">&#xA;# Anonymous Functions in PowerShell&#xA;&#xA;A function is a collection of program statements bound to a function name. Then, when the function name is invoked, the statements are run with any provided input. &#xA;&#xA;In principle, anonymous functions are functions without names. Here, the statements are used immediately. For example, this can be useful for something like a mouse click where a particular action is associated with the mouse click. The same action is not used elsewhere. And a function name is not necessary. &#xA;&#xA;## Background&#xA;&#xA;I maintain a list of bookmarks for my file system. This is a hash table of strings. &#xA;&#xA;``` PowerShell&#xA;$bookmark = @{&#xA;  journal    = &#34;/data/Michael/Journal&#34;&#xA;  powershell = &#34;/data/Michael/PowerShell&#34;&#xA;}&#xA;&#xA;```&#xA;&#xA;We can use these strings as input for the Set-Location cmdlet. Issuing the command below will change the current directory. &#xA;&#xA;``` PowerShell&#xA;Set-Location -Path $bookmark.powershell&#xA;&#xA;```&#xA;&#xA;Editor&#39;s Note: Since I&#39;m mixing commands and output below, I include the prompt symbol &gt; before the commands I typed. If you copy these commands, omit the leading &gt;. ^C indicates where I pressed Ctrl-C which normally stops execution. Here, I use Ctrl-C to skip lines with comments. &#xA;&#xA;One problem with my process is that if I mistype the key name for the hash table, the command fails silently. So, I am in the habit of checking where I am. &#xA;&#xA;``` PowerShell&#xA;&gt; # Mistyped name. ^C&#xA;&gt; Set-Location -Path $bookmark.powershel&#xA;&gt; Get-Location&#xA;&#xA;Path&#xA;----&#xA;/home/michael&#xA;&#xA;&gt; # Correct hash table key name. ^C&#xA;&gt; Set-Location -Path $bookmark.powershell&#xA;&gt; Get-Location&#xA;&#xA;Path&#xA;----&#xA;/data/Michael/PowerShell&#xA;&#xA;```&#xA;&#xA;This process could be improved in two ways: &#xA;&#xA;* Make it so that calling a key from the hash table changes directory. &#xA;* Output success or failure. &#xA;&#xA;For the first point, I would prefer to use only the hash table and key without any proceeding cmdlet. &#xA;&#xA;``` Text&#xA;&gt; # Example ^C&#xA;&gt; $bookmark.journal&#xA;&#xA;&gt; Get-Location&#xA;&#xA;Path&#xA;----&#xA;/data/Michael/Journal&#xA;&#xA;```&#xA;&#xA;I would need to store anonymous functions in the hash table values for this to work. &#xA;&#xA;## Do anonymous functions exist in PowerShell? &#xA;&#xA;No. &#xA;&#xA;PowerShell can store code in script blocks. Script blocks are objects. &#xA;&#xA;Specifying an object on the command line outputs a value: &#xA;&#xA;``` PowerShell&#xA;&gt; $a = Get-ChildItem&#xA;&gt; $a&#xA;&#xA;   Directory: /data/Michael&#xA;&#xA;UnixMode   User    Group     LastWriteTime  Size Name&#xA;--------   ----    -----     -------------  ---- ----&#xA;drwxr-xr-x michael michael  9/1/2022 05:02  4096 Journal&#xA;drwxr-xr-x michael michael  9/1/2022 15:33  4096 PowerShell&#xA;&#xA;```&#xA;&#xA;In the case of script blocks, specifying a script block on the command line prints the commands without executing the code. &#xA;&#xA;Here, I use semicolons ; to explicitly terminate my statements. &#xA;&#xA;``` PowerShell&#xA;&gt; $b = { Set-Location ~ ; Get-Location ; }&#xA;&gt; $b&#xA; Set-Location ~ ; Get-Location ;&#xA;&gt; # Literal string output. ^C&#xA;&#xA;```&#xA;&#xA;## Running Script Blocks&#xA;&#xA;The closest you can get to an anonymous function in PowerShell is to execute the contents of a script block. &#xA;&#xA;### Use the Call Operator &#xA;&#xA;You can use the call operator &amp; &#xA;&#xA;``` PowerShell&#xA;&gt; $c = { Set-Location ~ ; Get-Location ; }&#xA;&gt; &amp; $c&#xA;&#xA;Path&#xA;----&#xA;/home/michael&#xA;&#xA;```&#xA;&#xA;Note that since I intend to use a hash table later, I use the variable $c in the example above. But the variable is not required. You can invoke script blocks directly. &#xA;&#xA;``` PowerShell&#xA;&gt; Get-Random&#xA;866754637&#xA;&#xA;&gt; { Get-Random }&#xA; Get-Random &#xA;&#xA;&gt; &amp; { Get-Random }&#xA;1481025786&#xA;&#xA;```&#xA;&#xA;### Use the Invoke() Method&#xA;&#xA;Use the Invoke() method on the script block: &#xA;&#xA;``` PowerShell&#xA;&gt; $d = { Get-ChildItem ; }&#xA;&gt; $d.Invoke()&#xA;&#xA;   Directory: /home/michael&#xA;&#xA;UnixMode   User    Group      LastWriteTime Size Name&#xA;--------   ----    -----      ------------- ---- ----&#xA;drwxr-xr-x michael michael  8/30/2022 05:26 4096 Desktop&#xA;drwxr-xr-x michael michael 12/23/2021 07:14 4096 Documents&#xA;drwxr-xr-x michael michael  8/29/2022 17:32 4096 Downloads&#xA;&#xA;```&#xA;&#xA;### Investigate Script Blocks with Get-Member&#xA;&#xA;You can use Get-Member to discover the Invoke() method if you forget.&#xA;&#xA;The Invoke method name will appear under the Name column. And the MemberType will be Method. &#xA;&#xA;``` PowerShell&#xA;&gt; $e = { Get-Process ; }&#xA;&gt; $e | Get-Member&#xA;&#xA;   TypeName: System.Management.Automation.ScriptBlock&#xA;&#xA;Name                    MemberType Definition&#xA;----                    ---------- ----------&#xA;CheckRestrictedLanguage Method     void CheckRestrictedLanguage(System.Collections.…&#xA;Equals                  Method     bool Equals(System.Object obj)&#xA;...&#xA;Invoke                  Method     System.Collections.ObjectModel.Collection[psobje…&#xA;&#xA;```&#xA;&#xA;Remember to include the trailing parentheses () on method calls. &#xA;&#xA;``` PowerShell&#xA;&gt; # This returns the method definition. ^C&#xA;&gt; $e.Invoke&#xA;&#xA;OverloadDefinitions&#xA;-------------------&#xA;System.Collections.ObjectModel.Collection[psobject] Invoke(Params System.Object[] args)&#xA;&#xA;&#xA;&gt; # This invokes the code. ^C&#xA;&gt; $e.Invoke()&#xA;&#xA; NPM(K)    PM(M)      WS(M)     CPU(s)      Id  SI ProcessName&#xA; ------    -----      -----     ------      --  -- -----------&#xA;      0     0.00      22.46       3.10  764292 …22 vim&#xA;      0     0.00      21.59       4.51  860098 …30 vim&#xA;      0     0.00     316.77     341.40  838982 …54 vivaldi-bin --enable-crashpad&#xA;      0     0.00      36.67       0.00  859799 …54 vivaldi-bin --type=broker&#xA;&#xA;```&#xA;&#xA;## Updated Bookmarks&#xA;&#xA;After researching script blocks in PowerShell, I updated my bookmark hash table with script blocks { ... } &#xA;&#xA;``` PowerShell&#xA;$bookmark = @{&#xA;  journal    = { Set-Location -Path &#34;/data/Michael/Journal&#34; -PassThru }&#xA;  powershell = { Set-Location -Path &#34;/data/Michael/PowerShell&#34; -PassThru }&#xA;}&#xA;&#xA;```&#xA;&#xA;Now, I can change directory by placing the call operator &amp; before the hash table. The -PassThru parameter outputs the current location; now I know if my command succeeds. And, if I mistype a key name, I receive an error. &#xA;&#xA;PassThru is a parameter of Set-Location. &#xA;&#xA;``` PowerShell&#xA;&gt; $bookmark = @{&#xA;&gt;&gt;   journal    = { Set-Location -Path &#34;/data/Michael/Journal&#34; -PassThru }&#xA;&gt;&gt;   powershell = { Set-Location -Path &#34;/data/Michael/PowerShell&#34; -PassThru }&#xA;&gt;&gt; }&#xA;&#xA;&gt; &amp; $bookmark.powershel&#xA;InvalidOperation: The expression after &#39;&amp;&#39; in a pipeline element produced an&#xA;object that was not valid. It must result in a command name, a script block, or&#xA;a CommandInfo object.&#xA;&#xA;&gt; &amp; $bookmark.powershell&#xA;&#xA;Path&#xA;----&#xA;/data/Michael/PowerShell&#xA;&#xA;```&#xA;&#xA;## References &#xA;&#xA;=&gt; https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_hash_tables    Hash Tables | PowerShell | Microsoft Docs&#xA;=&gt; https://docs.microsoft.com/dotnet/csharp/programming-guide/strings/    Strings | C# | Microsoft Docs&#xA;=&gt; https://docs.microsoft.com/powershell/module/microsoft.powershell.management/set-location    Set-Location | PowerShell | Microsoft Docs&#xA;=&gt; https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_script_blocks    Script Blocks | PowerShell | Microsoft Docs&#xA;=&gt; https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/get-member    Get-Member | PowerShell | Microsoft Docs&#xA;=&gt; https://social.technet.microsoft.com/wiki/contents/articles/7703.powershell-running-executables.aspx    Running Executables | PowerShell | TechNet Wiki&#xA;=&gt; https://vimhelp.org/visual.txt.html#v_b_A    Appending Text on Multiple Lines | Vim Help&#xA;&#xA;Created: Thursday, September 1, 2022&#xA;Updated: Thursday, September 1, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-09-01-anonymous-function.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Using Asterisks as Bullet Points in Vim</title>

<updated>2022-08-24T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-08-24:/gemlog/2022-08-24-asterisk-bullet-points.gmi</id>

<content type="text/plain"># Using Asterisks as Bullet Points in Vim&#xA;&#xA;If I create a bulleted list in Vim using the Markdown or Gemtext syntax: &#xA;&#xA;``` Text &#xA;   * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vulputate erat sit amet leo euismod consectetur. Aliquam ac quam laoreet, euismod lorem non, pellentesque nibh. Fusce id tortor non ipsum dapibus lacinia. &#xA;   * Fusce at enim gravida augue rutrum maximus ut at libero. Suspendisse dignissim tortor nec sem iaculis, auctor consectetur eros facilisis. Morbi varius, dolor sit amet sagittis fringilla, elit purus luctus erat, ac commodo libero neque vel nisl. Quisque porta, diam laoreet hendrerit accumsan, ligula erat placerat augue, luctus ultricies neque nisi a purus. In diam nibh, consectetur mattis nulla vel, tincidunt euismod quam. Nam mattis mi nec turpis convallis vehicula. Aenean non eros ac lorem ullamcorper lobortis. Praesent ligula mauris, volutpat pellentesque maximus in, ullamcorper non tortor.&#xA;&#xA;```&#xA;&#xA;and format it with the gq command then the list is always prefaced with a bullet (asterisk) on each line: &#xA;&#xA;``` Text&#xA;   * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vulputate&#xA;   * erat sit amet leo euismod consectetur. Aliquam ac quam laoreet, euismod&#xA;   * lorem non, pellentesque nibh. Fusce id tortor non ipsum dapibus lacinia.&#xA;   * Fusce at enim gravida augue rutrum maximus ut at libero. Suspendisse&#xA;   * dignissim tortor nec sem iaculis, auctor consectetur eros facilisis. Morbi&#xA;   * varius, dolor sit amet sagittis fringilla, elit purus luctus erat, ac&#xA;   * commodo libero neque vel nisl. Quisque porta, diam laoreet hendrerit&#xA;   * accumsan, ligula erat placerat augue, luctus ultricies neque nisi a purus.&#xA;   * In diam nibh, consectetur mattis nulla vel, tincidunt euismod quam. Nam&#xA;   * mattis mi nec turpis convallis vehicula. Aenean non eros ac lorem&#xA;   * ullamcorper lobortis. Praesent ligula mauris, volutpat pellentesque&#xA;   * maximus in, ullamcorper non tortor.&#xA;&#xA;```&#xA;&#xA;Why is that? &#xA;&#xA;## Vim Comments&#xA;&#xA;Vim recognizes the asterisks that I typed as comments for the C programming language: &#xA;&#xA;``` C Comment&#xA;        /* &#xA;         * This is a test &#xA;         * of the text formatting. &#xA;         */ &#xA;&#xA;```&#xA;&#xA;When I reformat the text, Vim helps by automatically formatting the text in the style of C comments. &#xA;&#xA;In part, comments are controlled by the &#39;comments&#39; option. &#xA;&#xA;``` Vim&#xA;comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:&gt;,fb:-&#xA;&#xA;```&#xA;&#xA;## My Comments Option&#xA;&#xA;I use &gt; for quoted text and # for PowerShell comments. Along with * for bullet points, the following option appears to give the desired results. &#xA;&#xA;Some Microsoft documentation uses - for bullets. &#xA;&#xA;JavaScript uses // for comments. &#xA;&#xA;I added the following to my ~/.vim/vimrc file: &#xA;&#xA;``` Vim&#xA;set comments=b:#,n:&gt;,fb:-,fb:*,://&#xA;&#xA;```&#xA;&#xA;Here is the result after restarting Vim: &#xA;&#xA;``` Text&#xA;   * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vulputate&#xA;     erat sit amet leo euismod consectetur. Aliquam ac quam laoreet, euismod&#xA;     lorem non, pellentesque nibh. Fusce id tortor non ipsum dapibus lacinia.&#xA;   * Fusce at enim gravida augue rutrum maximus ut at libero. Suspendisse&#xA;     dignissim tortor nec sem iaculis, auctor consectetur eros facilisis. Morbi&#xA;     varius, dolor sit amet sagittis fringilla, elit purus luctus erat, ac&#xA;     commodo libero neque vel nisl. Quisque porta, diam laoreet hendrerit&#xA;     accumsan, ligula erat placerat augue, luctus ultricies neque nisi a purus.&#xA;     In diam nibh, consectetur mattis nulla vel, tincidunt euismod quam. Nam&#xA;     mattis mi nec turpis convallis vehicula. Aenean non eros ac lorem&#xA;     ullamcorper lobortis. Praesent ligula mauris, volutpat pellentesque&#xA;     maximus in, ullamcorper non tortor.&#xA;&#xA;```&#xA;&#xA;## References &#xA;&#xA;=&gt; https://vimhelp.org/usr_30.txt.html#30.6    Introduction to Comments | Vim Help&#xA;=&gt; https://vimhelp.org/change.txt.html#format-comments    Comment Reference | Vim Help &#xA;&#xA;Created: Wednesday, August 24, 2022&#xA;Updated: Friday, October 7, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-08-24-asterisk-bullet-points.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>VS Code Sticky Scroll</title>

<updated>2022-08-15T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-08-15:/gemlog/2022-08-15-sticky-scroll.gmi</id>

<content type="text/plain"># VS Code Sticky Scroll&#xA;&#xA;VS Code version 1.70 added the feature &#34;sticky scroll&#34;. &#xA;&#xA;settings.json: &#xA;&#xA;``` JSON&#xA;{&#xA;    &#34;editor.stickyScroll.enabled&#34;: true&#xA;}&#xA;&#xA;```&#xA;&#xA;This allows the declaration for a code block to stay in view while scrolling vertically: similar to frozen rows in Excel. &#xA;&#xA;An animated demonstration appears in the announcement. &#xA;&#xA;&#xA;## Sticky Scroll in Trees&#xA;&#xA;VS Code version 1.85 added the preview feature &#34;Sticky Scroll in Trees&#34;. &#xA;&#xA;settings.json: &#xA;&#xA;``` JSON&#xA;{&#xA;    &#34;workbench.tree.enableStickyScroll&#34;: true&#xA;    &#34;workbench.tree.stickyScrollMaxItemCount&#34;: 7&#xA;}&#xA;&#xA;```&#xA;&#xA;This takes the sticky scroll behavior from the editor window and applies it to tree views like a folder tree in the Explorer panel. &#xA;&#xA;&#xA;## Terminal Sticky Scroll&#xA;&#xA;VS Code version 1.85 also added sticky scroll for the terminal. &#xA;&#xA;Sticky scroll for the terminal requires the VS Code shell integration. See the &#34;Terminal&#34; section in the v1.85 update notes. &#xA;&#xA;settings.json: &#xA;&#xA;``` JSON&#xA;{&#xA;    &#34;terminal.integrated.stickyScroll.enabled&#34;: true&#xA;}&#xA;&#xA;```&#xA;&#xA;In the terminal, sticky scroll shows the last command while you scroll through output. &#xA;&#xA;Further down, the patch notes read: &#xA;&#xA;&gt; [Shell integration] will also trim empty lines from the top of the prompt, commonly used to split up output and make the terminal easier to read.&#xA;&gt; &#xA;&#xA;This makes sense. If you have a custom prompt, you don&#39;t have to change it. And, inside VS Code, the shell integration will detect blank lines at the top of the terminal and replace them with the sticky scroll visual. If it didn&#39;t do this, you would have two or three blank lines pinned to the top of the terminal and wasting space. &#xA;&#xA;&#xA;## References&#xA;&#xA;=&gt; https://code.visualstudio.com/updates/v1_70#_editor-sticky-scroll    Sticky Scroll Announcement&#xA;=&gt; https://code.visualstudio.com/docs/getstarted/userinterface#_sticky-scroll    Sticky Scroll | Released Feature&#xA;=&gt; https://code.visualstudio.com/updates/v1_85    Visual Studio Code v1.85&#xA;=&gt; https://www.youtube.com/watch?v=MtNJtG0hsUY    FYI: Freeze columns or rows in Microsoft Excel | YouTube&#xA;&#xA;Created: Monday, August 15, 2022&#xA;Updated: Tuesday, December 19, 2023&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-08-15-sticky-scroll.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Formatting Plain Text Copies in Vim</title>

<updated>2022-08-15T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-08-15:/gemlog/2022-08-15-formatting-vim.gmi</id>

<content type="text/plain"># Formatting Plain Text Copies in Vim &#xA;&#xA;I prefer to read long passages in Vim. So, I copy and paste from the Web into Vim. &#xA;&#xA;Sometimes, the plain text copy of an online document is difficult to read in Vim. &#xA;&#xA;Below are some advanced Vim commands to address specific issues. &#xA;&#xA;If you get unexpected results from running multiple commands, try running the commands in the order they appear here. &#xA;&#xA;In Vim, you can paste at the command line by pressing Ctrl-r and then +  So, it is possible to copy and paste these commands without typing. Take care to include only one leading colon : in your commands. &#xA;&#xA;## Separate Headings&#xA;&#xA;``` Vim&#xA;:%s/\S\n\zs\(\S\)/\r\1&#xA;&#xA;```&#xA;Here, \r will add a carriage return to the output. &#xA;&#xA;The above Vim command will add a blank line before headings. &#xA;&#xA;We go from this: &#xA;&#xA;``` Text&#xA;... and terminal.integrated.tabs.defaultColor.&#xA;Extended PowerShell keybindings&#xA;&#xA;```&#xA;&#xA;to this: &#xA;&#xA;``` Text &#xA;... and terminal.integrated.tabs.defaultColor.&#xA;&#xA;Extended PowerShell keybindings&#xA;&#xA;```&#xA;&#xA;## Add Line Breaks to Paragraphs&#xA;&#xA;``` Vim&#xA;:g/^\w.\{79,}\|^    \w.\{75,}\|^        \w.\{71,}/normal gqgq&#xA;&#xA;```&#xA;&#xA;The Vim command above will add line breaks to long paragraphs. I find this helps if, later, I use a linewise visual select while reading. &#xA;&#xA;Turn this paragraph with no line breaks: &#xA;&#xA;``` Text&#xA;There are additional PowerShell keybindings, such as Ctrl+Space, thanks to shell integration. These weren&#39;t possible before due to the lack of VT encoding. Provided that shell integration is working in pwsh, the following keybindings should now work:&#xA;&#xA;```&#xA;&#xA;into this paragraph with a line break at the end of each line: &#xA;&#xA;``` Text&#xA;There are additional PowerShell keybindings, such as Ctrl+Space, thanks to&#xA;shell integration. These weren&#39;t possible before due to the lack of VT&#xA;encoding. Provided that shell integration is working in pwsh, the following&#xA;keybindings should now work:&#xA;&#xA;```&#xA;&#xA;## References&#xA;&#xA;=&gt; https://code.visualstudio.com/updates/v1_70    Example Source Document&#xA;=&gt; https://vimhelp.org/intro.txt.html#vim-modes    Basic Information About Vim Modes (e.g. Normal Mode) &#xA;=&gt; https://vimhelp.org/usr_20.txt.html    Introduction to the Vim Command Line &#xA;=&gt; https://vimhelp.org/cmdline.txt.html    Command Line Reference&#xA;=&gt; https://vimhelp.org/pattern.txt.html    Manual Page for Regular Expressions in Vim &#xA;=&gt; https://vimhelp.org/cmdline.txt.html#%3Arange    The meaning of % in :%s/ | Vim Range&#xA;=&gt; https://vimhelp.org/change.txt.html#%3As    :s Command&#xA;=&gt; https://vimhelp.org/repeat.txt.html#%3Ag    :g Command&#xA;=&gt; https://vimhelp.org/various.txt.html#%3Anormal    :normal | Using Normal Mode Commands in Command-line Mode&#xA;=&gt; https://vimhelp.org/change.txt.html#gq    gq Command in Normal Mode&#xA;=&gt; https://vimhelp.org/cmdline.txt.html#c_CTRL-R    Ctrl-r in Command-line Mode&#xA;=&gt; https://vimhelp.org/change.txt.html#registers    Vim Registers (Clipboards)&#xA;=&gt; https://vimhelp.org/usr_04.txt.html#04.4    Selecting Lines | Linewise Visual Select | Vim User Manual &#xA;&#xA;Created: Monday, August 15, 2022&#xA;Updated: Saturday, October 8, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-08-15-formatting-vim.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>What is PPID on Linux?</title>

<updated>2022-06-19T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-06-19:/gemlog/2022-06-19-parent-process-id.gmi</id>

<content type="text/plain"># What is PPID on Linux? &#xA;&#xA;&gt; Parent Process IDentifier&#xA;&#xA;A process ID is the number assigned to an application by the operating system. This serves to identify the application uniquely while it is running. This number changes for each copy of a program running. And it is different each time an application opens and closes. &#xA;&#xA;By the nature of the system, further applications are spawned by the original process that is loaded when the operating system is loaded. So all processes have a parent and child relationship with the process that spawned them. &#xA;&#xA;Therefore, the parent process identifier is the process ID of the parent where &#34;parent&#34; is the process that spawned the process we are looking at. &#xA;&#xA;This information can be used in troubleshooting tools to show groups of related processes. For example, in Process Explorer, you can see a Web browser process grouped with all its helper subprocesses or child processes. &#xA;&#xA;On Windows, is is possible to find the parent process. But I don&#39;t remember having the parent process ID readily available. &#xA;&#xA;On Linux, it seems like the PPID is more readily available. For example, in the XFCE Task Manager, the option to show PPID is given equal prominence with more common statistics like memory usage and user ID. &#xA;&#xA;## PowerShell&#xA;&#xA;I was able to generate this crude listing. &#xA;&#xA;Note that some of the parent process IDs were not available. I don&#39;t have an explanation for that. But XFCE Task Manager correctly associates the orphans from PowerShell (ex &#34;Web Content&#34;) with their parents (ex Firefox). &#xA;&#xA;I&#39;ve edited the output for length. &#xA;&#xA;``` PowerShell&#xA;Get-Process | Select-Object @{name=&#39;Parent&#39;; expr={$_.Parent.Id}}, Id, Name | Sort-Object Parent, Id&#xA;&#xA;Parent     Id Name&#xA;------     -- ----&#xA;       105455 Web Content&#xA;1        2617 firefox&#xA;1      135731 code --no-sandbox --force-user-env --unity-launch --enable-crashpad&#xA;1284     1362 Thunar&#xA;1370   127909 thunderbird&#xA;1667     1688 pwsh&#xA;1688    11884 vim&#xA;&#xA;```&#xA;&#xA;## References &#xA;&#xA;=&gt; https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer    Process Explorer | Microsoft Docs&#xA;=&gt; https://docs.xfce.org/apps/xfce4-taskmanager/start    Task Manager | XFCE Docs &#xA;=&gt; https://linuxhandbook.com/find-process-id/    How to Find Process ID (PID and PPID) in Linux&#xA;=&gt; https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_calculated_properties    Calculated Properties | Microsoft Docs&#xA;=&gt; https://github.com/PowerShell/PowerShell/issues/17541    Parent Process Object is Missing | GitHub&#xA;&#xA;Created: Sunday, June 19, 2022&#xA;Updated: Sunday, June 19, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-06-19-parent-process-id.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Linux Command Line Reference</title>

<updated>2022-06-17T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-06-17:/gemlog/2022-06-17-linux-command-line-reference.gmi</id>

<content type="text/plain">&#xA;# Linux Command Line Reference&#xA;&#xA;## Show the IP Address&#xA;&#xA;``` &#xA;ip address show &#xA;&#xA;# Show only the addresses. &#xA;ip address show | grep inet&#xA;&#xA;```&#xA;&#xA;## Network Manager&#xA;&#xA;Manjaro uses the RedHat NetworkManager suite to manage network interfaces. The command-line tool is nmcli. &#xA;&#xA;### List Interfaces and Status &#xA;&#xA;Use the nmcli command with no arguments to list the interfaces and status. &#xA;&#xA;For example, below, the enp4s0 device is connected and using the &#34;Wired connection 1&#34; connection. A &#34;connection&#34; is a group of settings in NetworkManager. The IP address is 172.16.0.14. &#xA;&#xA;```&#xA;nmcli&#xA;&#xA;enp4s0: connected to Wired connection 1&#xA;        &#34;Marvell 88E8056&#34;&#xA;        ethernet (sky2), 00:26:18:52:64:7B, hw, mtu 1500&#xA;        ip4 default, ip6 default&#xA;        inet4 172.16.0.14/16&#xA;        route4 172.16.0.0/16 metric 100&#xA;        route4 default via 172.16.1.254 metric 100&#xA;        inet6 2600:1700:1e80:7880::2f/128&#xA;        inet6 2600:1700:1e80:7880:fb86:cb6f:ecef:936a/64&#xA;        inet6 fe80::ac6:af13:8796:70c9/64&#xA;        route6 fe80::/64 metric 1024&#xA;        route6 2600:1700:1e80:7880::/64 metric 100&#xA;        route6 2600:1700:1e80:7880::/60 via fe80::4e12:65ff:fe6c:7620 metric 100&#xA;        route6 2600:1700:1e80:7880::2f/128 metric 100&#xA;        route6 default via fe80::4e12:65ff:fe6c:7620 metric 100&#xA;&#xA;enp5s0: unavailable&#xA;        &#34;Marvell 88E8056&#34;&#xA;        ethernet (sky2), 00:26:18:52:64:7C, hw, mtu 1500&#xA;&#xA;wlp1s0: unavailable&#xA;        &#34;Intel 7260&#34;&#xA;        wifi (iwlwifi), DA:B3:7C:5D:1F:C8, sw disabled, hw, mtu 1500&#xA;&#xA;lo: unmanaged&#xA;        &#34;lo&#34;&#xA;        loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536&#xA;&#xA;DNS configuration:&#xA;        servers: 172.16.1.254&#xA;        domains: attlocal.net&#xA;        interface: enp4s0&#xA;&#xA;        servers: 2600:1700:1e80:7880::1&#xA;        domains: attlocal.net&#xA;        interface: enp4s0&#xA;&#xA;Use &#34;nmcli device show&#34; to get complete information about known devices and&#xA;&#34;nmcli connection show&#34; to get an overview on active connection profiles.&#xA;&#xA;Consult nmcli(1) and [PwshNotes Edit] manual pages for complete usage details.&#xA;&#xA;```&#xA;&#xA;### List Connections&#xA;&#xA;NetworkManager is organized around &#34;connections&#34;. NetworkManager connections are groups of settings which can be saved and applied to a device. A device is just your network card. &#xA;&#xA;You can list the available connections with nmcli connection show. &#xA;&#xA;For example, below, the connections are &#34;Wired connection 1&#34; and &#34;Wired connection 2&#34;. And Wired connection 1 is applied to the &#34;enp4s0&#34; device (network card). &#xA;&#xA;```&#xA;nmcli connection show&#xA;&#xA;NAME                UUID                                  TYPE      DEVICE &#xA;Wired connection 1  a722df7b-a8b1-32ad-8b18-a694919a8d03  ethernet  enp4s0 &#xA;Wired connection 2  03c99f3b-d2b5-3b5d-8b8f-2e0ec4bf182f  ethernet  --     &#xA;&#xA;```&#xA;&#xA;### Renew DHCP Lease&#xA;&#xA;Renew the DHCP lease with the nmcli device up ifname command. &#xA;&#xA;Since we&#39;re renewing the DHCP lease, I will choose the device that is already connected. &#xA;&#xA;```&#xA;# List the current IP address. &#xA;nmcli | grep inet&#xA;&#xA;        inet4 172.16.0.14/16&#xA;        inet6 2600:1700:1e80:7880::2f/128&#xA;        inet6 2600:1700:1e80:7880:fb86:cb6f:ecef:936a/64&#xA;        inet6 fe80::ac6:af13:8796:70c9/64&#xA;&#xA;# List the devices. &#xA;nmcli device status&#xA;&#xA;DEVICE  TYPE      STATE        CONNECTION         &#xA;enp4s0  ethernet  connected    Wired connection 1 &#xA;enp5s0  ethernet  unavailable  --                 &#xA;wlp1s0  wifi      unavailable  --                 &#xA;lo      loopback  unmanaged    --                 &#xA;&#xA;# Renew the IP address and include the device name. &#xA;nmcli device up enp4s0&#xA;&#xA;Device &#39;enp4s0&#39; successfully activated with &#39;a722df7b-a8b1-32ad-8b18-a694919a8d03&#39;.&#xA;&#xA;# Check the new IP address. &#xA;nmcli | grep inet&#xA;&#xA;&#x9;inet4 192.168.1.51/24&#xA;&#x9;inet6 2600:1700:1e80:7880::2f/128&#xA;&#x9;inet6 2600:1700:1e80:7880:fb86:cb6f:ecef:936a/64&#xA;&#x9;inet6 fe80::ac6:af13:8796:70c9/64&#xA;&#xA;```&#xA;&#xA;## List File System Types&#xA;&#xA;Here we can see that my hard drives (/dev/sdX) are both using EXT4. &#xA;&#xA;``` &#xA;df -Th&#xA;&#xA;Filesystem     Type      Size  Used Avail Use% Mounted on&#xA;dev            devtmpfs   12G     0   12G   0% /dev&#xA;run            tmpfs      12G  1.9M   12G   1% /run&#xA;/dev/sda1      ext4      916G   46G  824G   6% /&#xA;tmpfs          tmpfs      12G  147M   12G   2% /dev/shm&#xA;tmpfs          tmpfs      12G  8.2M   12G   1% /tmp&#xA;/dev/sdb       ext4      458G  9.2G  425G   3% /data&#xA;tmpfs          tmpfs     2.4G  108K  2.4G   1% /run/user/1000&#xA;&#xA;```&#xA;&#xA;## Reboot&#xA;&#xA;```&#xA;shutdown -r 0 &#xA;&#xA;```&#xA;&#xA;### Reboot to UEFI&#xA;&#xA;If your system is using systemd then it is possible to reboot directly into the UEFI. &#xA;&#xA;``` PowerShell&#xA;systemctl reboot --firmware-setup&#xA;&#xA;```&#xA;&#xA;&#xA;## Restart the Print Queue&#xA;&#xA;Sometimes documents get stuck in my print queue after waking from sleep. The solution is to restart the print service: CUPS. My Linux distribution, Manjaro, uses systemctl to manage services. &#xA;&#xA;```&#xA;sudo systemctl restart cups&#xA;&#xA;```&#xA;&#xA;You can check the status of the local queue by visiting the web server for CUPS. &#xA;&#xA;=&gt; http://localhost:631/&#xA;&#xA;Though, I believe version 3.0 of CUPS will have a new interface besides the web server. &#xA;&#xA;&#xA;## netstat&#xA;&#xA;netstat has been replaced with ss  Here is the basic usage. &#xA;&#xA;``` PowerShell&#xA;# Display all TCP sockets.&#xA;ss -t -a&#xA;&#xA;State      Recv-Q   Send-Q  Local Address:Port     Peer Address:Port                         &#xA;...&#xA;TIME-WAIT  0        0        192.168.1.68:45552  34.117.237.239:https                        &#xA;ESTAB      0        0        192.168.1.68:34660  104.16.122.175:https                        &#xA;ESTAB      0        0        192.168.1.68:52806  34.117.237.239:https &#xA;...&#xA;&#xA;```&#xA;&#xA;&#xA;## References&#xA;&#xA;=&gt; https://ubuntu.com/blog/if-youre-still-using-ifconfig-youre-living-in-the-past    If you’re still using ifconfig, you’re living in the past | Ubuntu&#xA;=&gt; https://www.cyberciti.biz/faq/howto-linux-renew-dhcp-client-ip-address/    Linux Force DHCP Client (dhclient) to Renew IP Address - nixCraft&#xA;=&gt; https://man.archlinux.org/man/nmcli.1    nmcli(1) — Arch manual pages&#xA;=&gt; https://linuxopsys.com/topics/check-file-system-type-in-linux    How to Show File System Type in Linux&#xA;=&gt; https://www.phoronix.com/news/CUPS-3.0-Architecture-Overhaul    CUPS 3.0 Continues Being Crafted To Overhaul Linux Printing | Phoronix&#xA;=&gt; https://www.howtogeek.com/681468/how-to-use-the-ss-command-on-linux/    How to Use the ss Command on Linux | How-to Geek&#xA;=&gt; https://man.archlinux.org/man/ss.8    ss | Arch manual pages&#xA;=&gt; https://superuser.com/questions/519718/linux-on-uefi-how-to-reboot-to-the-uefi-setup-screen-like-windows-8-can    Reboot to UEFI | Super User&#xA;&#xA;Created: Thursday, June 16, 2022&#xA;Updated: Saturday, September 28, 2024 &#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-06-17-linux-command-line-reference.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Add a Permanently Visible Command Palette in VS Code</title>

<updated>2022-06-14T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-06-14:/gemlog/2022-06-14-vs-code-command-center.gmi</id>

<content type="text/plain"># Add a Permanently Visible Command Palette in VS Code &#xA;&#xA;The May 2022 patch notes for VS Code mention the Command Center. &#xA;&#xA;This is basically a permanently visible command palette embedded in the title bar. &#xA;&#xA;For those who regularly use VS Code and use the command palette instead of keyboard shortcuts, you are constantly triggering the command palette and entering commands. &#xA;&#xA;While it is easy to trigger the command palette with a keyboard shortcut, the Command Center gives you a visual element that you can click on instead of the keyboard shortcut. This might help new users get accustomed to the concept of a command palette. &#xA;&#xA;The Command Center can be activated with this preference: &#xA;&#xA;```&#xA;&#34;window.experimental.commandCenter&#34;: true&#xA;&#xA;```&#xA;&#xA;The command center also requires both the title bar style be set to custom and an application restart: &#xA;&#xA;```&#xA;&#34;window.titleBarStyle&#34;: &#34;custom&#34;&#xA;&#xA;```&#xA;&#xA;Note that the command center differs slightly from the command palette. When you trigger the command palette, the prompt is automatically populated with the &gt; symbol which filters the search results and shows only commands. The command center does not automatically provide &gt;  But you can type &gt; to get the same suggestions the command palette would provide. &#xA;&#xA;If you want to trigger the command center instead of the command palette, the default keyboard shortcut on Linux is Ctrl+P. &#xA;&#xA;## References &#xA;&#xA;=&gt; https://code.visualstudio.com/updates/v1_68#_command-center    May 2022 Patch Notes | VS Code &#xA;&#xA;Created: Tuesday, June 14, 2022&#xA;Updated: Tuesday, June 14, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-06-14-vs-code-command-center.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Prevent &#34;Press Enter&#34; in Vim Script</title>

<updated>2022-06-10T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-06-10:/gemlog/2022-06-10-prevent-prompt-in-vim-script.gmi</id>

<content type="text/plain"># Prevent &#34;Press Enter&#34; in Vim Script&#xA;&#xA;I use a Vim session to restore my workspace when I return to work. &#xA;&#xA;Remember that a Vim session is a type of Vim script. So, if I refer to a script below, that information also applies to my problem with a session. &#xA;&#xA;Vim scripts are a series of Vim commands saved in a text file. Each Vim command appears on a separate line. If you use Vim to automatically generate a session file, that file can be edited manually. &#xA;&#xA;I modified my session file to include: &#xA;&#xA;``` Vim Command&#xA;1,4 yank q&#xA;```&#xA;&#xA;This copies lines 1-4 into the &#34;q register. &#xA;&#xA;This solves a problem where I wanted to reuse text by saving it and pasting it later. &#xA;&#xA;The problem I&#39;m having now is that having this command in the Vim script generates the following prompt while loading my session: &#xA;&#xA;``` hit-enter Prompt&#xA;Press ENTER or type command to continue&#xA;```&#xA;&#xA;This forces me to press a key each time I load my session. &#xA;&#xA;I would like to eliminate that prompt. &#xA;&#xA;## Solution&#xA;&#xA;The solution is to prepend the silent command: &#xA;&#xA;```&#xA;silent 1,4 yank q&#xA;```&#xA;&#xA;This suppresses the &#34;Press Enter&#34; prompt while loading my Vim session. &#xA;&#xA;## Note&#xA;&#xA;Typically, the automatic viminfo file would save the contents of the &#34;q register. So, when I start Vim again, the contents of the &#34;q register would still be available. &#xA;&#xA;One way to solve my problem is to set &#34;q and never change it. &#xA;&#xA;After working out how to use the silent command, I decided to remove that line from my session and instead rely on viminfo to solve my problem. Now, when I load my session, the viminfo file restores the contents of &#34;q. And I can paste from those restored contents. &#xA;&#xA;## References&#xA;&#xA;=&gt; https://vimhelp.org/starting.txt.html#Session    Vim Session&#xA;=&gt; https://vimhelp.org/starting.txt.html#viminfo    viminfo File&#xA;=&gt; https://vimhelp.org/various.txt.html#%3Asilent    :silent&#xA;=&gt; https://vimhelp.org/message.txt.html#hit-enter    hit-enter&#xA;&#xA;Created: Friday, June 10, 2022&#xA;Updated: Friday, June 10, 2022&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-06-10-prevent-prompt-in-vim-script.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Some Useful TechNet Wiki Articles</title>

<updated>2022-05-19T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-05-19:/gemlog/2022-05-19-technet-wiki.gmi</id>

<content type="text/plain"># Some Useful TechNet Wiki Articles&#xA;&#xA;=&gt; https://social.technet.microsoft.com/wiki/contents/articles/7703.powershell-running-executables.aspx    Running Executables&#xA;=&gt; https://social.technet.microsoft.com/wiki/contents/articles/7804.powershell-creating-custom-objects.aspx    Creating Custom Objects&#xA;&#xA;Created: Thursday, May 19, 2022&#xA;Updated: Thursday, May 19, 2022&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-05-19-technet-wiki.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Start XFCE Terminal with a Different Shell</title>

<updated>2022-05-18T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-05-18:/gemlog/2022-05-18-launch-alternative-shell.gmi</id>

<content type="text/plain"># Start XFCE Terminal with a Different Shell&#xA;&#xA;I have PowerShell set as the default shell when XFCE Terminal launches. I was not able to update the PowerShell snap package while PowerShell was running. And restarting my Terminal did not cause PowerShell to update. I needed to launch a different shell and trigger an update there. &#xA;&#xA;It is possible to launch an application with command-line options directly from XFCE&#39;s Whisker Menu (Start Menu). &#xA;&#xA;I needed the command-line name for Terminal. And I needed the command-line option to launch an alternative shell. In my case, I can just use Bash as the alternative shell. &#xA;&#xA;The executable name for Terminal is &#34;xfce4-terminal&#34;. The command-line option to launch a different application is &#39;-e&#39;. This execute option is for Terminal version 1.0.2. I believe older versions of Terminal required an additional window option to work properly. &#xA;&#xA;Here is the command I typed into the Whisker Menu search box: &#xA;&#xA;``` Whisker Menu&#xA;xfce4-terminal -e bash&#xA;```&#xA;From there, I was able to manually update PowerShell with the snap command-line utility. &#xA;&#xA;If you want to view the options for Terminal, use the --help option from a shell. If you use --help directly in the Whisker Menu, nothing will show. &#xA;&#xA;``` PowerShell&#xA;xfce4-terminal --help&#xA;```&#xA;&#xA;Created: Wednesday, May 18, 2022&#xA;Updated: Wednesday, May 18, 2022&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-05-18-launch-alternative-shell.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Trim Strings in Vim / Organize Firefox History</title>

<updated>2022-05-18T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-05-18:/gemlog/2022-05-18-trim-strings-firefox-history.gmi</id>

<content type="text/plain"># Trim Strings in Vim / Organize Firefox History&#xA;&#xA;I was able to trim the end of a line in Vim. Combining that along with a few other Vim functions allowed me to organize my Firefox history. &#xA;&#xA;## Background&#xA;&#xA;I have a list of URLs from my Firefox history. I want to sort and deduplicate them. I don&#39;t care about what pages I visited. I am only interested in a list of the hosts. &#xA;&#xA;So a record like &#xA;&#xA;``` History&#xA;https://en.wikipedia.org/wiki/Large_Hadron_Collider&#xA;```&#xA;&#xA;would be reduced to &#xA;&#xA;``` History&#xA;https://en.wikipedia.org/&#xA;```&#xA;&#xA;And if I visited several pages&#xA;&#xA;``` History&#xA;# Pages&#xA;https://en.wikipedia.org/wiki/George_R._R._Martin&#xA;https://en.wikipedia.org/wiki/Game_of_Thrones&#xA;&#xA;# Hosts &#xA;https://en.wikipedia.org/&#xA;https://en.wikipedia.org/&#xA;&#xA;```&#xA;&#xA;then I only want one example of each host to show in the output. &#xA;&#xA;``` History&#xA;https://en.wikipedia.org/&#xA;&#xA;```&#xA;&#xA;I have the URLs in Vim. But I am not sure how to proceed. &#xA;&#xA;I was able to load the URLs in Vim by: &#xA;&#xA;* Open Firefox. &#xA;* Click on hot dog menu &gt; History (menu item) &gt; Manage History (at the bottom). A new &#34;Library&#34; window will open showing your history. &#xA;* Click on &#34;This month&#34; in the sidebar on the left. &#xA;* Click on one of the entries in the main viewing area to select it. &#xA;* Press Ctrl-A to select all entries. &#xA;* Press Ctrl-C to copy. &#xA;* Open Vim. &#xA;* Enter the command below to paste. &#xA;&#xA;``` Vim&#xA;:0 put +&#xA;```&#xA;&#xA;This leaves me with a Vim window populated with my Firefox history. Specifically, there is a list of URLs. There is one URL per line. &#xA;&#xA;I&#39;m using Vim on Linux. These steps might vary on other platforms. For example, carriage returns, ^M, might not show on Windows. &#xA;&#xA;## Remove Carriage Returns&#xA;&#xA;If you copy and paste from the Firefox History window, you will see a &#39;^M&#39; at the end of each line. These are explicit carriage returns which are normally non-printing characters. &#xA;&#xA;You can remove the carriage returns using the :substitute command in Vim. &#xA;&#xA;``` Vim&#xA;:%s/\r//&#xA;```&#xA;&#xA;## Match the Beginning of the Line&#xA;&#xA;It is not immediately clear how to trim the end of each line. &#xA;&#xA;One way to get started is to write a regular expression which captures the beginning of the string: the part of the URL I want to keep. Maybe we can use this as part of the solution. &#xA;&#xA;So if we have a line like&#xA;&#xA;``` History&#xA;https://www.phoronix.com/scan.php?page=news_item&amp;px=System76-Scheduler-1.1&#xA;```&#xA;&#xA;then we can progressively develop a regular expression that captures the beginning of the URL. &#xA;&#xA;``` Regular Expression&#xA;# Original URL&#xA;https://www.phoronix.com/scan.php?page=news_item&amp;px=System76-Scheduler-1.1&#xA;&#xA;# Manually delete the end of the string. &#xA;https://www.phoronix.com/&#xA;&#xA;# Anchor the beginning of the string by adding ^&#xA;^https://www.phoronix.com/&#xA;&#xA;# Escape forward slashes. &#xA;^https:\/\/www.phoronix.com\/&#xA;&#xA;# Add wildcard for host name. &#xA;^https:\/\/[^/]\+\/&#xA;```&#xA;&#xA;We can test this regular expression by searching for it. &#xA;&#xA;``` Vim &#xA;&#34; Activate the Search Highlight option in Vim. &#xA;:set hlsearch&#xA;&#xA;&#34; Search using the regular expression. &#xA;/^https:\/\/[^/]\+\/&#xA;```&#xA;&#xA;If you want to save typing the regular expression into the command line, it is possible to paste from the clipboard to the Vim command line. In this context, the search prompt is considered a command line for the purposes of Ctrl-R. &#xA;&#xA;* Copy the example regular expression. &#xA;&#xA;&gt; ^https:\/\/[^/]\+\/&#xA;&#xA;* Switch to the Vim window. &#xA;* Press Esc twice to return to Vim&#39;s normal mode. &#xA;* Type forward slash &#39;/&#39; to begin a search. &#xA;* Press Ctrl-R. You will be silently prompted for a register. &#xA;* Type plus &#39;+&#39; to specify the clipboard register. &#xA;&#xA;After typing the plus symbol, the command line will fill with the contents of the clipboard. Note that if you happened to copy a newline then a &#39;^M&#39; might show at the end of the line. You can press Backspace once to remove &#39;^M&#39;. &#xA;&#xA;* Press Enter to begin the search. &#xA;&#xA;Since I turned on search highlight, you might see the highlighting take effect as you enter the regular expression. But you still have to press Enter to formally begin the search. &#xA;&#xA;At this point, we can match the beginning of the URL. &#xA;&#xA;## Start of the Match&#xA;&#xA;Vim has a regular expression atom \zs which sets the start of the match. &#xA;&#xA;It is not immediately obvious what this means or how it is helpful. &#xA;&#xA;At this point, we have two basic functions. &#xA;&#xA;One, we can substitute text for other text. So, if we can find text then we can replace it with nothing. This effectively deletes the text we are searching for. &#xA;&#xA;Two, we can match the beginning of the URL. &#xA;&#xA;I want to delete the end of the string. &#xA;&#xA;It doesn&#39;t make sense to delete the beginning of the string which is what we can match right now. &#xA;&#xA;In principle, it is possible to match the end of a URL. But that has an unknown number of path components separated by forward slashes. It is easier to match the beginning of the URL because it has a fixed form: https://wildcard/  That is why I&#39;ve chosen to match that part. &#xA;&#xA;What we need now is some way to combine (a match for the beginning of the string) with (the substitute command). And that combination has to help me reach my goal. &#xA;&#xA;This is where \zs comes in. &#xA;&#xA;\zs works in combination with another regular expression. &#xA;&#xA;First we search for something. &#xA;&#xA;``` Vim&#xA;/^https:\/\/[^/]\+\/&#xA;```&#xA;&#xA;where the leading / begins a search in Vim and &#xA;&#xA;&gt; ^https:\/\/[^/]\+\/&#xA;&#xA;is the regular expression we are looking for. &#xA;&#xA;Then we add \zs. &#xA;&#xA;Note you can press / and then the up arrow on the keyboard to recall the last search. Then you can modify the search by adding \zs. Don&#39;t forget to press Enter to begin the search. &#xA;&#xA;``` Vim&#xA;/^https:\/\/[^/]\+\/\zs&#xA;```&#xA;&#xA;At this point, Vim interprets this to mean: &#xA;&#xA;* Search for the beginning of the URL. &#xA;* Start looking for a new match after the first match. &#xA;&#xA;We can add a wildcard .* to match the rest of the line. &#xA;&#xA;``` Vim&#xA;/^https:\/\/[^/]\+\/\zs.*&#xA;```&#xA;&#xA;If you try this search in Vim with the &#39;hlsearch&#39; option turned on, you will see the end of each URL get highlighted.&#xA;&#xA;Another way to think of \zs is as a (regular expression ignore operator) in Vim. &#xA;&#xA;We: &#xA;&#xA;* Search for something. &#xA;* \zs&#xA;* Search for something else. &#xA;&#xA;And the first thing we search for is ignored. &#xA;&#xA;You might be interested to know there is a complementary Vim atom \ze which works at the end of a string. &#xA;&#xA;## Trim Strings&#xA;&#xA;Now we have a way to reliably select the end of each URL. If we combine the regular expression with the substitute command then we can replace the end of the string with nothing. This will effectively trim the strings. &#xA;&#xA;``` Vim&#xA;:%s/^https:\/\/[^/]\+\/\zs.*//&#xA;```&#xA;&#xA;One shortcut you can take here is to reuse the regular expression from a recent search. Using Ctrl-R in this way lets you experiment with different searches and then transfer a working expression to :substitute. &#xA;&#xA;* Type :%s/ to begin a substitution. &#xA;* Press Ctrl-R and then / to recall the regular expression from the last search to the current command line. Here &#39;/&#39; represents a register dedicated to the last search pattern.  &#xA;* Type // to replace the match with nothing. &#xA;&#xA;One consequence of using &#39;https&#39; in my regular expression is that &#39;http&#39; sites still have their path components. You can remove those paths by making the &#39;s&#39; optional. &#xA;&#xA;``` Vim&#xA;:%s/^https\?:\/\/[^/]\+\/\zs.*//&#xA;```&#xA;&#xA;At this point we have trimmed the strings. &#xA;&#xA;## Sort and Deduplicate &#xA;&#xA;I&#39;d like to sort the URLs alphabetically and remove duplicates. &#xA;&#xA;Vim has a :sort command. The :sort command has an option, u, which only returns unique entries. By default, :sort applies to the entire buffer or file. &#xA;&#xA;``` Vim&#xA;:sort u&#xA;```&#xA;&#xA;This sorts the strings alphabetically and removes any duplicates. &#xA;&#xA;But we&#39;re left with a few problems. &#xA;&#xA;One further refinement is to remove &#39;www.&#39; from the results and sort again: &#xA;&#xA;``` Vim&#xA;:%s/www\.// | sort u&#xA;```&#xA;&#xA;http and https sites will be grouped separately after being sorted alphabetically. You can group the hosts together by stripping off the protocol. &#xA;&#xA;``` Vim&#xA;:%s/https\?:\/\/// | sort u&#xA;```&#xA;&#xA;This produces the final output and addresses my original problem. &#xA;&#xA;Now I can go through my sorted list and see what sites I visited. &#xA;&#xA;## References &#xA;&#xA;=&gt; https://en.wikipedia.org/wiki/Domain_name#Domain_name_syntax    Domain Name Syntax | Wikipedia&#xA;=&gt; https://en.wikipedia.org/wiki/Hamburger_button    Hot Dog Menu Icon | Wikipedia&#xA;=&gt; https://vimhelp.org/cmdline.txt.html#%3Arange    The 0 in &#39;:0 put +&#39; | Vim Help&#xA;=&gt; https://vimhelp.org/change.txt.html#%3Aput    :put | Vim Help&#xA;=&gt; https://vimhelp.org/gui_x11.txt.html#quote%2B    &#34;+ | The Clipboard Register | Vim Help &#xA;=&gt; https://vimhelp.org/change.txt.html#%3Asubstitute    :substitute | Vim Help&#xA;=&gt; https://vimhelp.org/pattern.txt.html#%2F%5Cr    \r | Carriage Return Escape Sequence | Vim Help&#xA;=&gt; https://www.regular-expressions.info/    Regular Expressions | Regular-Expressions.info&#xA;=&gt; https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference    Regular Expression Quick Reference | Microsoft Docs&#xA;=&gt; https://vimhelp.org/options.txt.html#%27hlsearch%27    &#39;hlsearch&#39; | Vim Help&#xA;=&gt; https://vimhelp.org/cmdline.txt.html#c_CTRL-R    Ctrl-R | Paste from Clipboard to Command Line | Vim Help&#xA;=&gt; https://vimhelp.org/pattern.txt.html#%2F%5Czs    \zs | Start of the Match | Vim Help&#xA;=&gt; https://en.wikipedia.org/wiki/URL#path    Path Components | URL | Wikipedia&#xA;=&gt; https://vimhelp.org/change.txt.html#quote%2F    &#34;/ | The Last Search Pattern Register | Vim Help&#xA;=&gt; https://vimhelp.org/change.txt.html#%3Asort    :sort | Vim Help &#xA;=&gt; https://vimhelp.org/cmdline.txt.html#%3Abar    Using a Vertical Bar to Separate Multiple Commands | Vim Help &#xA;&#xA;Created: Thursday, May 19, 2022&#xA;Updated: Thursday, May 19, 2022&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-05-18-trim-strings-firefox-history.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Opening a Terminal in Vim</title>

<updated>2022-05-11T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-05-11:/gemlog/2022-05-11-vim-terminal.gmi</id>

<content type="text/plain"># Opening a Terminal in Vim &#xA;&#xA;Sometimes it is useful to run a shell inside Vim. This outputs to a Vim buffer, this allows searching the output with regular expressions, the output can be saved, and the output can be easily copied to a new buffer where it can be edited. &#xA;&#xA;Here are the basic moves. &#xA;&#xA;## Open a Terminal in a New Tab&#xA;&#xA;After opening Vim, you can open a terminal in a new Vim tab using the ex command below. This will automatically switch you to the new tab. Here, I open PowerShell. &#xA;&#xA;``` Vim Ex&#xA;:tab terminal pwsh&#xA;```&#xA;&#xA;## Switch to Terminal-Normal Mode&#xA;&#xA;You can use your terminal normally in Vim. &#xA;&#xA;But if you want to start using Vim commands, you will have to break out of the focus on the shell. &#xA;&#xA;The keystroke &#39;Ctrl-w, N&#39; will pause the shell and switch Vim to Normal mode. Note the trailing N must be capitalized. &#xA;&#xA;In Normal mode, you can search the buffer with &#39;/&#39; or save it with &#39;:w {file}&#39;.&#xA;&#xA;While in Terminal-Normal mode, you can copy the contents of the terminal buffer to a new buffer with the commands below. In the new buffer, you can edit with normal Vim commands. The terminal tab cannot be edited directly. &#xA;&#xA;``` Terminal-Normal Mode&#xA;:% yank&#xA;:tabnew&#xA;:0 put&#xA;```&#xA;&#xA;## Switch Vim Tabs&#xA;&#xA;To switch between Vim tabs, use the keystrokes &#39;gt&#39;. If you&#39;re using the terminal, you will have to switch to Terminal-Normal mode to use &#39;gt&#39;. Or, you can use &#39;Ctrl-w, gt&#39; while focus is still on the shell. &#xA;&#xA;If you have mouse support enabled or if you are using gVim then you can click on the tabs near the top of the window to switch tabs. &#xA;&#xA;## Return to Terminal &#xA;&#xA;To switch back to the terminal and resume processing, use &#39;i&#39; for Insert mode: as if you were going to edit the buffer. If you previously switched tabs, you will have to switch back to the terminal tab first. &#xA;&#xA;## Exit Terminal&#xA;&#xA;You must exit the terminal process before closing the buffer. Exit the shell normally. And, then, exit Vim normally. &#xA;&#xA;``` Vim Terminal&#xA;exit&#xA;:q&#xA;```&#xA;&#xA;## References &#xA;&#xA;=&gt; https://vimhelp.org/terminal.txt.html#Terminal-mode    Terminal-Mode&#xA;&#xA;Created: Wednesday, May 11, 2022&#xA;Updated: Wednesday, May 11, 2022&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-05-11-vim-terminal.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Working with Secret Information in Vim</title>

<updated>2022-05-06T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-05-06:/gemlog/2022-05-06-vim-secrets.gmi</id>

<content type="text/plain"># Working with Secret Information in Vim&#xA;&#xA;I am vaguely aware that Vim stores information about the file I am working on. This presents a problem if I am working on a file that contains secrets and I do not want to persist those secrets outside their designated storage. &#xA;&#xA;So, it would be useful to know: &#xA;&#xA;* Where does Vim store information? &#xA;* What steps should I take to protect the secret file I am working on? &#xA;&#xA;## Current Vim Options&#xA;&#xA;A good place to start is to view your current Vim options. Open a new instance of Vim. And enter the set command:  &#xA;&#xA;``` Vim&#xA;:set&#xA;```&#xA;&#xA;This will show all the current options in a popup. &#xA;&#xA;Here is what I see on my system: &#xA;&#xA;``` Vim&#xA;:set&#xA;--- Options ---&#xA;  autoindent          hlsearch            mouse=a             splitbelow&#xA;  backspace=start     ignorecase          ruler               splitright&#xA;  display=lastline    incsearch           scroll=11           ttimeout&#xA;  helplang=en         linebreak           shell=pwsh          ttimeoutlen=100&#xA;  backupdir=~/.cache/vim/backup//&#xA;  directory=~/.cache/vim/swap//&#xA;  fileencodings=ucs-bom,utf-8,default,latin1&#xA;  guifont=Monospace 14&#xA;  printoptions=paper:letter&#xA;  suffixes=.bak,~,.o,.info,.swp,.aux,.bbl,.blg,.brf,.cb,.dvi,.idx,.ilg,.ind,.inx&#xA;,.jpg,.log,.out,.png,.toc&#xA;  termencoding=utf-8&#xA;  undodir=~/.cache/vim/undo//&#xA;Press ENTER or type command to continue&#xA;```&#xA;&#xA;As far as storing information, these three options are relevant: &#xA;&#xA;* backupdir=~/.cache/vim/backup//&#xA;* directory=~/.cache/vim/swap//&#xA;* undodir=~/.cache/vim/undo//&#xA;&#xA;&#39;backupdir&#39; corresponds to backups. &#39;directory&#39; corresponds to swap files. And &#39;undodir&#39; corresponds to undo. &#xA;&#xA;By default, backup files are kept temporarily while writing a file. In my case, I don&#39;t mind this behavior. I am concerned about information which persists after I am done editing. Since the backup file is deleted after use, the backup option is fine with me. &#xA;&#xA;The swap file is used to recover your work after a power outage. Looking in my swap directory, I see a lot of cruft left over here. These must be from various system failures in the past. I don&#39;t mind having a swap file while I am actively working. But I think it would be a good idea to check this directory for leftovers after I am done working. I can visit the directory at: &#xA;&#xA;&gt; ~/.cache/vim/swap/&#xA;&#xA;The information to support undo and redo is normally kept in memory and discarded after closing a file. But if you have &#39;undofile&#39; and &#39;undodir&#39; set, that information is saved. I have inherited undodir from somewhere in the Manjaro installation. But I do not have undofile set. So, I don&#39;t think I have to worry about undo files. &#xA;&#xA;## All Caching Options&#xA;&#xA;I&#39;ve already talked about swap, undo, and backup options. The only other relevant option I am aware of is the viminfo option. &#xA;&#xA;* viminfo&#xA;* swap&#xA;* undo&#xA;* backup&#xA;&#xA;viminfo saves information about the working environment including: &#xA;&#xA;* History &#xA;* Registers&#xA;* Bookmarks&#xA;* Variables &#xA;&#xA;I don&#39;t have the &#39;viminfofile&#39; option set. This is why viminfo did not show as output from :set  But there is a default location. And my viminfo is saved at:&#xA;&#xA;&gt; ~/.viminfo&#xA;&#xA;I&#39;ll want to exclude this file while I&#39;m working with secret information. Otherwise things like register contents and command history will show up in my viminfo. &#xA;&#xA;## Summary of What I Found&#xA;&#xA;So, after examining my environment, I determined that I will have to disable viminfo, and I should check the swap directory after I am done working to make sure there are no leftover recovery files. I don&#39;t have to worry about undo or backup files in my situation. And I am not aware of any other cache files. The other files Vim stores in my home directory are used for configuration and not caching. &#xA;&#xA;If I was using a different system, it would have a different configuration. And I would have to examine that system to determine its vulnerability. Read the Vim help files I link to below for more information. The article about encryption discusses the issues related to secrets in Vim and was helpful. &#xA;&#xA;## Precautionary Steps&#xA;&#xA;Here are the steps I developed to work with secrets on my system: &#xA;&#xA;* Start a new instance of Vim. &#xA;* :set viminfo=&#xA;* :edit your_secret_file.txt&#xA;* Finish working. &#xA;* Close Vim. &#xA;* Check ~/.cache/vim/swap/ for any leftover swap files. &#xA;&#xA;I can check for recent changes with this command: &#xA;&#xA;``` PowerShell&#xA;Get-ChildItem -Path &#34;~/.viminfo&#34;, &#34;~/.cache/vim/&#34; -Recurse -Force -File | &#xA;  Where-Object { $_.LastWriteTime -ge ((Get-Date).AddDays(-1)) } | &#xA;  Sort-Object -Property LastWriteTime -Descending | &#xA;  Format-Table -AutoSize&#xA;&#xA;   Directory: /home/michael&#xA;&#xA;UnixMode   User    Group    LastWriteTime  Size Name&#xA;--------   ----    -----    -------------  ---- ----&#xA;-rw------- michael michael 5/6/2022 08:55 59922 .viminfo&#xA;&#xA;```&#xA;&#xA;## Other Leaks&#xA;&#xA;On Linux, the clipboards in X11 will pick up any text you are editing while Vim is open. Normally, this information will be lost when Vim is closed. But you might have a clipboard assistant like Clipman which would keep this information after Vim closes. In that case, you would have to go to Clipman and clear out its history. You might also use a tool like xclip while preparing your secret file. That will hang onto information while xclip is running in the background. Closing xclip will address that issue. Remember that the clipboards in X11 are based on running programs. So closing the relevant programs will clear any secrets from the clipboards. Wayland, macOS, and Windows might have similar issues. &#xA;&#xA;While I&#39;ve discussed the swap file for Vim specifically, there might also be a general swap file for your entire system. You can check the status of your swap file with the swapon command-line utility. I don&#39;t have a swap file on my system. And, to be honest, I&#39;m not sure how to address this issue. If you think your secrets might be exposed there, you will have to search for more information elsewhere. &#xA;&#xA;Also, nothing I&#39;ve discussed here will address the issue of files persisting in memory. root or a local administrator on Windows will be able to pull the contents of your file from memory while the system is still running or after waking from sleep. If you are worried about this, I believe rebooting will clear that cached memory. &#xA;&#xA;## References &#xA;&#xA;=&gt; https://vimhelp.org/editing.txt.html#encryption    encryption&#xA;=&gt; https://vimhelp.org/starting.txt.html#viminfo    viminfo&#xA;=&gt; https://vimhelp.org/options.txt.html#%27viminfofile%27    &#39;viminfofile&#39;&#xA;=&gt; https://vimhelp.org/recover.txt.html#swap-file    swap &#xA;=&gt; https://vimhelp.org/usr_02.txt.html#02.5    undo and redo&#xA;=&gt; https://vimhelp.org/undo.txt.html#undo-persistence    undo persistence&#xA;=&gt; https://vimhelp.org/options.txt.html#%27undodir%27    &#39;undodir&#39;&#xA;=&gt; https://vimhelp.org/editing.txt.html#backup    backup&#xA;&#xA;## Changes &#xA;&#xA;* Fixed Vim options links. Thanks Carlo Teubner. &#xA;&#xA;Created: Friday, May 6, 2022&#xA;Updated: Friday, May 6, 2022</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-05-06-vim-secrets.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Vim Modelines</title>

<updated>2022-05-06T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-05-06:/gemlog/2022-05-06-vim-modelines.gmi</id>

<content type="text/plain"># Vim Modelines &#xA;&#xA;Temporarily setting Vim options like nowrap and guioptions+=b can be helpful for log files. But it is inconvenient to either set permanent options in vimrc or to type these options each time. &#xA;&#xA;Vim modelines allow you to set Vim options per file. &#xA;&#xA;The trade-off is that modelines appear directly in the file. So, you might have to work with a copy of a file if editing is not allowed. &#xA;&#xA;Just add the modeline directly to the top or bottom of the file. Here is an example from my notes. The next time I open this file, the long lines will scroll off the edge and if I am using gVim then I will get a scroll bar at the bottom of the window. &#xA;&#xA;``` some text file &#xA;vim:nowrap guioptions+=b&#xA;&#xA;&#x9;https://www.youtube.com/watch?v=xRmDIL9l3b0&#xA;&#x9;https://fidoalliance.org/charting-an-accelerated-path-forward-for-passwordless-authentication-adoption/&#xA;&#x9;https://fidoalliance.org/world-password-day-had-a-good-run-now-were-celebrating-a-future-with-less-passwords/&#xA;...&#xA;```&#xA;&#xA;## References &#xA;&#xA;=&gt; https://vimhelp.org/options.txt.html#auto-setting    modelines&#xA;&#xA;Created: Friday, May 6, 2022&#xA;Updated: Friday, May 6, 2022&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-05-06-vim-modelines.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Install Samba</title>

<updated>2022-05-02T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-05-02:/gemlog/2022-05-02-install-samba.gmi</id>

<content type="text/plain"># Install Samba &#xA;&#xA;I&#39;m using Manjaro on my desktop. And I want to create a read-only file share to share files with my iPad. I will be logging in as a guest. Here, I install and configure Samba. And I include configuration parameters that make the share compatible with my iPad. &#xA;&#xA;I already created a directory for my file share at /data/fileshare. And I placed a test file in there: weird_fishes.txt  &#xA;&#xA;## Install &#xA;&#xA;### Install Samba Package&#xA;&#xA;``` terminal &#xA;sudo pacman -S samba&#xA;```&#xA;&#xA;### Write smb.conf&#xA;&#xA;Installing Samba does not include a default configuration file. Here is an example file for my share which is compatible with Apple devices. &#xA;&#xA;``` PowerShell&#xA;sudo pwsh -c &#34;New-Item -Path &#39;/etc/samba/smb.conf&#39; -ItemType File -Force&#34;&#xA;sudo vim /etc/samba/smb.conf&#xA;```&#xA;&#xA;File Name: &#xA;&#xA;&gt; /etc/samba/smb.conf &#xA;&#xA;File Contents: &#xA;&#xA;``` smb.conf&#xA;[global]&#xA;   server role = standalone server&#xA;   log file = /var/log/samba/%m.log&#xA;   map to guest = Bad User&#xA;   load printers = no&#xA;   printing = bsd&#xA;   printcap name = /dev/null&#xA;   disable spoolss = yes&#xA;   show add printer wizard = no&#xA;   vfs objects = fruit streams_xattr&#xA;   #log level = 3 &#xA;&#xA;[fileshare]&#xA;   path = /data/fileshare&#xA;   public = yes&#xA;&#xA;```&#xA;&#xA;Run the testparm command after writing the configuration file to validate the smb.conf syntax. &#xA;&#xA;``` terminal&#xA;# basic&#xA;testparm -s&#xA;&#xA;# verbose&#xA;# Press Enter to load Vim after testparm runs. &#xA;testparm -v | vim +&#34;set nomodified&#34; - &#xA;```&#xA;&#xA;### Start Samba&#xA;&#xA;Enable and start Samba. &#xA;&#xA;``` terminal &#xA;sudo systemctl enable --now smb.service&#xA;```&#xA;&#xA;### Confirm Directory Permissions&#xA;&#xA;You can check the current permissions of the file share and its parents with namei. &#xA;&#xA;If you save the namei output to a file, you can revert any permission changes you make in the next step or later. There won&#39;t be a way to undo changes made with chmod without this information. &#xA;&#xA;``` terminal &#xA;namei -l /data/fileshare&#xA;&#xA;# Save namei output to a file. &#xA;namei -l /data/fileshare &gt;&gt; /home/michael/Desktop/namei_output.txt&#xA;```&#xA;&#xA;The guest user (nobody) should have read and execute permissions on the shared folder and execute permission on all parent directories. To accomplish this, you will need to modify the &#39;other&#39; permissions for each directory. I am not aware of an easy way to do this work in one step. The best way is making changes to individual directories with chmod. &#xA;&#xA;The example below adds the execute permission for &#39;other&#39; to the /data directory. The execute permission allows Samba to traverse this directory to any child directories: like &#34;fileshare&#34;. &#xA;&#xA;``` terminal &#xA;chmod o+x /data&#xA;```&#xA;&#xA;### Configuring AppArmor&#xA;&#xA;In my case, I also need to configure AppArmor because I&#39;m using Ubuntu Snaps (packages) on my system. AppArmor is a prerequisite for the snapd daemon. &#xA;&#xA;Since I am using a custom share directory--/data/fileshare--I need to tell AppArmor about it. By adding exceptions to my AppArmor policy, the Samba service will be able to access the file share on behalf of connected clients. &#xA;&#xA;* Edit the usr.sbin.smbd file as root. &#xA;&#xA;``` PowerShell&#xA;sudo vim /etc/apparmor.d/local/usr.sbin.smbd&#xA;&#xA;```&#xA;&#xA;* Add two exceptions for your custom file share. &#xA;&#xA;The contents of my usr.sbin.smbd file are below. &#xA;&#xA;The first exception gives Samba read access to the root of the share. &#xA;&#xA;The second exception gives Samba permission to make changes to subfolders and files. &#xA;&#xA;Remember, these changes fix any problems caused by AppArmor. But Samba will still respect the directory permissions mentioned earlier. So, in AppArmor, it&#39;s ok to allow read, write, and other types of necessary permissions. If you want to decode the the AppArmor exceptions shown below, see the File Permissions link at the end of this article. &#xA;&#xA;In both exceptions, I&#39;ve used the path to my share directory: &#34;/data/fileshare/&#34;  You will have to modify the paths in this configuration file to match your share path if it&#39;s different than mine. &#xA;&#xA;File Name: &#xA;&#xA;&gt; /etc/apparmor.d/local/usr.sbin.smbd&#xA;&#xA;File Contents: &#xA;&#xA;``` usr.sbin.smbd&#xA;# Site-specific additions and overrides for &#39;usr.sbin.smbd&#39;&#xA;&#34;/data/fileshare/&#34; rk,&#xA;&#34;/data/fileshare/**&#34; lrwk,&#xA;&#xA;```&#xA;&#xA;* Save your changes to usr.sbin.smbd &#xA;&#xA;* Restart the AppArmor service. &#xA;&#xA;``` PowerShell&#xA;sudo systemctl restart apparmor&#xA;&#xA;```&#xA;&#xA;&#xA;### Verify Guest Access &#xA;&#xA;Try to access the file share with the smbclient terminal application. At the smb: \&gt; prompt, try using ls to list the files available on the share. &#xA;&#xA;In this example, we can see the weird_fishes.txt file is listed. &#xA;&#xA;``` terminal &#xA;smbclient -N //localhost/fileshare&#xA;&#xA;Try &#34;help&#34; to get a list of possible commands.&#xA;&#xA;smb: \&gt; ls&#xA;  .                                   D        0  Mon May  2 07:42:32 2022&#xA;  ..                                  D        0  Sun May  1 07:21:15 2022&#xA;  weird_fishes.txt                    N      691  Sun May  1 11:32:31 2022&#xA;&#xA;&#x9;&#x9;479597248 blocks of size 1024. 440488612 blocks available&#xA;smb: \&gt; exit&#xA;&#xA;```&#xA;&#xA;After verifying guest access, the file share should be working for you. &#xA;&#xA;## Test iPad&#xA;&#xA;Try connecting to the share with the iPad. &#xA;&#xA;* Open the Files app. &#xA;* Tap the circle with three dots near the top of the Files side panel. &#xA;* Tap Connect to Server. &#xA;* Enter the fully qualified path to the share. In my case: &#xA;&#xA;&gt; smb://edward/fileshare&#xA;&#xA;Where &#34;smb://&#34; is the protocol and is the same for everyone. &#34;edward&#34; is the network name of my computer; change this to match your server&#39;s network name. And, &#34;fileshare&#34; is the share folder. &#xA;&#xA;* Tap Connect or press Return on your keyboard. Now, we&#39;re asked to connect as a Guest or Registered User. &#xA;* Tap Guest. &#xA;* Tap Next. Now the file share should be visible. &#xA;&#xA;From here, I can browse and open files on the share. &#xA;&#xA;If you want to return to the shared folder within the Files app, the file share will be listed under the Shared heading with the server name. On my Files app, I see Shared and then edward. The eject button next to the server name lets you explicitly disconnect from the server. &#xA;&#xA;## Troubleshooting &#xA;&#xA;### iPad Error Messages&#xA;&#xA;During testing, I received two error messages from the iPad. &#xA;&#xA;&gt; The operation couldn&#39;t be completed. Operation not supported.&#xA;&#xA;&gt; Content Unavailable  The folder contents could not be displayed because of an unknown error.&#xA;&#xA;Make sure that you are not using the &#34;hosts allow&#34; parameter in smb.conf. I noticed that the iPad was communicating with the server via IPv6. That makes it difficult to create a reliable list of allowed hosts. So, I don&#39;t use &#34;hosts allow&#34;. The &#34;interfaces&#34; smb.conf parameter might also cause problems. &#xA;&#xA;### Problems After Updating to Manjaro 21.3.7&#xA;&#xA;I had trouble connecting to my file share after updating to Manjaro 21.3.7  This version was released in August 2022. &#xA;&#xA;To fix the issue, I needed to add two exceptions to AppArmor. I installed AppArmor as a prerequisite for Ubuntu Snaps. I use snaps elsewhere on my system. And snaps were installed while Samba was working. But, some part of the default security policy changed while upgrading Manjaro. So, versions of Manjaro 21.3.7 and later require the exceptions to be added if you&#39;re using AppArmor. &#xA;&#xA;See the section above on Configuring AppArmor for instructions. &#xA;&#xA;While I was having this issue, the Samba log showed this error:  &#xA;&#xA;File Name: &#xA;&#xA;&gt; log.samba-dcerpcd &#xA;&#xA;File Contents: &#xA;&#xA;``` log.samba-dcerpcd&#xA;[2023/03/20 16:00:37,  0] ../../source3/rpc_server/rpc_host.c:2940(main)&#xA;  main: messaging_init() failed&#xA;&#xA;```&#xA;&#xA;## Administration &#xA;&#xA;### Check Samba Logs &#xA;&#xA;Note that journalctl will not show the full log. Go to /var/log/samba and read the logs directly. &#xA;&#xA;List the modified logs. &#xA;&#xA;```&#xA;Get-ChildItem -Path &#34;/var/log/samba&#34; | &#xA;  Where-Object { $_.LastWriteTime -ge ((Get-Date).AddMinutes(-20))} | &#xA;  Sort-Object -Property LastWriteTime -Descending | &#xA;  Format-Table -AutoSize&#xA;&#xA;   Directory: /var/log/samba&#xA;&#xA;UnixMode   User Group  LastWriteTime   Size Name&#xA;--------   ---- -----  -------------   ---- ----&#xA;-rw-r--r-- root root  5/3/2022 21:20   4476 log.smbd&#xA;-rw-r--r-- root root  5/3/2022 21:20   7592 log.samba-dcerpcd&#xA;-rw-r--r-- root root  5/3/2022 21:20    744 log.rpcd_lsad&#xA;-rw-r--r-- root root  5/3/2022 21:20    744 log.rpcd_mdssvc&#xA;-rw-r--r-- root root  5/3/2022 21:20    744 log.rpcd_rpcecho&#xA;-rw-r--r-- root root  5/3/2022 21:20    744 log.rpcd_epmapper&#xA;-rw-r--r-- root root  5/3/2022 21:20    744 log.rpcd_fsrvp&#xA;-rw-r--r-- root root  5/3/2022 21:20    744 log.rpcd_spoolss&#xA;-rw-r--r-- root root  5/3/2022 21:20  14068 log.rpcd_winreg&#xA;-rw-r--r-- root root  5/3/2022 21:20  24704 log.rpcd_classic&#xA;-rw-r--r-- root root  5/3/2022 21:20 278637 smbd.log&#xA;-rw-r--r-- root root  5/3/2022 21:20  46072 2600_1700_1e80_7880_bc92_a917_e0f1_&#xA;                                            2fe3.log&#xA;-rw-r--r-- root root  5/3/2022 21:20 154076 mobile.log&#xA;&#xA;```&#xA;&#xA;Read the log file. &#xA;&#xA;```&#xA;vim -R /var/log/samba/smbd.log&#xA;&#xA;...&#xA;[2022/05/03 21:20:13.032298,  0] ../../source3/smbd/server.c:1741(main)&#xA;  smbd version 4.16.0 started.&#xA;  Copyright Andrew Tridgell and the Samba Team 1992-2022&#xA;[2022/05/03 21:20:13.032359,  2] ../../source3/smbd/server.c:1744(main)&#xA;  uid=0 gid=0 euid=0 egid=0&#xA;[2022/05/03 21:20:13.032596,  2] ../../source3/lib/tallocmsg.c:84(register_msg_pool_usage)&#xA;  Registered MSG_REQ_POOL_USAGE&#xA;[2022/05/03 21:20:13.032609,  2] ../../source3/lib/dmallocmsg.c:78(register_dmalloc_msgs)&#xA;  Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED&#xA;...&#xA;&#xA;```&#xA;&#xA;### Increase Log Level&#xA;&#xA;Change the log level by adding a parmeter to smb.conf and restarting the smb service. This will show additional information. &#xA;&#xA;Remember to disable the higher log level after you are finished troubleshooting. You can comment out the parameter with &#39;#&#39;. Then restart the service again. &#xA;&#xA;File Name: &#xA;&#xA;&gt; /etc/samba/smb.conf&#xA;&#xA;File Contents: &#xA;&#xA;Add log level under [global]. &#xA;&#xA;``` smb.conf&#xA;[global]&#xA;   log level = 3&#xA;```&#xA;&#xA;### Manage Samba&#xA;&#xA;You can manage the Samba service with the commands below.  &#xA;&#xA;``` terminal &#xA;systemctl status smb.service | vim +&#34;set nowrap&#34; +&#34;set nomodified&#34; -&#xA;sudo systemctl start smb.service&#xA;sudo systemctl stop smb.service&#xA;sudo systemctl restart smb.service&#xA;```&#xA;&#xA;### Making Changes to smb.conf&#xA;&#xA;Here are the steps for changing the smb.conf file. &#xA;&#xA;``` terminal&#xA;sudo vim /etc/samba/smb.conf&#xA;testparm -s&#xA;sudo systemctl restart smb.service&#xA;```&#xA;&#xA;### Change the systemd unit File for Samba&#xA;&#xA;Here is the location of the systemd configuration for Samba. For example, you can add smbd command-line options to the &#34;ExecStart=&#34; line available in the file. See the smbd manual page linked below for available options. &#xA;&#xA;``` terminal&#xA;# edit file&#xA;# Use &#39;#&#39; for comments inside the file. &#xA;sudo vim /usr/lib/systemd/system/smb.service&#xA;&#xA;# Reload systemd manager configuration&#xA;sudo systemctl daemon-reload&#xA;&#xA;# restart unit&#xA;sudo systemctl restart smb.service&#xA;```&#xA;&#xA;## Uninstall &#xA;&#xA;You can reverse the changes made here and uninstall Samba with these commands. &#xA;&#xA;This leaves the file share directory and contents intact. This does not undo or change any local permissions to the file share directory which might have changed by using chmod. If you saved the namei output before making changes, you can use that information to manually reset permissions for each directory. &#xA;&#xA;I also reset the AppArmor exceptions file back to its default. This only affects Samba.&#xA;&#xA;``` terminal &#xA;sudo systemctl stop smb.service&#xA;sudo systemctl disable smb.service&#xA;sudo rm /etc/samba/smb.conf&#xA;&#34;# Site-specific additions and overrides for &#39;usr.sbin.smbd&#39;&#34; &gt; /etc/apparmor.d/local/usr.sbin.smbd&#xA;sudo systemctl restart apparmor&#xA;sudo pacman -Rs samba &#xA;```&#xA;&#xA;## Note on Vim &#xA;&#xA;If you pipe stdin to Vim, the resulting buffer or file will be marked as modified. And you will be prompted to save the buffer before exiting Vim. Often this text is not needed. And it would be helpful to exit Vim without habitually typing :q!  The problem is that if you accidentally type :q! in another context, you can lose all your work. &#xA;&#xA;You can add a line to vimrc so that you can exit with :q after reading from stdin. This saves you from typing +&#34;set nomodified&#34; at the command line. &#xA;&#xA;``` vimrc&#xA;&#34; Don&#39;t set &#39;modified&#39; when reading from stdin&#xA;au StdinReadPost * set nomodified&#xA;```&#xA;&#xA;## References &#xA;&#xA;=&gt; https://wiki.archlinux.org/title/Samba    Samba | ArchWiki&#xA;=&gt; https://git.samba.org/samba.git/?p=samba.git;a=blob_plain;f=examples/smb.conf.default;hb=HEAD    Sample smb.conf&#xA;=&gt; https://man.archlinux.org/man/smb.conf.5    smb.conf | Arch Manual Pages&#xA;=&gt; https://www.samba.org/samba/docs/current/man-html/vfs_fruit.8.html    vfs_fruit Manual Page (Apple compatibility parameters)&#xA;=&gt; https://www.gnu.org/software/coreutils/manual/html_node/Symbolic-Modes.html    Explanation of chmod Symbolic Modes&#xA;=&gt; https://en.wikipedia.org/wiki/Umask    umask | Wikipedia&#xA;=&gt; https://gitlab.com/apparmor/apparmor/-/wikis/QuickProfileLanguage#file-rules    File Permissions | AppArmor GitLab&#xA;=&gt; https://man.archlinux.org/man/systemd.service.5    systemd.service | Arch Manual Pages&#xA;=&gt; https://man.archlinux.org/man/smbd.8    smbd | Arch Manual Pages&#xA;=&gt; https://vimhelp.org/starting.txt.html#--    stdin Configuration Option | starting.txt | Vim Online Help&#xA;&#xA;&#xA;## Changes&#xA;&#xA;* Added AppArmor instructions. &#xA;* Cleaned up steps for iPad Files app. &#xA;* Removed references to smbclient -L localhost. This no longer works for me. &#xA;* Added Format-Table to one-liner. &#xA;* Updated advice on Files app. &#xA;* Updated logging sections. &#xA;* Added Note on Vim. &#xA;&#xA;Created: Monday, May 2, 2022&#xA;Updated: Thursday, March 23, 2023&#xA;&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-05-02-install-samba.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Linux Shortcut Specification</title>

<updated>2022-04-28T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-04-28:/gemlog/2022-04-28-launcher-specification.gmi</id>

<content type="text/plain"># Linux Shortcut Specification&#xA;&#xA;If you edit a desktop launcher or shortcut on Linux, you might see a command like this: &#xA;&#xA;``` text&#xA;/usr/lib/firefox/firefox %u&#xA;&#xA;```&#xA;&#xA;The first part is a path to the Firefox executable. This is the application that runs. And if pasted into a terminal, that path would start Firefox on its own. &#xA;&#xA;The second part is specific to launchers. It is part of the Desktop Entry Specification. Specifically, these are fields codes for the Exec key. &#xA;&#xA;For example, %u represents a single URL which makes sense since Firefox might be receiving a URL from the desktop environment while launching. This placeholder in the launcher represents the URL. &#xA;&#xA;So, for example, if I wanted to add a parameter to the launcher, I would add it before the URL. Typically, the file or URL is provided last. &#xA;&#xA;``` text &#xA;/usr/bin/vivaldi-stable --disable-gpu %U&#xA;&#xA;```&#xA;&#xA;You can find a link to the field codes below. &#xA;&#xA;## References &#xA;&#xA;=&gt; https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables    Exec Key | Desktop Entry Specification&#xA;&#xA;Created: Thursday, April 28, 2022&#xA;Updated: Thursday, April 28, 2022&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-04-28-launcher-specification.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>GitHub Docs</title>

<updated>2022-04-28T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-04-28:/gemlog/2022-04-28-github-docs.gmi</id>

<content type="text/plain"># GitHub Docs&#xA;&#xA;## Search Issues&#xA;&#xA;In this example, I am searching for issues which contain the word &#34;snap&#34;, are currently open, and do not have the Distribution-Request label attached. &#xA;&#xA;``` text&#xA;snap is:open -label:Distribution-Request &#xA;&#xA;```&#xA;&#xA;=&gt; https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests    Searching issues and pull requests | GitHub Docs&#xA;&#xA;Created: Wednesday, April 27, 2022&#xA;Updated: Wednesday, April 27, 2022&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-04-28-github-docs.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Check If You Are Using X11 or Wayland</title>

<updated>2022-04-27T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-04-27:/gemlog/2022-04-27-x11-wayland.gmi</id>

<content type="text/plain"># Check If You Are Using X11 or Wayland&#xA;&#xA;If you are using Linux but are not sure which display server you are using (X11; Wayland), you can check your environment variables. &#xA;&#xA;* Wayland uses WAYLAND_DISPLAY.&#xA;* X11 uses DISPLAY. &#xA;&#xA;I don&#39;t think these variables are mutually exclusive. And it is worth checking for both. &#xA;&#xA;If the WAYLAND_DISPLAY environment variable is present then the system is using Wayland. &#xA;&#xA;I don&#39;t believe it is relevant what the values are. We&#39;re only interested if the variables are there or not. &#xA;&#xA;In this example, DISPLAY is present. So, I am using X11. &#xA;&#xA;``` PowerShell&#xA;Get-ChildItem Env: | Where-Object { $_.Name -match &#34;(DISPLAY|WAYLAND_DISPLAY)&#34; }&#xA;&#xA;Name                           Value&#xA;----                           -----&#xA;DISPLAY                        :0.0&#xA;&#xA;```&#xA;&#xA;You will find other advice online relating to loginctl or $XDG_SESSION_TYPE. But there are problems with those answers. And checking the environment variables above avoids those problems. &#xA;&#xA;## References &#xA;&#xA;=&gt; https://stackoverflow.com/questions/45536141/how-i-can-find-out-if-a-linux-system-uses-wayland-or-x11    How I can find out if a Linux system uses Wayland or X11? | Stack Overflow&#xA;=&gt; https://en.wikipedia.org/wiki/Windowing_system    Windowing system | Wikipedia&#xA;=&gt; https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables    about Environment Variables | Microsoft Docs&#xA;&#xA;Created: Wednesday, April 27, 2022&#xA;Updated: Wednesday, April 27, 2022&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-04-27-x11-wayland.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Manjaro Support</title>

<updated>2022-04-26T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-04-26:/gemlog/2022-04-26-manjaro-support.gmi</id>

<content type="text/plain"># Manjaro Support&#xA;&#xA;Here are some helpful links for troubleshooting Manjaro. &#xA;&#xA;## Version Information&#xA;&#xA;``` Terminal&#xA;# Manjaro Version &#xA;cat /etc/lsb-release&#xA;&#xA;# System Information&#xA;inxi --admin --verbosity=7 --filter --width&#xA;&#xA;```&#xA;&#xA;=&gt; https://forum.manjaro.org/t/howto-provide-system-information/874    [HowTo] Provide System Information - Contributions / Tutorials - Manjaro Linux Forum&#xA;&#xA;## GitLab&#xA;&#xA;Search the Manjaro GitLab for more details about package builds. &#xA;&#xA;=&gt; https://gitlab.manjaro.org/explore/groups    Manjaro GitLab&#xA;&#xA;Created: Tuesday, April 26, 2022&#xA;Updated: Tuesday, April 26, 2022&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-04-26-manjaro-support.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Firefox Settings</title>

<updated>2022-04-26T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-04-26:/gemlog/2022-04-26-firefox-settings.gmi</id>

<content type="text/plain"># Firefox Settings&#xA;&#xA;Here are settings and extensions that I use in Firefox. &#xA;&#xA;&#xA;## about:preferences&#xA;&#xA;* Check the box for &#39;Tell websites not to sell or share my data&#39;&#xA;&#xA;Above is the native Global Privacy Control (GPC) setting in Firefox version 120 and later. &#xA;&#xA;* Check the box for &#39;Send websites a “Do Not Track” request&#39;&#xA;&#xA;Here, make sure to include the smart quotes or just search for Do Not Track. &#xA;&#xA;* Enable HTTPS-Only Mode in all windows&#xA;* Enable DNS over HTTPS&#xA;* Address Bar -- Firefox Suggest &gt; Shortcuts: Uncheck&#xA;&#xA;&#xA;## about:config&#xA;&#xA;I recently noticed that you can use an asterisk * wildcard to search for keys in about:config. For example, zoom*spec will show the browser.zoom.siteSpecific preference. &#xA;&#xA;* browser.tabs.closeWindowWithLastTab: false&#xA;* browser.tabs.insertRelatedAfterCurrent: false &#xA;* browser.search.openintab: true&#xA;* browser.tabs.loadBookmarksInTabs: true&#xA;* browser.enable_automatic_image_resizing: false&#xA;&#xA;When you load a large image in a new tab, Firefox will resize the image to fit the window. &#xA;&#xA;automatic_image_resizing allows you to load or refresh a stand-alone image without having to click to zoom. &#xA;&#xA;* browser.zoom.siteSpecific: false&#xA;&#xA;This setting allows you to zoom (Ctrl + Mouse Wheel) a specific tab without affecting other tabs or the whole website. I found this useful on Gmail. I can open an e-mail in a new window and zoom the message there without affecting the rest of Gmail. &#xA;&#xA;* browser.sessionstore.resume_from_crash: false&#xA;&#xA;This setting will not attempt to restore your tabs after a crash. I use some of my Firefox profiles to retrieve up-to-date information, e.g., the weather forecast. And, these profiles will have a set of custom home pages. If I leave the default setting and restore tabs after a crash then I get stale data. Instead, it is preferable to simply launch the home pages to retrieve fresh data after a crash. Changing this setting to False accomplishes that. &#xA;&#xA;&#xA;## Extensions&#xA;&#xA;=&gt; https://addons.mozilla.org/firefox/addon/multi-account-containers/    Firefox Multi-Account Containers&#xA;=&gt; https://addons.mozilla.org/firefox/addon/noscript/    NoScript&#xA;=&gt; https://addons.mozilla.org/firefox/addon/swift-selection-search/    Swift Selection Search&#xA;=&gt; https://addons.mozilla.org/firefox/addon/greasemonkey/    Greasemonkey&#xA;=&gt; https://addons.mozilla.org/firefox/addon/privacy-badger17/    Privacy Badger&#xA;=&gt; https://addons.mozilla.org/firefox/addon/duckduckgo-for-firefox/    DuckDuckGo Privacy Essentials&#xA;&#xA;&#xA;## Template Profile &#xA;&#xA;I create many Firefox profiles. And, while it is nice to have these steps enumerated, the process of creating a Firefox profile is not as easy as it could be. &#xA;&#xA;To that end, I have a new process where I create a new Firefox profile, copy my default settings from a template, and then customize the new profile. I am following the instructions for backing up and restoring Firefox profiles. The instructions are linked below. In this way, I have most of the settings saved in the template. And then all I have to do for the new profile is add a home page and log in. I no longer have to go over the list above and change every setting. &#xA;&#xA;Make sure to check your search engine after customizing. I&#39;ve found Firefox likes to reset the search to Google. &#xA;&#xA;&#xA;## Bookmarklets &#xA;&#xA;A bookmarklet is a small piece of JavaScript that can be saved in the Address field of a bookmark. Then, when the bookmark is clicked, the JavaScript is executed. &#xA;&#xA;The bookmarklets below generate a formatted link for the current page. Click on the bookmarklet and copy the link from the prompt. &#xA;&#xA;These bookmarklets don&#39;t work on every Web site. I believe the issue is some sites restrict the JavaScript URI via their Content Security Policy. &#xA;&#xA;&#xA;### Gemini Link Bookmarklet&#xA;&#xA;``` JavaScript&#xA;javascript:(function(){&#xA;  var myText = &#39;=&gt; &#39; + document.URL + &#39;    &#39; + document.title;&#xA;  prompt(&#34;Gemini Link&#34;, myText); &#xA;})();&#xA;&#xA;```&#xA;&#xA;&#xA;### Markdown Link Bookmarklet&#xA;&#xA;``` JavaScript&#xA;javascript:(function(){&#xA;  var title = document.title; &#xA;  var url = document.URL; &#xA;  title = title.replace(/\u005b/g, &#34;\\[&#34;);&#xA;  title = title.replace(/\u005d/g, &#34;\\]&#34;);&#xA;  var myLink = &#34;[&#34; + title + &#34;](&#34; + url + &#34;)&#34;; &#xA;  prompt(&#34;Markdown Link&#34;, myLink);&#xA;})();&#xA;&#xA;```&#xA;&#xA;&#xA;## Firefox Scrollbar&#xA;&#xA;I find it difficult to use the scrollbar in Firefox. It is too small. And, I miss having the arrow buttons which allowed me to scroll continuously. &#xA;&#xA;Below, I suggest some changes to make scrolling easier on the desktop. &#xA;&#xA;&#xA;### about:preferences &#xA;&#xA;In Firefox settings, I suggest disabling auto-hide. &#xA;&#xA;* Check the box for &#39;Always show scrollbars&#39;&#xA;&#xA;&#xA;### about:config&#xA;&#xA;In about:config, the following two settings widen the scrollbar. &#xA;&#xA;After navigating to the about:config URL in Firefox, search for each setting and modify its value. Below, the name of the setting is to the left of the colon and my suggested value is to the right. &#xA;&#xA;* widget.non-native-theme.scrollbar.size.override: 30 &#xA;* widget.non-native-theme.scrollbar.style: 4&#xA;&#xA;Also, these advanced preferences have the advantage of working in the Reader View and while viewing PDFs. Customizations made by add-ons won&#39;t work on privileged pages. &#xA;&#xA;&#xA;### Extensions &#xA;&#xA;=&gt; https://addons.mozilla.org/firefox/addon/scroll_anywhere/    ScrollAnywhere&#xA;&#xA;You have the option of using an add-on to modify the scrolling behavior. &#xA;&#xA;While I prefer scrollbar arrow buttons, those are not available in Firefox. And, the specific issue I am trying to address are &#34;infinite scroll&#34; pages like some search results and news articles. This is where the page keeps loading new content at the bottom and where an arrow button would be useful. &#xA;&#xA;Right now, I&#39;m trying out the ScrollAnywhere Firefox add-on. I have the multiplier set to 3.0. And this allows me to scroll to the bottom of an article in one gesture which solves my problem. &#xA;&#xA;Note that middle clicking to paste continues to work normally on Linux. And the option to enable middle clicking only enables the clipboard permission for the add-on: resulting in a loss of privacy. &#xA;&#xA;&#xA;## Bookmark Tags&#xA;&#xA;I&#39;m new to bookmark tags. And, I want to mention a few problems I&#39;ve been having. &#xA;&#xA;Tags allow you to add extra information to bookmarks so that you can find bookmarks by searching with a tag name. You can type the name of a tag into the address bar, and bookmarks associated with that tag will show in a drop-down list. If you search for multiple tags separated by commas then the results will match all the tags. &#xA;&#xA;However, intuitively, I expect to be able to type tags in any order and to get the same results. For example, &#34;University, Books I Read&#34; makes more sense to me than &#34;Books I Read, University&#34;. And, if I type the tags in either order then I should get the same results. But, that is not what happens. &#xA;&#xA;Instead, only &#34;Books I Read, University&#34; works because that lists the tags in alphabetical order. &#34;University, Books I Read&#34; (reversed order) fails with no obvious problem. And that&#39;s confusing. &#xA;&#xA;The only way to fix the issue is to search for tags in alphabetical order. So, you always have to search for &#34;apple, zebra&#34; and never the other way around. &#xA;&#xA;Note that if you open the bookmarks Library, there is a Tags column that shows tag names listed in the proper order. Sometimes I look there for an example. For example, I might click on the University tag on the left and then find a bookmark which also has the Books I Read tag. In the Tags column, that will be displayed as &#34;Books I Read, University&#34;. And I can type that example into the Library search field to find all matching bookmarks. &#xA;&#xA;Update: &#xA;&#xA;I&#39;ve noticed that searching for bookmark tags without using commas lets you type the tags in any order. For example, if I search for &#34;University Books I Read&#34; (no comma separating the tag names) then that works. &#xA;&#xA;So, what works consistently is listing tags in alphabetical order and separating them with commas, or typing the full tag names in any order without using commas. And, the only time you have to use commas is when you&#39;re adding tags to bookmarks by manually typing them in. &#xA;&#xA;&#xA;### Cached Tags Issue&#xA;&#xA;There was also another problem. &#xA;&#xA;If there is a tag called &#34;Due Books&#34; and you search for &#34;due&#34; then that works: You are shown bookmarks which match the tag. &#xA;&#xA;In connection with this, if I remove a tag from a bookmark then I don&#39;t want that bookmark to show in future searches for the tag. For example, if I have &#34;Tadpole&#34; and &#34;Frog&#34; tags and I remove the &#34;Tadpole&#34; tag from a bookmark, then searching for the &#34;Tadpole&#34; tag should only show bookmarks that currently have that tag; and the old bookmark should no longer match. &#xA;&#xA;But the problem I noticed was that if I remove the &#34;Due Books&#34; tag from a particular bookmark and later search for &#34;due&#34; then bookmarks that used to have that tag will still show. It looks like tags are cached by the address bar. &#xA;&#xA;I can&#39;t fully account for this behavior. &#xA;&#xA;But, I was able to solve my problem. &#xA;&#xA;The solution is to search using the full name of the tag. For example, if I search for &#34;due&#34; then I see old bookmarks. But, if I search for the full name &#34;Due Books&#34; then the list is properly filtered and only bookmarks that currently have that tag are shown. &#xA;&#xA;It does not look like the tag search is case sensitive. So, &#34;due books&#34; also works properly. &#xA;&#xA;&#xA;### Filter Address Bar Suggestions with Special Characters&#xA;&#xA;You can further filter your results by using the  +  address bar special character. For example: &#xA;&#xA;&gt; + due books&#xA;&gt; &#xA;&#xA;will only show bookmarks. Whereas, &#xA;&#xA;&gt; due books&#xA;&gt; &#xA;&#xA;might include other suggestions, for example, from your browser history or open tabs. &#xA;&#xA;Here, the + at the beginning of the keywords tells Firefox to limit suggestions to only bookmarks that you&#39;ve tagged. &#xA;&#xA;Here, I&#39;ve demonstrated using a special character at the beginning of the keywords. But, Firefox also lets you add a special character to the end of the keywords. Both work. And you can use either form. &#xA;&#xA;Just remember to use a space to separate your special character from the other keywords. &#34;+due books&#34; is different from &#34;+ due books&#34; (added space). &#xA;&#xA;&#xA;### Bookmarks in a Tab&#xA;&#xA;While troubleshooting my tagging issues, one solution I tried was to load the Firefox Library in a browser tab. &#xA;&#xA;To be clear, searching for tags in the proper order works in the address bar, sidebar, and Library. But, loading the Library in a tab is something useful which I wanted to share. &#xA;&#xA;If you want to open the Library in browser tab then open a new tab and navigate to this address: &#xA;&#xA;&gt; chrome://browser/content/places/places.xhtml &#xA;&gt; &#xA;&#xA;That will load the same view as if you opened the Library window but instead the view is shown in a browser tab. This saves you from opening another window. This also gives you access to a list of tags in the folder tree on the left. And you can view the Tags column which provides additional useful information. These are advantages over the address bar and sidebar. &#xA;&#xA;Note: If you have a problem copying and pasting this address, you might have inadvertently copied the leading &#34;&gt;&#34; from the Gemini markup on this page. If you look closely, that manifests as an &#34;Actions&#34; tag or balloon in the Firefox address bar. You can either click the &#39;x&#39; to close the Actions tag or jump to the beginning of the address and backspace over the tag / implicit &#34;&gt;&#34;. Quick Actions is a preview feature in Firefox. &#xA;&#xA;&#xA;## References &#xA;&#xA;=&gt; https://support.mozilla.org/kb/back-and-restore-information-firefox-profiles#w_restoring-to-a-different-location      Back up and restore information in Firefox profiles | Firefox Help&#xA;=&gt; https://support.mozilla.org/kb/global-privacy-control      Global Privacy Control | Firefox Help&#xA;=&gt; https://www.reddit.com/r/firefox/comments/ujo1xy/how_to_increase_firefox_100_scrollbar_width/    How to increase Firefox scrollbar width? | Reddit&#xA;=&gt; https://www.makeuseof.com/change-firefox-scrollbar-style/    Firefox Scrollbar Styles | Make Use Of&#xA;=&gt; https://support.mozilla.org/questions/1270002    This Thunderbird thread mentions the zoom preference in Firefox | Thunderbird Support &#xA;=&gt; https://support.mozilla.org/kb/categorizing-bookmarks-make-them-easy-to-find    Bookmark Tags | Firefox Help&#xA;=&gt; https://support.mozilla.org/questions/1282696    How to Show the Bookmark Library in a Browser Tab | Mozilla Support&#xA;=&gt; https://support.mozilla.org/kb/address-bar-autocomplete-firefox#w_changing-results-on-the-fly    Special Characters that Filter Address Bar Suggestions e.g. &#34;+&#34; | Firefox Help&#xA;=&gt; http://kb.mozillazine.org/Session_Restore    resume_from_crash Preference | MozillaZine&#xA;&#xA;&#xA;## Changes &#xA;&#xA;* Added preference to discard session after a crash. &#xA;* Added note about searching for bookmark tags without using commas. &#xA;* Added tag discussion and URL for loading the Library in a browser tab. &#xA;* Added preference for per-tab zooming. &#xA;* Added scrollbar information. &#xA;* Updated Do Not Track setting name. &#xA;* Removed OptMeowt add-on in favor of native setting.&#xA;* Added bookmarklets.&#xA;* Added information about using a template profile. &#xA;* Changed Heading to about:preferences&#xA;* Removed New Tab Override and Tab Reloader. &#xA;* Added Tab Reloader. &#xA;* Added preference to disable image resizing. &#xA;* Added New Tab Override. &#xA;* Added Privacy Badger. &#xA;* Added DuckDuckGo Privacy Essentials. &#xA;* Added NoScript. &#xA;* Added Swift Selection Search. &#xA;* Added Greasemonkey. &#xA;* Open bookmarks in a new tab. &#xA;* Added open search results in a new tab. &#xA;&#xA;Created: Tuesday, April 26, 2022 &#xA;Updated: Wednesday, July 24, 2024 &#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-04-26-firefox-settings.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Disable sudo Caching</title>

<updated>2022-04-26T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-04-26:/gemlog/2022-04-26-disable-sudo-caching.gmi</id>

<content type="text/plain"># Disable sudo Caching&#xA;&#xA;I don&#39;t like to have sudo cache my credentials. The -k parameter will prevent sudo from caching your credentials. &#xA;&#xA;``` Terminal&#xA;sudo -k #command&#xA;&#xA;```&#xA;&#xA;Created: Tuesday, April 26, 2022&#xA;Updated: Tuesday, April 26, 2022&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-04-26-disable-sudo-caching.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>RIPE Atlas</title>

<updated>2022-04-25T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-04-25:/gemlog/2022-04-25-ripe-atlas.gmi</id>

<content type="text/plain"># RIPE Atlas&#xA;&#xA;There is a network of probes on the Internet which are available for research. One way you can use this is to check if a particular region is having trouble connecting to your cloud service. &#xA;&#xA;=&gt; https://atlas.ripe.net/about/    What is RIPE Atlas? | RIPE Atlas&#xA;&#xA;Created: Monday, April 25, 2022&#xA;Updated: Monday, April 25, 2022&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-04-25-ripe-atlas.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

<title>Fix the Get-ChildItem Output in a Smaller Shell</title>

<updated>2022-04-21T00:00:00Z</updated>

<id>tag:pwshnotes.flounder.online,2022-04-21:/gemlog/2022-04-21-format-ps1xml.gmi</id>

<content type="text/plain"># Fix the Get-ChildItem Output in a Smaller Shell&#xA;&#xA;I am using PowerShell on Linux. And I prefer a shell that is 80 characters wide instead of the 120 characters typical for PowerShell. &#xA;&#xA;One problem I have is that, when I use Get-ChildItem, the output is truncated because of the smaller window. For example, there is no Name column in the output below: &#xA;&#xA;``` PowerShell&#xA;# Output from a Linux terminal that is 80 characters wide. &#xA;# There is no Name column. &#xA;&#xA;Get-ChildItem&#xA;&#xA;    Directory: /data/Michael&#xA;&#xA;UnixMode   User             Group                 LastWriteTime           Size&#xA;--------   ----             -----                 -------------           ----&#xA;drwxr-xr-x michael          michael              4/9/2022 04:20           4096&#xA;drwxr-xr-x michael          michael             4/12/2022 04:56           4096&#xA;drwxr-xr-x michael          michael             4/20/2022 05:40           4096&#xA;...&#xA;&#xA;```&#xA;&#xA;This can be temporarily fixed by piping to Format-Table -AutoSize: &#xA;&#xA;``` PowerShell&#xA;# Use Format-Table -AutoSize. &#xA;# This requires a lot of extra typing. &#xA;&#xA;Get-ChildItem | Format-Table -AutoSize&#xA;&#xA;    Directory: /data/Michael&#xA;&#xA;UnixMode   User    Group     LastWriteTime Size Name&#xA;--------   ----    -----     ------------- ---- ----&#xA;drwxr-xr-x michael michael  4/9/2022 04:20 4096 Background Images&#xA;drwxr-xr-x michael michael 4/12/2022 04:56 4096 Bookmarklets&#xA;drwxr-xr-x michael michael 4/20/2022 05:40 4096 Drafts&#xA;...&#xA;&#xA;```&#xA;&#xA;But the permanent solution is to use a Format.ps1xml file. This will change the default output when Get-ChildItem is used alone. &#xA;&#xA;``` PowerShell&#xA;# Install a custom Format.ps1xml file. &#xA;# Using Get-ChildItem alone produces autosized output. &#xA;&#xA;Get-ChildItem&#xA;&#xA;   Directory: /data/Michael&#xA;&#xA;UnixMode   User    Group     LastWriteTime Size Name&#xA;--------   ----    -----     ------------- ---- ----&#xA;drwxr-xr-x michael michael  4/9/2022 04:20 4096 Background Images&#xA;drwxr-xr-x michael michael 4/12/2022 04:56 4096 Bookmarklets&#xA;drwxr-xr-x michael michael 4/20/2022 05:40 4096 Drafts&#xA;...&#xA;&#xA;```&#xA;&#xA;## My Format.ps1xml File&#xA;&#xA;Below is the formatting file I used to autosize the Get-ChildItem output. &#xA;&#xA;File Name: &#xA;&#xA;&gt; ~/PowerShell Formatting/FileSystem.Format.ps1xml&#xA;&#xA;File Contents: &#xA;&#xA;``` XML&#xA;&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;&#xA;&lt;Configuration&gt;&#xA;  &lt;ViewDefinitions&gt;&#xA;    &lt;View&gt;&#xA;      &lt;Name&gt;LinuxFileSystem&lt;/Name&gt;&#xA;      &lt;ViewSelectedBy&gt;&#xA;        &lt;TypeName&gt;System.IO.DirectoryInfo&lt;/TypeName&gt;&#xA;        &lt;TypeName&gt;System.IO.FileInfo&lt;/TypeName&gt;&#xA;      &lt;/ViewSelectedBy&gt;&#xA;      &lt;GroupBy&gt;&#xA;        &lt;Label&gt;Directory&lt;/Label&gt;&#xA;        &lt;ScriptBlock&gt;$_.PSParentPath.Replace(&#39;Microsoft.PowerShell.Core\FileSystem::&#39;,&#39;&#39;)&lt;/ScriptBlock&gt;&#xA;      &lt;/GroupBy&gt;&#xA;      &lt;TableControl&gt;&#xA;        &lt;TableHeaders&gt;&#xA;          &lt;TableColumnHeader&gt;&#xA;            &lt;Label&gt;UnixMode&lt;/Label&gt;&#xA;            &lt;Alignment&gt;Left&lt;/Alignment&gt;&#xA;          &lt;/TableColumnHeader&gt;&#xA;          &lt;TableColumnHeader&gt;&#xA;            &lt;Label&gt;User&lt;/Label&gt;&#xA;            &lt;Alignment&gt;Left&lt;/Alignment&gt;&#xA;          &lt;/TableColumnHeader&gt;&#xA;          &lt;TableColumnHeader&gt;&#xA;            &lt;Label&gt;Group&lt;/Label&gt;&#xA;            &lt;Alignment&gt;Left&lt;/Alignment&gt;&#xA;          &lt;/TableColumnHeader&gt;&#xA;          &lt;TableColumnHeader&gt;&#xA;            &lt;Label&gt;LastWriteTime&lt;/Label&gt;&#xA;            &lt;Alignment&gt;Right&lt;/Alignment&gt;&#xA;          &lt;/TableColumnHeader&gt;&#xA;          &lt;TableColumnHeader&gt;&#xA;            &lt;Label&gt;Size&lt;/Label&gt;&#xA;            &lt;Alignment&gt;Right&lt;/Alignment&gt;&#xA;          &lt;/TableColumnHeader&gt;&#xA;          &lt;TableColumnHeader&gt;&#xA;            &lt;Label&gt;Name&lt;/Label&gt;&#xA;            &lt;Alignment&gt;Left&lt;/Alignment&gt;&#xA;          &lt;/TableColumnHeader&gt;&#xA;        &lt;/TableHeaders&gt;&#xA;        &lt;TableRowEntries&gt;&#xA;          &lt;TableRowEntry&gt;&#xA;            &lt;Wrap /&gt;&#xA;            &lt;TableColumnItems&gt;&#xA;              &lt;TableColumnItem&gt;&#xA;                &lt;PropertyName&gt;UnixMode&lt;/PropertyName&gt;&#xA;              &lt;/TableColumnItem&gt;&#xA;              &lt;TableColumnItem&gt;&#xA;                &lt;PropertyName&gt;User&lt;/PropertyName&gt;&#xA;              &lt;/TableColumnItem&gt;&#xA;              &lt;TableColumnItem&gt;&#xA;                &lt;PropertyName&gt;Group&lt;/PropertyName&gt;&#xA;              &lt;/TableColumnItem&gt;&#xA;              &lt;TableColumnItem&gt;&#xA;                &lt;ScriptBlock&gt;&#39;{0:d} {0:HH}:{0:mm}&#39; -f $_.LastWriteTime&lt;/ScriptBlock&gt;&#xA;              &lt;/TableColumnItem&gt;&#xA;              &lt;TableColumnItem&gt;&#xA;                &lt;PropertyName&gt;Size&lt;/PropertyName&gt;&#xA;              &lt;/TableColumnItem&gt;&#xA;              &lt;TableColumnItem&gt;&#xA;                &lt;PropertyName&gt;NameString&lt;/PropertyName&gt;&#xA;              &lt;/TableColumnItem&gt;&#xA;            &lt;/TableColumnItems&gt;&#xA;          &lt;/TableRowEntry&gt;&#xA;        &lt;/TableRowEntries&gt;&#xA;      &lt;/TableControl&gt;&#xA;    &lt;/View&gt;&#xA;  &lt;/ViewDefinitions&gt;&#xA;&lt;/Configuration&gt;&#xA;&#xA;```&#xA;&#xA;Once saved, the file will have to be imported into the current session. &#xA;&#xA;``` PowerShell&#xA;Update-FormatData -PrependPath &#34;~/PowerShell Formatting/FileSystem.Format.ps1xml&#34;&#xA;&#xA;```&#xA;&#xA;After importing, you can run Get-ChildItem to show the autosized output. &#xA;&#xA;``` PowerShell&#xA;Get-ChildItem &#xA;&#xA;   Directory: /data/Michael&#xA;&#xA;UnixMode   User    Group     LastWriteTime Size Name&#xA;--------   ----    -----     ------------- ---- ----&#xA;drwxr-xr-x michael michael  4/9/2022 04:20 4096 Background Images&#xA;drwxr-xr-x michael michael 4/12/2022 04:56 4096 Bookmarklets&#xA;drwxr-xr-x michael michael 4/20/2022 05:40 4096 Drafts&#xA;...&#xA;&#xA;```&#xA;&#xA;If you want to automatically apply these changes to every PowerShell session, save the command in your PowerShell profile. See the References section below for all my links including the about_Profiles article. &#xA;&#xA;## What Changes Did I Make? / Tutorial  &#xA;&#xA;I exported the default views relating to the Get-ChildItem cmdlet with the command below. And I used that as the basis for creating my Format.ps1xml file. &#xA;&#xA;``` PowerShell&#xA;Get-FormatData -PowerShellVersion $PSVersionTable.PSVersion -TypeName System.IO.DirectoryInfo | &#xA;  Export-FormatData -Path &#34;~/Desktop/Export.Format.ps1xml&#34; -IncludeScriptBlock&#xA;&#xA;```&#xA;&#xA;Note that if you already imported my customized Format.ps1xml, you can launch a new PowerShell session by using the -NoProfile parameter. This will allow you to get a fresh export.  &#xA;&#xA;``` PowerShell&#xA;pwsh -NoProfile&#xA;&#xA;  PowerShell 7.2.2&#xA;  Copyright (c) Microsoft Corporation.&#xA;  &#xA;  https://aka.ms/powershell&#xA;  Type &#39;help&#39; to get help.&#xA;&#xA;Get-FormatData -PowerShellVersion $PSVersionTable.PSVersion -TypeName System.IO.DirectoryInfo | &#xA;  Export-FormatData -Path &#34;~/Desktop/Export.Format.ps1xml&#34; -IncludeScriptBlock&#xA;&#xA;```&#xA;&#xA;After exporting the default views, I customized the file in the following ways. &#xA;&#xA;### Change View Name&#xA;&#xA;I changed the name of my view from &#34;childrenWithUnixStat&#34; to &#34;LinuxFileSystem&#34;. &#xA;&#xA;``` XML&#xA;      &lt;!-- Before --&gt;&#xA;      &lt;Name&gt;childrenWithUnixStat&lt;/Name&gt;&#xA;&#xA;      &lt;!-- After --&gt;&#xA;      &lt;Name&gt;LinuxFileSystem&lt;/Name&gt;&#xA;&#xA;```&#xA;&#xA;### Add a Reference to the FileInfo Type&#xA;&#xA;The export only refers to the System.IO.DirectoryInfo type. But the Get-ChildItem cmdlet outputs DirectoryInfo and FileInfo types. Including only the DirectoryInfo type in my Format.ps1xml did not work. So, I added the FileInfo type to my Formatl.ps1xml file. &#xA;&#xA;``` XML&#xA;      &lt;!-- Before --&gt;&#xA;      &lt;ViewSelectedBy&gt;&#xA;        &lt;TypeName&gt;System.IO.DirectoryInfo&lt;/TypeName&gt;&#xA;      &lt;/ViewSelectedBy&gt;&#xA;&#xA;      &lt;!-- After --&gt;&#xA;      &lt;ViewSelectedBy&gt;&#xA;        &lt;TypeName&gt;System.IO.DirectoryInfo&lt;/TypeName&gt;&#xA;        &lt;TypeName&gt;System.IO.FileInfo&lt;/TypeName&gt;&#xA;      &lt;/ViewSelectedBy&gt;&#xA;&#xA;```&#xA;&#xA;### Delete Other Views&#xA;&#xA;There are multiple views in the exported file. I deleted everything below the top view. &#xA;&#xA;Here is what that looks like at a high level: &#xA;&#xA;``` XML&#xA;      &lt;!-- Before --&gt;&#xA;&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;&#xA;&lt;Configuration&gt;&#xA;  &lt;ViewDefinitions&gt;&#xA;    &lt;View&gt;&#xA;      &lt;Name&gt;LinuxFileSystem&lt;/Name&gt;&#xA;      &lt;!-- ... --&gt;&#xA;    &lt;/View&gt;&#xA;    &lt;View&gt;&#xA;      &lt;Name&gt;children&lt;/Name&gt;&#xA;      &lt;!-- ... --&gt;&#xA;    &lt;/View&gt;&#xA;    &lt;View&gt;&#xA;      &lt;Name&gt;childrenWithHardlink&lt;/Name&gt;&#xA;      &lt;!-- ... --&gt;&#xA;    &lt;/View&gt;&#xA;    &lt;View&gt;&#xA;      &lt;Name&gt;children&lt;/Name&gt;&#xA;      &lt;!-- ... --&gt;&#xA;    &lt;/View&gt;&#xA;    &lt;View&gt;&#xA;      &lt;Name&gt;children&lt;/Name&gt;&#xA;      &lt;!-- ... --&gt;&#xA;    &lt;/View&gt;&#xA;  &lt;/ViewDefinitions&gt;&#xA;&lt;/Configuration&gt;&#xA;&#xA;      &lt;!-- After --&gt;&#xA;&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;&#xA;&lt;Configuration&gt;&#xA;  &lt;ViewDefinitions&gt;&#xA;    &lt;View&gt;&#xA;      &lt;Name&gt;LinuxFileSystem&lt;/Name&gt;&#xA;      &lt;!-- ... --&gt;&#xA;    &lt;/View&gt;&#xA;  &lt;/ViewDefinitions&gt;&#xA;&lt;/Configuration&gt;&#xA;&#xA;```&#xA;&#xA;### Remove &lt;Width/&gt; Tags&#xA;&#xA;I removed all the &lt;Width/&gt; XML tags from the view. Below is one example. Remember to do this for every &lt;TableColumnHeader/&gt;.  &#xA;&#xA;``` XML&#xA;      &lt;!-- Before --&gt;&#xA;          &lt;TableColumnHeader&gt;&#xA;            &lt;Label&gt;UnixMode&lt;/Label&gt;&#xA;            &lt;Width&gt;10&lt;/Width&gt;&#xA;            &lt;Alignment&gt;Left&lt;/Alignment&gt;&#xA;          &lt;/TableColumnHeader&gt;&#xA;&#xA;      &lt;!-- After --&gt;&#xA;          &lt;TableColumnHeader&gt;&#xA;            &lt;Label&gt;UnixMode&lt;/Label&gt;&#xA;            &lt;Alignment&gt;Left&lt;/Alignment&gt;&#xA;          &lt;/TableColumnHeader&gt;&#xA;&#xA;```&#xA;&#xA;If you check the XML schema (Format.xsd), you will see a comment that says the &lt;Width/&gt; tag is required. But note that one of the default &lt;TableColumnHeader/&gt; tags omits its child &lt;Width/&gt; tag. And removing the &lt;Width/&gt; tags did not cause any problems in my testing. &#xA;&#xA;### Update &lt;GroupBy/&gt; Tag&#xA;&#xA;I updated the &lt;GroupBy/&gt; tag to match the stock Get-ChildItem output. &#xA;&#xA;Normally, Get-ChildItem groups items by directory and uses this output format: &#xA;&#xA;``` PowerShell&#xA;&gt; Get-ChildItem&#xA;&#xA;    Directory: /data/Michael&#xA;...&#xA;&#xA;```&#xA;&#xA;But the export uses &lt;PropertyName&gt;PSParentPath&lt;/PropertyName&gt; which produces this output: &#xA;&#xA;``` PowerShell&#xA;&gt; Get-ChildItem&#xA;&#xA;   PSParentPath: Microsoft.PowerShell.Core\FileSystem::/data/Michael&#xA;...&#xA;&#xA;```&#xA;&#xA;I was able to address this issue with the changes below. Namely, I explicitly set the label to &#34;Directory&#34;. And I used the .NET String method Replace(String, String) to strip off the provider. &#xA;&#xA;``` XML&#xA;      &lt;!-- Before --&gt;&#xA;      &lt;GroupBy&gt;&#xA;        &lt;PropertyName&gt;PSParentPath&lt;/PropertyName&gt;&#xA;      &lt;/GroupBy&gt;&#xA;&#xA;      &lt;!-- After --&gt;&#xA;      &lt;GroupBy&gt;&#xA;        &lt;Label&gt;Directory&lt;/Label&gt;&#xA;        &lt;ScriptBlock&gt;$_.PSParentPath.Replace(&#39;Microsoft.PowerShell.Core\FileSystem::&#39;,&#39;&#39;)&lt;/ScriptBlock&gt;&#xA;      &lt;/GroupBy&gt;&#xA;&#xA;```&#xA;&#xA;You can safely skip to the next section. &#xA;&#xA;Note I tried to use the Directory property which I found in some of my testing. But that property is only available on the FileInfo object and does not exist on the DirectoryInfo object. Remember that Get-ChildItem emits a mix of both types of objects. So, the formatting has to use a property common to both. By choosing the PSParentPath property and modifying the resulting string, I was able to get consistent behavior. &#xA;&#xA;Note that the customized label has three spaces in front of it versus the standard four. This might cause a problem if you are parsing the text output instead of consuming PowerShell objects. &#xA;&#xA;``` PowerShell&#xA;# Stock PowerShell produces a &#34;Directory:&#34; label with four leading spaces.&#xA;# Using the &lt;PropertyName/&gt; tag produces three leading spaces. &#xA;# Using &lt;Label/&gt; also produces three spaces. &#xA;&#xA;    Directory: /data/Michael&#xA;   PSParentPath: Microsoft.PowerShell.Core\FileSystem::/data/Michael&#xA;   Directory: /data/Michael&#xA;&#xA;```&#xA;&#xA;If you add a leading space to the tag value, that will be reproduced in the shell. So, you can remove this discrepancy. &#xA;&#xA;``` PowerShell&#xA;# &lt;Label&gt;Directory&lt;/Label&gt;   versus&#xA;# &lt;Label&gt; Directory&lt;/Label&gt;&#xA;&#xA;   Directory: /data/Michael&#xA;    Directory: /data/Michael&#xA;&#xA;```&#xA;&#xA;### Test Tutorial File &#xA;&#xA;Modifying &lt;GroupBy/&gt; is the last change I made to my Format.ps1xml file. &#xA;&#xA;If you have been following along and making edits to a clean export, try importing that file to see if Get-ChildItem is autosizing its output now. &#xA;&#xA;Remember to save your Format.ps1xml file before importing.  &#xA;&#xA;``` PowerShell&#xA;# Start a clean PowerShell session. &#xA;pwsh -NoProfile&#xA;&#xA;# Import the tutorial file. &#xA;Update-FormatData -PrependPath &#34;~/Desktop/Export.Format.ps1xml&#34; &#xA;&#xA;# Test Get-ChildItem. &#xA;Get-ChildItem &#xA;&#xA;   Directory: /home/michael&#xA;&#xA;UnixMode   User    Group      LastWriteTime Size Name&#xA;--------   ----    -----      ------------- ---- ----&#xA;drwxr-xr-x michael michael  4/21/2022 04:46 4096 Desktop&#xA;drwxr-xr-x michael michael 12/23/2021 07:14 4096 Documents&#xA;drwxr-xr-x michael michael  4/19/2022 11:58 4096 Downloads&#xA;...&#xA;&#xA;```&#xA;&#xA;## References &#xA;&#xA;=&gt; https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_format.ps1xml   about_Format.ps1xml | Microsoft Docs&#xA;=&gt; https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-formatdata    Get-FormatData | Microsoft Docs&#xA;=&gt; https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/export-formatdata    Export-FormatData | Microsoft Docs&#xA;=&gt; https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/update-formatdata    Update-FormatData | Microsoft Docs&#xA;=&gt; https://raw.githubusercontent.com/PowerShell/PowerShell/master/src/Schemas/Format.xsd    Format.xsd (Raw) | PowerShell | GitHub&#xA;=&gt; https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/format-table#examples    Examples | Format-Table | Microsoft Docs&#xA;=&gt; https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_providers    about_Providers | Microsoft Docs&#xA;=&gt; https://docs.microsoft.com/en-us/dotnet/api/system.string.replace#system-string-replace(system-string-system-string)    Replace(String, String) | String | Microsoft Docs&#xA;=&gt; https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles    about_Profiles | Microsoft Docs&#xA;=&gt; https://code.visualstudio.com/    Visual Studio Code&#xA;=&gt; https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml            RedHat XML Extension | Visual Studio Code Marketplace    &#xA;&#xA;Created: Thursday, April 21, 2022&#xA;Updated: Thursday, April 21, 2022&#xA;</content>

<link href="//pwshnotes.flounder.online/gemlog/2022-04-21-format-ps1xml.gmi" rel="alternate"></link>

<summary type="text/plain"></summary>

Proxy Information
Original URL
gemini://pwshnotes.flounder.online/gemlog/atom.xml
Status Code
Success (20)
Meta
application/atom+xml
Capsule Response Time
1454.664073 milliseconds
Gemini-to-HTML Time
11.17811 milliseconds

This content has been proxied by September (ba2dc).