Skip to content

Instantly share code, notes, and snippets.

Avatar

Phil Lembo plembo

View GitHub Profile
@plembo
plembo / msys2winterm.md
Last active Mar 24, 2021
MSYS2 in WIndows Terminal
View msys2winterm.md

MSYS2 in Windows Terminal

Windows Terminal is a nice console for Windows. MSYS2 is a collection of Unix utilities for Windows that can provide a lot of value (it's the basis for the Git for Windows package).

Currently, installing MSYS2 either before or after Windows Terminal will not automatically create a profile entry for MSYS, so it has to be created manually. To add MSYS2 to Windows Terminal after setup, open the Windows Terminal Settings and paste in this block of profile code:

{
    //MSYS2 profile
    "guid": "{d4b537fe-bb1f-432e-ab11-105df0deef9f}",
@plembo
plembo / reverttowsl1.md
Last active Mar 24, 2021
Revert to WSL 1
View reverttowsl1.md

Revert to WSL 1 from WSL 2

I'll spare everyone the rant. This gist will be an all business how to revert to WSL (Windows Subsystem for Linux) on Windows 10 from version 2 back to version 1.

I do endorse this rant: WSL2 is a massive mistake.

Note that enabling Hyper-V destabilized the (highly managed) system my company provides me. This is probably unique to the image used for the machine and the updates that base has received. So I'm not surprised by the issues people are having with Hyper-V and the Virtual Machine Platform.

My personal Windows virtual machines remain on WSL 1 because I just don't have the energy to deal with all

@plembo
plembo / gngpgupdatefiles.md
Last active Mar 13, 2021
Updating gnupg keychain from gpg to kbx
View gngpgupdatefiles.md

Bringing gnupg up to date: from gpg to kbx

GNU Privacy Guard made a change to its keystore with version 2.1 in 2014, including removal of the separate private keystore. The main difference users may notice is that the public keyring is now called "pubring.kbx" instead of "pubring.gpg". Its new keybox format is supposed to improve performance.

After continuing to use the old format through several upgrades, I finally decided to bring my evironment up to date.

The steps are in the GNUPg doc:

@plembo
plembo / secprintwindt.md
Last active Mar 11, 2021
Secure printing for Windows Desktop
View secprintwindt.md

Secure printing for Windows Desktop

See Secure Printing on Ubuntu Desktop for the backstory and theory. Here, I'm going to just briefly describe the steps to install a networked IPPS printer on Windows 10.

Printer has a local DNS name of "printer1.example.com". You can substitute the IP address of the printer, but note you may have SSL certificate issues. Insecure IPP can be used as a fallback, in which case the URI would be "http://xxx.xxx.xxx.xxx:631".

Before beginning, be sure to install the printer vendor's basic driver package (you won't need all their fancy utiltiies to use native Windows printing).

@plembo
plembo / sanenethpmfp.md
Last active Mar 10, 2021
SANE Networking for HP MFP
View sanenethpmfp.md

SANE Networking for HP Multi Function Printers

SANE (Scanner Access Now Easy) is a standard API that provides a universal scanner interface supported by most if not all device manufacturers. Unlike the TWAIN standard, SANE separates the user interface from the device driver. This makes it possible to address devices over a network, something that could not be done with TWAIN.

The reference system for this article is an HP LaserJet Pro MFP M130nw, wired to an ethernet network and a Ubuntu Desktop 18.04.5 LTS client.

Printer hardware configuration

The good news is that the HP LaserJet Pro MFP M130nw ships with its SANE interface enabled, so there's nothing that needs to be done on the printer itself to address it over the network via SANE.

@plembo
plembo / secprintubuntudesk.md
Last active Mar 11, 2021
Secure printing on Ubuntu Desktop Linux
View secprintubuntudesk.md

Secure printing on Ubuntu Desktop

Out of the box, Ubuntu Desktop implements a hybrid solution for printing that could get a user in some trouble if they're not careful. These notes are intended to help correct that.

My reference system is running Ubuntu Desktop 18.04.5 on a x86_64 workstation with the default Gnome Project environment. The printer used for testing was a HP LaserJet Pro MFP M130nw connected to the local network over wired ethernet.

Ubuntu packages vs downloads

Almost everywhere on the Internet you'll see advice to download various components directly from a vendor's site. Don't.. Just rely on the Ubuntu packages provided with Desktop 18.04 and later. They are more than sufficient to get the job done.

@plembo
plembo / nmbrnetkvm.md
Last active Mar 4, 2021
NetworkManager bridged network for KVM guests
View nmbrnetkvm.md

Setting up a bridged network for KVM guests

This will work with either networkd or NetworkManager as a resolver. In fact, this is the only way to do bridged KVM networking with NetworkManager.

If you're using NetworkManager (on a desktop or laptop, for example) on your KVM host, follow these instructions to set up a bridge interface.

Once you have the host bridge set up, proceed as follows:

  1. Create a bridge network device inside KVM. Edit and save the below text as file host-bridge.xml:
@plembo
plembo / googledriveappslist.md
Last active Mar 3, 2021
List of Google Drive Apps
View googledriveappslist.md

List of Google Drive Apps

These are the apps I use with Google Drive. Not listed are app connections that get installed when an extension or desktop app is originally set up.

@plembo
plembo / chromeappsinstall.md
Last active Mar 2, 2021
Installing Chrome and Progressive Web Apps
View chromeappsinstall.md

Chrome and Progressive Web Apps Installation Notes

I never paid much attention to Chrome Apps, until I got a Chromebook (which I've since given away) and suddenly became uncomfortably dependent on them. Now that Google is eliminating Chrome Apps in favor of installable Progressive Web Apps (PWAs) and web app shortcuts, I decided to take stock of what I'll be configuring going forward.

NOTE: Google Docs Offline is not a Chrome App, but is a very useful browser extension that everyone should have installed.

Google's Chrome Apps

Now deprecated, these will supposedly will be gone soon. None of those listed below have been replaced by PWAs yet. While Chrome Apps default to opening a browser tab, they can be configured to open

@plembo
plembo / favfonts.md
Last active Feb 24, 2021
Favorite Fonts
View favfonts.md

Favorite Fonts

UI: Noto regular

Editors: Fira Code

On Ubuntu:

$ sudo apt install fonts-noto
$ sudo apt install fonts-firacode