Skip to content

Instantly share code, notes, and snippets.

View plembo's full-sized avatar

Phil Lembo plembo

View GitHub Profile
@plembo
plembo / setdefgitbranchtomain.md
Last active December 29, 2020 21:01
Set default git branch name to main

Setting default branch name to main

GitHub is now naming the default branch for new repositories "main" instead of "master", while the latter is still the default for the git command-line tool. With git v2.28, you can configure git to set a name other than "master" for the default branch. Of course, once that's done there's still the "little" matter of making the change to all your repos. GitHub says they're going to do this in the background starting in January 2021, and in fact advise against making the change yourself.

Make git init use "main"

For all future repos created locally:

$ git config --global init.defaultBranch main
@plembo
plembo / installbashgitprompt.md
Last active March 10, 2021 21:22
Installing bash-git-prompt

Installing bash-git-prompt

bash-git-prompt example image

On one level, bash-git-prompt isn't very impressive. The changes it makes to your terminal aren't the kind of eye candy other, more ambitious, shell prompt customizers like Powerline and its derivatives provide. But it is useful.

In fact, for me it turns out to be more useful than Powerline because it conveys a lot of information while remaining relatively unobtrusive. It also doesn't require any special fonts.

Steps to install and enable it on Linux, from the README on github:

  1. Download the repo into the root of your user's home directory as a "dot" folder:
@plembo
plembo / usevirtclone.md
Last active August 29, 2022 14:52
Using virt-clone

Using virt-clone

The virt-clone utility is a useful tool for rapidly reproducing KVM (libvirtd) virtual machines.

Basic command to clone an existing virtual machine:

$ sudo virt-clone \
--original debian1 \
--name debian2 \
--file /var/lib/libvirt/images/debian2.qcow2
@plembo
plembo / isgroupcreationdisabled.md
Last active February 12, 2021 23:43
Has Microsoft 365 group creation been disabled

Is Microsoft 365 group creation disabled?

Stumbled on this in a corporate test environment when I tried to create a new Microsoft Team (an operation that requires rights to create new groups) and was only given the choice of adopting an existing group.

By default Microsoft 365 expects everyone is able to create groups on the tenant. Microsoft recommends that you not change that. Then they go ahead and tell you how to change it anyway.

"Manage who can create Microsoft 365 Groups." Microsoft Docs, https://docs.microsoft.com/en-us/microsoft-365/solutions/manage-creation-of-groups?view=o365-worldwide. Retrieved February 12, 2021.

Well, by now this little bit of dangerous knowledge has made its rounds, and perhaps that's why you wound up here.

So the question is, how do you tell if its been done in your tenant?

@plembo
plembo / addbr0ubunmcli.md
Last active April 21, 2025 08:05
Add br0 to Ubuntu desktop using nmcli

Add a bridge interface to Ubuntu desktop using nmcli

Had to do this for some advanced networking with KVM, and couldn't figure out how to do it using the Nework Manager gui. Did find an article later that showed how to do it with nmtui, but it's so much easier to record what you did when using the cli.

In the examples below "eth0" is the name of my physical interface. By default on Ubuntu and most distributions that will almost certainly be different, for example: "eno1", "ens1", or "enp2s0".

To see what everything looks like before starting:

@plembo
plembo / favfonts.md
Last active January 4, 2022 15:09
Favorite Fonts

Favorite Fonts

UI

Linux UI

Noto regular or Ubuntu Regular.

Windows UI

Just learn to live with the defaults. Not a hill worth dying on.

Terminals and Editors

All platforms:

@plembo
plembo / chromeappsinstall.md
Last active December 29, 2024 03:04
Installing Chrome and Progressive Web Apps

Chrome and Progressive Web Apps Installation Notes

Google Chrome and Chromium-based browsers (like Vivaldi, Brave, and Microsoft Edge) support Progressive Web Apps (PWAs) on all platforms. The menu options differ slightly between browsers, but the concepts behind them are the same. Vivaldi's controls for this differ significantly from those in Chrome, Brave, and Edge. I have no idea why. Check out Vivaldi's help pages for details.

PWAs

Desktop menu items and desktop shorcuts are created in Chrome when a PWA is installed using the special "install" icon over on the right end of the address bar. An "installed" PWA opens as a new browser window sans tool and address bars. One advantage of PWAs over shortcuts is that PWA's can configure desktop notifications (most mail client PWAs do this: e.g., Gmail, Outlook and Proton Mail -- some others include Google Drive, YouTu

@plembo
plembo / googledriveappslist.md
Last active March 3, 2021 20:39
List of Google Drive Apps

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 / nmbrnetkvm.md
Last active April 4, 2025 16:38
NetworkManager bridged network for KVM guests

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 (libvirtd) 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 / secprintwindt.md
Last active July 8, 2022 06:36
Secure printing for Windows Desktop

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).