Skip to content

Instantly share code, notes, and snippets.

@wmudge
wmudge / gpg-preset-key.sh
Last active January 3, 2024 14:15
GPG Preset Passphrase script
#!/bin/bash
# Hacked from https://superuser.com/a/1586033
set -e
GPG_PRESET_PASS="/usr/lib/gnupg/gpg-preset-passphrase"
SCRIPT="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")"
if [[ -z $1 ]]; then
[localhost] TASK: install package (debug)> from jinja2 import Environment
[localhost] TASK: install package (debug)> e = Environment()
[localhost] TASK: install package (debug)> t = e.from_string(task.args['msg'])
[localhost] TASK: install package (debug)> t.render(task_vars)
'foo'
or
@wmudge
wmudge / TW-to-OB.md
Last active July 18, 2023 08:59
TiddlyWiki to Obsidian.md

I wanted to convert my small-ish TiddlyWiki site to an Obsidian.md vault, and while the instructions I found on forums, et al, were immensely helpful, I still had to hack at the process a bit.

Note My TiddlyWiki installation is a Nodejs server running on Alpine (via a Docker container), but my Obsidian installation is running on Windows, iOS, and others. YMMV.

My journey ...

  1. First, read this forum post and the original blog post to understand the basic workflow.

  2. Copy the two Nodejs scripts, safe-construct.js and safe-rename.js

@wmudge
wmudge / RenewExpiredGPGkey.md
Created February 27, 2023 14:39 — forked from TheSherlockHomie/RenewExpiredGPGkey.md
Updating expired GPG keys and backing them up 🔑🔐💻

Updating expired GPG keys and their backup 🔑🔐💻

I use a GPG key to sign my git commits.

An error like this one might be a sign of an expired GPG key.

error: gpg failed to sign the data fatal: failed to write commit object
@wmudge
wmudge / gitflow-breakdown.md
Created February 1, 2023 17:06 — forked from JamesMGreene/gitflow-breakdown.md
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@wmudge
wmudge / podman_machine_timesync.md
Last active January 26, 2023 15:24
Steps to manage time sync with podman's VM

Timesync Setup for podman Machine VM

  1. Log into the podman machine VM
    podman machine ssh
  2. Temporarily disable SELinux
    sudo setenforce 0
@wmudge
wmudge / RSA_PEM.md
Created January 20, 2023 19:29
SSH operations

Legacy RSA PEM Key Operations

Several projects and applications cannot handle newer SSH key formats, so to use the legacy PEM format for RSA keys, follow the steps below:

Generate the RSA PEM private key

ssh-keygen -b 3072 -C <optional comment> -t rsa -m PEM -f <private key name>.pem [-P <password>]
@wmudge
wmudge / azure_rm_resource.md
Last active February 28, 2022 22:26
Using Ansible with Azure

Adhoc Azure Resource Management Resources

While both the azure.azcollection and community.azure Ansible collections have a number of modules, many Azure endpoints are not addressed directly in Ansible. In these scenarios, you have two options: wrap the az CLI or work directly with the Azure SDK. The latter is preferred, but to do so via Ansible takes a bit of understanding.

The modules azure.azcollection.azure_rm_resource and azure.azcollection.azure_rm_resource_info interact with adhoc Azure SDK endpoints. These modules takes care of authentication and endpoint exchange. To use the modules, check out the documentation for the appropriate Azure REST API endpoint and then assign the module parameters accordingly.

For example, to create

@wmudge
wmudge / github_gpg_key.md
Last active June 18, 2022 18:39 — forked from ankurk91/github_gpg_key.md
Signing git commits using GPG (Ubuntu/Mac)

Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
@wmudge
wmudge / simple-setup.md
Created July 8, 2021 13:46
Desktop Audio to Discord

Desktop Audio to Discord (Simple)

NB: Missing, uh, the vast majority of the steps here -- looking to just write up some details lest they float away.

Sound Preferences

Connect Spotify to the CABLE Input output. . Go to Settings > Sound > Advanced sound options > App volume and device preferences . Change the Output selector to CABLE Input (VB-Audio Virtual Cable)