Skip to content

Instantly share code, notes, and snippets.

View jmarhee's full-sized avatar

jdm jmarhee

View GitHub Profile
apiVersion: resources.cattle.io/v1
kind: ResourceSet
metadata:
name: common-resources-all
resourceSelectors:
- apiVersion: v1
kinds:
- Pod
- ConfigMap
- Secret
@jmarhee
jmarhee / deb-to-rpm.sh
Created April 27, 2026 05:50
Convert .deb packages to .rpm (on an RPM-based system)
#!/bin/bash
DEB_PATH=$1
APP_DESC=$2
for tool in alien rpmbuild; do
if ! command -v $tool &> /dev/null; then
echo "ERROR: $tool not found"
exit 1
fi
@jmarhee
jmarhee / obsidian-rpm.sh
Created April 19, 2026 01:18
Convert and Install Obsidian from deb package to rpm-based install (https://obsidian.md/download) (rather than AppImage, Flatpak, etc.)
#!/bin/bash
DEB_PATH=$1
for tool in alien rpmbuild; do
if ! command -v $tool &> /dev/null; then
echo "ERROR: $tool not found"
exit 1
fi
done
@jmarhee
jmarhee / macos_ollama_host.md
Last active November 26, 2025 22:45
Enables the Ollama server to run on all interfaces on macOS via homebrew, or via launchctl.

brew

If installing ollama via brew, to expose Ollama on all interfaces (i.e. 0.0.0.0) for use with a remote application, modify the service file to include an OLLAMA_HOST key in the EnvironmentVariables in /opt/homebrew/Cellar/ollama/{version}/homebrew.mxcl.ollama.plist:

<plist version="1.0">
<dict>
	<key>EnvironmentVariables</key>
	<dict>
 OLLAMA_FLASH_ATTENTION
# Set store/env-specific k3s_version in pillar
{% set version = pillar.get('k3s_version', 'v1.31.1+k3s1') %}
# Set target datastore for additional disk equipped nodes
{% set datadir = pillar.get('k3s_datadir', '/var/lib/rancher') %}
{% set base_url = 'https://github.com/k3s-io/k3s/releases/download/' ~ version %}
/tmp/k3s-upgrade:
file.directory:
- makedirs: True
k3s_download_and_validate:
#!/bin/bash
## Assumes a filename ${artist} - ${title}.mp3
## If not already in mp3:
# for f in *.m4a; do ffmpeg -i "$f" -vn -ar 44100 -ac 2 -b:a 192k "${f%.*}.mp3"; done
## Assumes album cover art at ./cover.jpg
ALBUM_NAME=$1
ALBUM_ARTIST=$2
[Desktop Entry]
Version=1.0
Type=Application
Exec=icecat %u
Terminal=false
X-MultipleArgs=false
Icon=icecat
StartupWMClass=icecat-default
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=application/json;application/pdf;application/rdf+xml;application/rss+xml;application/x-xpinstall;application/xhtml+xml;application/xml;audio/flac;audio/ogg;audio/webm;image/avif;image/gif;image/jpeg;image/png;image/svg+xml;image/webp;text/html;text/xml;video/ogg;video/webm;x-scheme-handler/chrome;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/mailto;
#!/bin/bash
KUBECONFIG_DIR=$HOME/.kube
mkdir -p "$KUBECONFIG_DIR"
clusters=$(rancher clusters ls --format '{{.Cluster.Name}}')
for cluster in $clusters; do
echo "Downloading kubeconfig for cluster: $cluster"
#!/bin/bash
###
# From https://www.reddit.com/r/Ubuntu/comments/u8uto5/ubuntu_2204_pipewire_setup/
###
###
# Validated for the following configuration:
# ----------
# OS: Zorin OS 17.3 x86_64 (Ubuntu 22.04 base)
#!/bin/bash
# Check if the directory is provided as an argument
if [ $# -eq 0 ]; then
echo "Usage: $0 <directory>"
exit 1
fi
# Directory containing the audio files
DIRECTORY=$1