RSSAmplifier

Blog

Pwshnotes's Gemlog

//pwshnotes.flounder.online/gemlogRSS feed ↗54 posts

Latest posts

Next Friday's Date

# Next Friday's Date I am not happy with KDE 6.5.0. And, so, as an openSUSE Tumbleweed user, I've switched to the included IceWM instead. I'm accustomed to seeing the calendar widget when I click on the clock in KDE. But, in IceWM, clicking there just opens a bigger clock application, which is very 90's. But, I'd like to know the date for next Friday. That's my goal. I am proficient in PowerShell.…

Scratch Buffers in Vim

# Scratch Buffers in Vim Vim has the concept of buffers which represent the contents of a file, or more abstractly, the text you are interacting with. This separation of concerns allows Vim windows (split screens), Vim buffers, and files written to disc--to be remixed at will. For example, one buffer might have multiple split screens which let you view different parts of the same file at the same…

Bookmarklet for Mastodon

# Bookmarklet for Mastodon I was a bit annoyed at using Mastodon on the web while logged out. Specifically, if you visit a user's web page, you naturally start at the top of the page. But, the most recent post will be below their profile information and below any pinned posts. So, you have to scroll before any new information shows. I tried looking for an HTML anchor that I could save to a…

How to Disable Autosuggestions in fish Shell

# How to Disable Autosuggestions in fish Shell If you use the command line then you might be familiar with the Command Prompt or PowerShell on Windows. On Mac, zsh is common. On Linux, it's Bash. fish shell is an alternative shell available on Windows, macOS, Linux, and BSD. Typically, shells use profiles (e.g., .bashrc) to manage persistent configuration changes. For example, if I want to…

PowerShell-Preview Version Number

# PowerShell-Preview Version Number When PowerShell starts, it prints its version number. And, the preview version of PowerShell prints this version: ``` PowerShell Startup PowerShell 7.6.0-preview.2-0-gf145f3985aa7d7b24829a16ad1262629f3079d05 ``` I recognize the commit checksum within the version string. For example, the release page for v7.6.0-preview.2 links to that commit: f145f39 The complete…

Demonstrate uname Options

# Demonstrate uname Options Personally, I never made a habit of using the uname command on Linux. uname is a basic utility which is primarily used to print the kernel version. But, there are other options available. I typically use the -a option which prints everything. But, today, I sat down and tried every option to see what they all did. Note that uname with no supplied option implies -s. To…

Change Virtual Console Font Size

# Change Virtual Console Font Size 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'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. The…

Soldering

# Soldering I'm terrible at soldering. And, I ruined two soldering iron tips on my small project this week. I did collect some useful information while researching. But, I don't have a complete set of advice that works. Here's what I learned so far. ## Heat Transfer A soldering iron is a tool for heat transfer. Much of the advice given about soldering technique relates to heat transfer. And,…

How to Clean a Flashlight Lens

# How to Clean a Flashlight Lens Here are the steps I follow to clean the glass lenses on my flashlights. ## Materials You should be able to find these materials in a drugstore or supermarket. * Lens cleaning spray. This is the same stuff you use to clean eyeglasses. Make sure it is "safe" for coated lenses. * Lens cloth. These are the small cloths which come with eyeglasses or professional…

Remove openSUSE Pattern

# Remove openSUSE Pattern I wanted to remove XFCE since I wasn't using it. Simply removing "xfce" at the command line only removed SuSE's "pattern" package: a placeholder that pulls in dependencies. Use --clean-deps to remove all the packages associated with a pattern. ``` PowerShell sudo zypper remove --clean-deps --type pattern xfce Reading installed packages... Resolving package dependencies...…

Wayland Video Playback

# Wayland Video Playback 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. I was recently watching RetroBytes' "The History of X11". And it suddenly occurred to me that the problem…

Working around suse.vimrc

# Working around suse.vimrc 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'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't clear how to disable it. I…

List Running Images

# List Running Images I wanted to generate a list of running processes. But, instead of getting 300 Firefox processes, this PowerShell one-liner lists each image uniquely. ``` PowerShell Get-Process | Select-Object -Property Name,Path | Sort-Object -Property Path -Unique Name Path ---- ---- (sd-pam) chrome_crashpad_handler /opt/vivaldi/chrome_crashpad_handler Vivaldi-Zygote…

KDE plasmashell High CPU Usage Work-around

# KDE plasmashell High CPU Usage Work-around I updated openSUSE today. And I can see my "plasmashell" 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. I tried logging on as a different user. And I did not have a problem. I'm assuming there is some KDE configuration problem specific to the affected user. After removing their…

Nation Books

