Skip to content

Instantly share code, notes, and snippets.

View plembo's full-sized avatar

Phil Lembo plembo

View GitHub Profile
@plembo
plembo / ctrlmicepiper.md
Last active December 1, 2021 14:15
Controling Mice with Piper

Using Piper for Mouse Control

These are not my notes on how we rid our crawlspace of vermin a couple of years ago (spoiler alert: firearms were not, as usual in suburbia, necessary to get that job done). Rather, they're how I integrated by new Logitech G203 Lightsync mouse with my Ubuntu workstation.

Like many gaming mice, the Logitech G203 works fine out of the box with Linux. However, if you want to actually control the DPI or LED settings, you'll need a desktop utility like Logitech's G-HUB.

Of course there's no G-HUB for Linux, but fortunately the libratbag project provides an alternative.

Their ratbagd service and its Piper GUI work together assert control over mice like the G203.

Setting things up on Ubuntu is made infinitely e

@plembo
plembo / raspizerowsetup.md
Last active May 14, 2022 21:22
Raspberry Pi Zero W headless setup

Setup Raspberry Pi Zero W headless

  1. Download desired OS image from https://www.raspberrypi.com/software/operating-systems/ and unzip.
  2. Image SD Card with Raspberry OS:
$ sudo dd if=2021-10-30-raspios-bullseye-armhf-lite.img of=/dev/sdc bs=4M conv=fsync status=progress
  1. Create wpa_supplicant.conf at root of boot partition:
$sudo vi /media/myuser/wpa_supplicant.conf
@plembo
plembo / usingpnppwsh.md
Last active November 17, 2021 15:29
Using the PnP Management Shell

Using PnP PowerShell

Installing

PS> Install-Module PnP.PowerShell

Connecting and Testing

First, authorize PnP to access SharePoint Online for admin purposes:

@plembo
plembo / setupspfxdevenv.md
Last active June 12, 2022 15:31
Setup a SharePoint Framework Dev Environment

Setup a SharePoint Framework Dev Environment

With notes related to PnP Microsoft 365 Community development.

Introduction

It's important to keep up with the documentation and bug reports in this, especially with regard to the versions of node.js and npm that will work with a given solution. There is presently no uniformity in this area. The notes below reflect the current (as of 14 Nov 2021) state of play as I understand it.

Some notes on why you shouldn't plan on doing much SharePoint Framework development on Linux:

  1. Some projects may require dependencies, like PowerShell modules, that cannot run on Linux. In particular, the SharePoint Online Management Shell and related modules will only run on Windows (on PowerShell 5, as admin, and not at all on PowerShell 7+). The same is true of the [PowerShell modules for Power Platform](https://docs.microsoft.co
@plembo
plembo / rpioskvm.md
Last active August 25, 2024 03:38
Raspberry Pi OS on KVM

Raspberry Pi OS on KVM

NOTICE

This steps and links provided in this gist are significantly outdated (having been created in 2020) and should not be followed. I will look into updating them when time permits.

Introduction

Raspberry Pi OS is a Debian Linux derivative for the Raspberry Pi. "KVM" is a native open source virtual machine management service for Linux workstations and servers that leverages QEMU and libvirt. There are a variety of recipes for getting Raspberry Pi OS guest virtual machine up and running on KVM. Having tried many of these, this is the one I now use. Tested on Ubuntu 18.04 LTS Desktop, with all that implies (YMMV).

This is a "just for fun" project that I don't expect to make serious use of. With several actual Pi boards around the workshop, being able to reliably run on an emulator isn't really a major need.

Procedure [OUTDATED: DO NOT USE]

@plembo
plembo / virt-resize-grow.md
Last active October 22, 2024 21:46
Resize virtual disk partions with virt-resize

Resize a virtual disk partition with virt-resize

Anyone who has worked with QEMU on libvirtd even a little while gets to know the qemu-img utility pretty well. What users of KVM may not know about is virt-resize.

Say you want to add 30 GB of space to the disk for a virtual machine. How do you "grow" the virtual disk? Easy, use qemu-img resize:

$ sudo qemu-img resize /var/lib/libvirt/images/mydisk.qcow2 +30G
@plembo
plembo / my_gitconfig.md
Last active October 15, 2021 19:32
My .gitconfig

My .gitconfig

Not presented as any kind of model or standard, but just what I've done for myself:

[user]
	name = Phil Lembo
	email = [email protected]
[push]
	default = simple
[alias]
@plembo
plembo / pandocdocx2md.md
Last active April 21, 2025 15:38
Convert docx to markdown with pandoc

Convert Word documents to markdown with pandoc

I use pandoc to convert masses of Word documents to markdown. Still working on a generic script, but for now here's the "gist" of what I type into the terminal:

$ myfilename="example"
$ pandoc \
-t markdown_strict \
--extract-media='./attachments/$myfilename' \
$myfilename.docx \
@plembo
plembo / rclonercdgui.md
Last active September 11, 2021 14:50
rclone rcd gui

A built-in gui for rclone

There is an experimental gui mode for rclone:

$ rclone rcd --rc-web-gui

This pops a browser window (or tab, depending on your personal browser defaults) with a nice gui file manager interface.

The official doc has the details:

@plembo
plembo / rclonemirrortogdrive.md
Last active April 26, 2023 10:55
Mirror to GDrive with rclone

Mirror backup to Google Drive with rclone

My home backup solution is simple and unsophisticated: Select parts of host filesystems (like home and configuration directories) are copied to a file server using rsync, to later be mirrored to cloud storage using rclone. This process has been in place for many years with the main change over time being the cloud storage used. Originally that was Google Cloud Storage, later on AWS S3. Part of the deal when you get hooked up with Google Fiber is 1 TB of free Google Drive storage.

Google Drive has been known to have relatively low transfer rates and a number of other restrictions that make it less than ideal as a backup solution. But with a little effort it may work. Here is the basic command I use to sync a given folder between my server and Google Drive (see the doc for configuring rclone for Google Drive).

In these examples "drive:" is the rclone remote name for my Google Drive, and "