Skip to content

Instantly share code, notes, and snippets.

View peterwwillis's full-sized avatar

Peter W peterwwillis

View GitHub Profile
@peterwwillis
peterwwillis / readme.md
Last active February 5, 2026 11:54
Installing Ollama and OpenWebUI on Ubuntu 24.04

Notes

  • you should first add your user to the following Unix groups: video, render, docker, ollama

    • sudo usermod -a -G render,video $LOGNAME
  • make sure user ollama is added to groups video and `render

  • install Docker (ideally in a dedicated VM; see https://gist.github.com/peterwwillis/e2b37e5dd502fd7ffc3833f56feade1e)

  • this guide installs the latest AMD drivers, but that might be too new of a version of ROCm for ollama (their guide says to use the AMD ROCm v6 tools). the latest AMD ROCm tools actually don't completely install on my Ubuntu 24.04 system due to package conflicts, but some of them install.

@peterwwillis
peterwwillis / gist:e2b37e5dd502fd7ffc3833f56feade1e
Last active January 30, 2026 03:17
Installing and running Docker-in-Docker in a dedicated Colima VM on Ubuntu Linux 24.04, for AI agent work

Installing and running Docker-in-Docker in a dedicated Colima VM, for AI agent work

You may want to run an AI agent in a "safe" environment, but with ease of use. The closest thing is a VM running Docker. You get the tooling and ecosystem of Docker, with the safety of a VM that you can delete (when the agent goes crazy, breaks out of the VM, steals your wallet and runs off with your wife (I miss you, Elaine...))

Colima is perfect for this, as it creates the VM and sets up Docker. It even keeps persistent files in a different volume than the VM's root disk, so you can just delete and recreate the root disk and your files are still there.

You can have multiple Docker contexts, one for "safe" work (in one VM), and one for "dangerous" AI work (different VM).

The only real downside to Docker is a VM volume filling up with container images.

@peterwwillis
peterwwillis / gist:3248bcd37bb9080ef35b5a83f2f324d3
Last active April 5, 2025 19:59
ThinkPad T14s Gen 4 - Linux tweaks

Setting up ThinkPad T14s Gen4 in Ubuntu Linux

About

I finally settled on a new personal Linux laptop, and it's the Lenovo ThinkPad T14s Gen 4 w/AMD processor, 32GB RAM, and Low-power 500 nits display.

I had mine shipped with Ubuntu, it comes with (I think) Ubuntu 22.04.01 LTS. It's nice because they set up the BIOS to come with Secure Boot enabled for Ubuntu. Everything works out of the box.

@peterwwillis
peterwwillis / control-touchscreen.sh
Created November 8, 2024 04:00
Detect, enable, or disable a HID touchscreen device in Linux (compatible w/Wayland)
#!/usr/bin/env sh
# control-touchscreen.sh - script to control touchscreen device in Linux
# Copyright (C) 2024 Peter Willis
#
# This script is designed to try to detect a Touchscreen device in Linux.
# If it detects one, it allows you to bind or unbind it to the HID Generic
# driver, which should enable or disable the touchscreen.
# Works on Wayland, should work on X11 as well (but untested).
#
# SOFTWARE LICENSE:
@peterwwillis
peterwwillis / k8s_debugging_tips.md
Last active March 27, 2024 14:53
Kubernetes debugging tips

Log Files

Nodes

Control Plane log files

  • /var/log/kube-apiserver.log - API Server, responsible for serving the API
  • /var/log/kube-scheduler.log - Scheduler, responsible for making scheduling decisions
  • /var/log/kube-controller-manager.log - a component that runs most Kubernetes built-in controllers, with the notable exception of scheduling (the kube-scheduler handles scheduling).

Worker Node log files

@peterwwillis
peterwwillis / .gitconfig
Created January 9, 2024 08:13
Running 1Password Desktop with Docker on Alpine Linux
[user]
; NOTE: Replace your name, email, and signing ssh public key here.
name = My Git User Name Here
email = MYGITEMAIL@ADDRESS.HERE
signingkey = MYLONGSSHPUBKEYHERE
; NOTE: Uncomment this if you want to set a default credential store for Git.
; On Linux, "secretservice" is the libsecret (aka keyring) method.
;[credential]
; credentialStore = secretservice
@peterwwillis
peterwwillis / CloudBlockStorePrices.csv
Created April 23, 2021 19:35
Comparison of cloud storage vendor prices
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 13 columns, instead of 1 in line 7.
,Linode,DigitalOcean,UpCloud,OVHCloud,Vultr,IBMCloud,Wasabi,Backblaze,AWS S3,Azure,GoogleCloud,Rackspace
Prices,https://www.linode.com/products/object-storage/,https://www.digitalocean.com/pricing/#spaces-object-storage,,https://www.ovhcloud.com/asia/public-cloud/prices/#439,https://www.vultr.com/products/object-storage/#pricing,https://cloud.ibm.com/objectstorage/create#pricing,https://wasabi.com/cloud-storage-pricing/pricing-faqs/,https://www.backblaze.com/b2/cloud-storage-pricing.html,,,,https://www.rackspace.com/openstack/public/pricing
,,,,,,,,,,,,
TrafficIncoming,included,included,,included,included,,included,,,,,
TrafficOutgoing,1TB + 0.01 per GB,1TB + 0.01 per GB,,$11 per 1 TB,1 TB + 0.01 per GB,$90 per 1 TB,included if not exceeding storage amount,$10 per 1 TB,$90 per 1 TB,$87 per 1 TB,$120 per 1 TB,$120 per 1 TB
StoragePricePerMonth,$20 per 1 TB,$20 per 1 TB,,$10 per 1 TB,$20 per 1 TB,$22.7 per 1 TB,$6 per 1 TB,$5 per 1 TB,$21 per 1 TB,$18 per 1 TB,$20 per 1 TB,$100 per 1 TB
,,,,,,,,,,,,
ArchiveTraf
@peterwwillis
peterwwillis / cliv
Last active May 2, 2021 19:01
cliv: Command-LIne wrapper to execute different Versions of binaries in different directories using different environment variables
#!/usr/bin/env sh
# cliv - Execute commands using a specific .env and directory
set -eu
_err () { printf "%s\n" "$0: Error: $*" ; exit 1 ; }
HOME="${HOME:-$(getent passwd $(id -u) | cut -d : -f 6)}"
[ -d "$HOME/.cliv" ] || mkdir -p "$HOME/.cliv"
if [ $# -lt 1 ] || [ "$1" = "-h" ] ; then
@peterwwillis
peterwwillis / gist:4d38a41b2b7bc23816af7d5f653213fa
Last active March 17, 2021 22:01
The difference between configuration formats, configuration languages, data formats, and programming languages

The difference between configuration formats, configuration languages, data formats, and programming languages

There is a lot of confusion out there about what different file formats are and how they are intended to be used. Having used a lot of them over the years, I think I can explain their differences, and when and how to use them.

Data formats

A data format is a file format for encoding data. Typically the format is structured to make it easier for machine interpreting & processing.