# Nation Books 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's Bold Type Books imprint. My book is listed there. And Bold Type Books appears to be the successor to Nation Books. I'm leaving this breadcrumb to help…

USB Charging Standards

# USB Charging Standards I collect high quality flashlights (torches) as a hobby. And, as a result, I've been trying to make sense of the USB charging standards. What I found was confusing and, frankly, not standard. Here's what I found. ## USB The oldest voltage and amperage standard for USB is 5 volts and 500 milliamps or 0.5 amps. This is just meant to power a keyboard or mouse. And, it is not…

Updating macOS from the Terminal

# Updating macOS from the Terminal It is possible to update macOS from the Terminal. ## Simple Example ### Update All ``` zsh softwareupdate -i -a ``` ### Update One Use softwareupdate with the lowercase L option to list possible updates. Then, use the lowercase I option with the name of an update. Use quotes to escape spaces in the update name. ``` zsh softwareupdate -l * macOS Update One…

Web API Articles

# Web API Articles 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. Below are some articles that I found helpful while learning about APIs. ## HTTP Methods RESTful APIs are built on HTTP methods. It is important to understand what…

Fix Vivaldi Graphical Corruption after Linux Update

# Fix Vivaldi Graphical Corruption after Linux Update I updated openSUSE today. And, after launching the Vivaldi web browser, there was clear graphical corruption within the Vivaldi window immediately after launch. 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. The problem appears to be an…

Chrooting into BTRFS

# Chrooting into BTRFS I was trying to rescue my new Manjaro installation. But, I had never tried chrooting into a BTRFS volume before. 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…

Killing All Processes When Logging Out

# Killing All Processes When Logging Out 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'm sure the user logged out instead of switching users. It turns…

Eliminating PulseAudio Pops

# Eliminating PulseAudio Pops After a brief pause in sound playback, my speakers make a popping sound. My operating system is Manjaro Linux 22.0 "Sikaris". I believe the underlying cause is that the PulseAudio service puts my audio hardware to sleep. In principle, I would like to increase the timeout so that my sound card stays powered for longer periods after playing a sound. Unfortunately, I…

Cleaning Up an Old Kernel in Manjaro

# Cleaning Up an Old Kernel in Manjaro I was updating Manjaro and received the following errors: ``` Shell (11/23) Updating linux initcpios... ==> Building image from preset: /etc/mkinitcpio.d/linux515.preset: 'default' -> -k /boot/vmlinuz-5.15-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.15-x86_64.img ==> ERROR: specified kernel image does not exist: `/boot/vmlinuz-5.15-x86_64' ==>…

Update Proprietary Media Codec for Vivaldi on Manjaro

# Update Proprietary Media Codec for Vivaldi on Manjaro 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. On my system, hardware acceleration is provided by a proprietary Nvidia…

Disable PowerShell Predictions

# Disable PowerShell Predictions PowerShell IntelliSense is turned on by default starting in PowerShell v7.3.0. I find IntelliSense to be very distracting. To disable IntelliSense / predictions / suggestions, add the following lines to your profile: ``` PowerShell # Disable IntelliSense Set-PSReadLineOption -PredictionSource None ``` You can also type that at the command line to disable…

Vim Menu for Tab Completion

# Vim Menu for Tab Completion 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'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…

How To Downgrade The Manjaro Kernel

# How To Downgrade The Manjaro Kernel I am having a problem with my current kernel. I'd like to downgrade. And I prefer to use Manjaro's graphical tools. The basic process is to manually boot into the old kernel using GRUB, and then disable the newer kernel. ## Boot Older Kernel Before starting, make sure the old kernel is installed. * Open the Manjaro Settings Manager app. * Open the Kernel…

Git Pull Before Checkout

# Git Pull Before Checkout VS Code introduced a feature to synchronize before switching branches: > Pull before checkout > > 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. ``` JSON…

Find a URL in a Document While Using Vim

# Find a URL in a Document While Using Vim > https://example.org/ The forward slashes in a URL affect the search operator in Vim. And you won't be able to match the entire URL without using escape sequences. Below, I discuss different ways to search for a URL in Vim. ## Use Escape Sequences The proper way to match a URL is to escape any characters which have special meaning using a backslash \ In…

Windows Programs

# Windows Programs => https://chris.dziemborowicz.com/apps/hourglass/ Hourglass | Timer for Windows => http://meldmerge.org/ Meld | Diff Tool => https://notepad-plus-plus.org/ Notepad++ | Advanced Text Editor => https://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY | SSH and Telnet => https://docs.microsoft.com/en-us/sysinternals/ Sysinternals | Windows Utilities => https://www.getpaint.net/…

Managing PowerShell Modules

# Managing PowerShell Modules PowerShell code is packaged as modules. Note: I'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. Managing modules is confusing because the cmdlets were developed incrementally before Microsoft contemplated online repositories. So, there is a…

Anonymous Functions in PowerShell

# Anonymous Functions in PowerShell 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. 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…

Using Asterisks as Bullet Points in Vim

# Using Asterisks as Bullet Points in Vim If I create a bulleted list in Vim using the Markdown or Gemtext syntax: ``` Text * 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. * Fusce at enim gravida augue rutrum maximus ut at…

VS Code Sticky Scroll

# VS Code Sticky Scroll VS Code version 1.70 added the feature "sticky scroll". settings.json: ``` JSON { "editor.stickyScroll.enabled": true } ``` This allows the declaration for a code block to stay in view while scrolling vertically: similar to frozen rows in Excel. An animated demonstration appears in the announcement. ## Sticky Scroll in Trees VS Code version 1.85 added the preview feature…

Formatting Plain Text Copies in Vim

# Formatting Plain Text Copies in Vim I prefer to read long passages in Vim. So, I copy and paste from the Web into Vim. Sometimes, the plain text copy of an online document is difficult to read in Vim. Below are some advanced Vim commands to address specific issues. If you get unexpected results from running multiple commands, try running the commands in the order they appear here. In Vim, you…

What is PPID on Linux?

# What is PPID on Linux? > Parent Process IDentifier 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. By the nature of the system, further applications are spawned by the original…

Linux Command Line Reference

# Linux Command Line Reference ## Show the IP Address ``` ip address show # Show only the addresses. ip address show | grep inet ``` ## Network Manager Manjaro uses the RedHat NetworkManager suite to manage network interfaces. The command-line tool is nmcli. ### List Interfaces and Status Use the nmcli command with no arguments to list the interfaces and status. For example, below, the enp4s0…

Add a Permanently Visible Command Palette in VS Code

# Add a Permanently Visible Command Palette in VS Code The May 2022 patch notes for VS Code mention the Command Center. This is basically a permanently visible command palette embedded in the title bar. 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. While it is easy to trigger…

Prevent "Press Enter" in Vim Script

# Prevent "Press Enter" in Vim Script I use a Vim session to restore my workspace when I return to work. 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. 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…

Some Useful TechNet Wiki Articles

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

Trim Strings in Vim / Organize Firefox History

# Trim Strings in Vim / Organize Firefox History 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. ## Background I have a list of URLs from my Firefox history. I want to sort and deduplicate them. I don't care about what pages I visited. I am only interested in a list of the hosts. So a record like ```…

Start XFCE Terminal with a Different Shell

# Start XFCE Terminal with a Different Shell 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. It is possible to launch an application with command-line options…

Opening a Terminal in Vim

# Opening a Terminal in Vim 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. Here are the basic moves. ## Open a Terminal in a New Tab After opening Vim, you can open a terminal in a new Vim tab using the ex…

Vim Modelines

# Vim Modelines 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. Vim modelines allow you to set Vim options per file. 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.…

Working with Secret Information in Vim

# Working with Secret Information in Vim 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. So, it would be useful to know: * Where does Vim store information? * What steps should I take to protect the secret file I am…

Install Samba

# Install Samba I'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. I already created a directory for my file share at /data/fileshare. And I placed a test file in there: weird_fishes.txt ##…

Linux Shortcut Specification

# Linux Shortcut Specification If you edit a desktop launcher or shortcut on Linux, you might see a command like this: ``` text /usr/lib/firefox/firefox %u ``` 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. The second part is specific to launchers. It is part of the Desktop Entry…

GitHub Docs

# GitHub Docs ## Search Issues In this example, I am searching for issues which contain the word "snap", are currently open, and do not have the Distribution-Request label attached. ``` text snap is:open -label:Distribution-Request ``` => https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests Searching issues and pull requests | GitHub Docs Created:…

Check If You Are Using X11 or Wayland

# Check If You Are Using X11 or Wayland If you are using Linux but are not sure which display server you are using (X11; Wayland), you can check your environment variables. * Wayland uses WAYLAND_DISPLAY. * X11 uses DISPLAY. I don't think these variables are mutually exclusive. And it is worth checking for both. If the WAYLAND_DISPLAY environment variable is present then the system is using…

Manjaro Support

# Manjaro Support Here are some helpful links for troubleshooting Manjaro. ## Version Information ``` Terminal # Manjaro Version cat /etc/lsb-release # System Information inxi --admin --verbosity=7 --filter --width ``` => https://forum.manjaro.org/t/howto-provide-system-information/874 [HowTo] Provide System Information - Contributions / Tutorials - Manjaro Linux Forum ## GitLab Search the Manjaro…