Install a Linux guest in KVM

Shared folder and clipboard working, for any ISO. Scripts here: https://gist.github.com/kanehekili/81dcd5f048410c948891945d5e5c94ff Download the files, then: chmod +x *.sh Images land in ~/QVM and the host share is ~/VMShares. To use another drive, export KVM_DISK_DIR=/your/path before running installVM.sh. Once per machine ./kvmSetup.sh Log out and log back in, then: ./virtiofs.sh Step 1 - create the VM ./installVM.sh <name> <iso> [disk] [ram-GB] [cpus] Example: ./installVM.sh ubuntu-26.10 ~/Downloads/ubuntu-26.10-desktop-amd64.iso 40G 8 6 Defaults are 25G, 8 GB RAM, 6 CPUs. ...

November 26, 2026 · 2 min · Kanehekili

Convert a boot disk from MBR to GPT

A machine installed the old way boots through the firmware’s Compatibility Support Module: an MBR partition table and a bootloader in the boot sector. Switch CSM off and the firmware finds nothing, because UEFI boots only from an EFI System Partition, and an MBR disk has none. The machine drops into its setup screen. That matters as soon as something needs UEFI. Intel Arc graphics cards carry no legacy video BIOS and may give no picture at all with CSM enabled, and Resizable BAR needs Above 4G Decoding, which firmware keeps locked while CSM is on. ...

October 29, 2026 · 10 min · Kanehekili

File drop with dufs and fail2ban

A static site has no server-side code, so a password-protected upload area normally means dragging in PHP or a whole cloud suite. dufs is a single Rust binary that serves one directory over HTTP - upload, download, delete, archive - with its own logins, independent of the Linux users. It listens on localhost only; nginx publishes it under a path on the existing site and lends it that site’s TLS certificate. fail2ban then watches the login for brute force. ...

October 25, 2026 · 7 min · Kanehekili

KVM guest: resize X desktop with the VM window

Resizing the window of a KVM/QEMU virtual machine changes the virtual display mode, but at least under Xfce the X desktop does not follow: the guest keeps the old resolution, with black borders or a scrollable viewport around it. Fix: react to the DRM mode change in the guest. Create ~/.local/bin/vmx.sh #!/bin/sh udevadm monitor --udev --subsystem-match=drm | while read -r _; do xrandr --output Virtual-1 --auto done Make it executable and add it to the session autostart (Xfce: Settings -> Session and Startup -> Application Autostart). From then on every resize of the VM window on the host is picked up and the desktop resizes with it. ...

October 18, 2026 · 4 min · Kanehekili

Raspberry Pi OS tweaks

Preventing the first-boot SD card resize Raspberry Pi OS expands the root partition to fill the SD card on first boot. There are two mechanisms, depending on image age. Old images (pre-2022) It’s init=/usr/lib/raspi-config/init_resize.sh in /boot/cmdline.txt that expands the partition size before /etc/init.d/resize2fs_once runs. If init=/usr/lib/raspi-config/init_resize.sh is removed, /etc/init.d/resize2fs_once still runs /usr/sbin/resize2fs which finds there’s nothing to do and immediately exits without anything being changed. /etc/init.d/resize2fs_once then removes itself and it’s end-of-story. The full story: https://forums.raspberrypi.com/viewtopic.php?t=313003 ...

October 14, 2026 · 3 min · Kanehekili

Setting up Arduino IDE for ESP 8266

ESP8266 and ESP32 with the Arduino IDE 2.x on Linux. Two separate things have to be set up: serial port access (a group), and the board support package (what people loosely call ’the ESP library’). 1. USB serial access - the group The adapter shows up as a character device owned by root with a group: ls -l /dev/ttyUSB0 -> crw-rw---- root uucp Arch / Manjaro group: uucp (lp is also useful for printers) Debian / Ubuntu group: dialout Fedora / openSUSE group: dialout ...

October 14, 2026 · 4 min · Kanehekili

COMPIZ QUIRKS - GTK4 windows render transparent

Solved 2026-10-13. Compiz 0.9.14.2 (ini backend), XFCE / LightDM, GeForce GTX 760 on the legacy NVIDIA 470 driver, X11, focus-follows-mouse, no autoraise, no click-to-focus. SYMPTOMS - one cause, two faces Both only with GTK4 apps, and both disappear with the cairo renderer. a) STALE FIRST FRAME, looks like a transparent window. The window shows whatever is behind it - wallpaper, other windows - sharply, not blended. Only widgets that redraw themselves (buttons, column headers) and the WM title bar look right. It strikes ONCE per application start, on the first focus transition into the window. Moving the pointer across the window heals it for the rest of that window’s life. It needs a window with a large area whose content never changes. A list with rows never shows it: hovering rows keeps invalidating them, so a fresh frame always replaces the bad one. An empty or one-row list invalidates never, so the bad frame is never replaced. ...

October 13, 2026 · 6 min · Kanehekili

Black screen after resume from suspend / hibernate (AMDGPU and others)

Symptom — the machine resumes, fans spin, disks come back, but the panel stays dark until you move the mouse or press a key. Cause — this is not a GPU or hibernate-image problem. On an X11 session with lightdm + light-locker, XFCE locks the screen on the way into sleep (xfce4-power-manager/lock-screen-suspend-hibernate = true) and the panel is put into DPMS “off”. Nothing restores DPMS on resume: X only forces the monitor back on when it sees an input event. Hence “dark until I touch something”. ...

September 21, 2026 · 3 min · Kanehekili

Finding heldback packages

pacman pacman -Si <package> | grep Version # version in the repo pacman -Qi <package> | grep Version # version installed Or for all ignored packages at once: pacman -Qu This lists everything with a newer repo version, and packages in IgnorePkg are still shown, marked with [ignored] at the end of the line. A plain pacman -Syu also prints a warning per ignored package with the old and new version before it lists the rest. ...

September 21, 2026 · 1 min · Kanehekili

Arch / Manjaro update quirks

The biggest blunders documented here: lib32-audit: sudo pacman -Rdd lib32-audit then update your stuff. Background - that lib went into AUR, but had a back reference. (Manjaro only) The infamous invalid pgp message (mostly Manjaro, did not observe that at ARch or EndevourOS) Manjaro - First try sudo pacman -Syy sudo pacman -S manjaro-keyring archlinux-keyring IF THAT fails DO: sudo rm -rf /etc/pacman.d/gnupg /var/lib/pacman/sync sudo pacman-key --init sudo pacman-key --populate archlinux manjaro sudo pacman -Syyu On real Arch Linux do: pacman ...

September 16, 2026 · 1 min · Kanehekili

SSH / rsync cheetSheet

Basic ssh user@host Copy local -> remote scp /local/file user@dest:/remote/name/dir scp -rp sourcedirectory user@dest:/path Copy remote -> local scp user@dest:/remote/name/dir/file /local/dir scp -rp user@dest:/dir /local/dir RSync alternative: (n= dry run) rsync -avn --progress local/dir/ /remote/dir (check the slashes)

September 16, 2026 · 1 min · Kanehekili

Arch background package download

Create a service that downloads the latest versions without installling them. Needs a service and a timer service. The Code: sudo nano /usr/local/bin/arch-bg-download.sh #!/usr/bin/env bash # Script to pre-download official repo and AUR updates in the background. # 1. Update package databases and pre-download official repository packages echo "Pre-downloading official repository updates..." pacman -Sywq --noconfirm # 2. Pre-download AUR updates if yay is installed (Runs as regular user context, not root) if command -v yay &> /dev/null; then echo "Pre-downloading AUR updates..." # Find the primary human user to execute yay safely without root permissions REAL_USER=$(loginctl list-users --no-legend | awk '{print $2}' | grep -v 'root' | head -n 1) if [ -not -z "$REAL_USER" ]; then sudo -u "$REAL_USER" yay -Syua --downloadonly --noconfirm fi fi echo "Background download finished successfully." sudo chmod +x /usr/local/bin/arch-bg-download.sh ...

August 29, 2026 · 1 min · Kanehekili

Replace SNAP Firefox on Ubuntu

Snap ignores your theme and selects one of the co-packed snap themes. This is one of the drawbacks of snap. You could remove Firefox from snap with: sudo snap disable firefox snap remove --purge firefox For Ubuntu 22.04, the empty Firefox Deb is pre-installed as a wrapper. You have to remove it via command: sudo apt remove --autoremove firefox On Ubuntu 22.04, you’ll have to add a ppa now: ...

August 28, 2026 · 1 min · Kanehekili

D1 mini V4.0 pinout (ESP8266)

LOLIN / WEMOS D1 mini V4.0 - ESP8266EX, 4 MB flash, USB-C. Logic level 3.3 V, the pins are NOT 5 V tolerant, ~12 mA max per pin. PWM (analogWrite, 0-1023) and interrupts work on every digital pin except D0 / GPIO16. Digital header pins PIN GPIO FUNCTION AT BOOT USE D0 GPIO16 Deep-sleep wake HIGH limited D1 GPIO5 I2C SCL floating / LOW free D2 GPIO4 I2C SDA floating / LOW free D3 GPIO0 Boot mode select HIGH, 10k pull-up careful D4 GPIO2 LED, Serial1 TX HIGH, 10k pull-up careful D5 GPIO14 HSPI SCK floating free D6 GPIO12 HSPI MISO floating free D7 GPIO13 HSPI MOSI floating free D8 GPIO15 HSPI SS, boot mode LOW, 10k pull-down careful Serial, analog and power pins ...

August 21, 2026 · 3 min · Kanehekili

Add new AUR package

● Publishing to AUR First time only: Create an account at https://aur.archlinux.org and register your SSH key Clone the (empty) AUR package repo: git clone ssh://aur@aur.archlinux.org/your-repo.git Every release: Run gradle build_all Upload your-repo${version}.tar to GitHub Releases (tag must match the version, e.g. 1.3.0) Copy the generated files into the AUR clone: cp dist/AUR/PKGBUILD dist/AUR/.SRCINFO ~/home/user/your-aurgit-folder Commit and push: cd ~/home/user/your-aurgit-folder git add PKGBUILD .SRCINFO git commit -m “Update to ${version}” git push or

August 15, 2026 · 1 min · Kanehekili

bashrc

Raspi and others add to /etc/profile export LOC=NameOfLocation add to /etc/bash.bashrc: #——— cut here —————- #-----------refinement --------------- use_color=true # Set colorful PS1 only on colorful terminals. # dircolors --print-database uses its own built-in database # instead of using /etc/DIR_COLORS. Try to use the external file # first to take advantage of user additions. Use internal bash # globbing instead of external grep binary. safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM match_lhs="" [[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)" [[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)" [[ -z ${match_lhs} ]] \ && type -P dircolors >/dev/null \ && match_lhs=$(dircolors --print-database) [[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true if ${use_color} ; then # Enable colors for ls, etc. Prefer ~/.dir_colors #64489 if type -P dircolors >/dev/null ; then if [[ -f ~/.dir_colors ]] ; then eval $(dircolors -b ~/.dir_colors) elif [[ -f /etc/DIR_COLORS ]] ; then eval $(dircolors -b /etc/DIR_COLORS) fi fi if [[ ${EUID} == 0 ]] ; then #PS1='\[\033[01;31m\][\h\[\033[01;36m\] \W\[\033[01;31m\]]\$\[\033[00m\] ' PS1='\[\e[1;31m\]\u@\h[$LOC]\[\e[0m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[93m\]' else #PS1='\[\033[01;32m\][\u@\h[$LOC]\[\033[01;37m\] \W\[\033[01;32m\]]\$\[\033[00m\] ' PS1='\[\e[0;32m\]\u@\h[$LOC]\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[1;33m\]' fi alias ls='ls --color=auto' alias grep='grep --colour=auto' alias egrep='egrep --colour=auto' alias fgrep='fgrep --colour=auto' fi unset use_color safe_term match_lhs sh #alias cp="cp -i" # confirm before overwriting something alias df='df -h' # human-readable sizes alias free='free -m' # show sizes in MB alias np='nano -w PKGBUILD' alias ll='ls -la' alias llt='ls -lat' alias cls='printf "\033c"' alias grepc="grep -Ev '^[[:space:]]*([#;]|$)'" alias xzc='xz -vT0 -M99% -k' alias xzd='xz -dvk' alias journalerr='journalctl -p3 -xb' xhost +local:root > /dev/null 2>&1 complete -cf sudo # Bash won't get SIGWINCH if another process is in the foreground. # Enable checkwinsize so that bash will check the terminal size when # it regains control. #65623 # http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11) shopt -s checkwinsize shopt -s expand_aliases # export QT_SELECT=4 # Enable history appending instead of overwriting. #139609 shopt -s histappend # # # ex - archive extractor # # usage: ex <file> ex () { if [ -f $1 ] ; then case $1 in *.tar.bz2) tar xjf $1 ;; *.tar.gz) tar xzf $1 ;; *.bz2) bunzip2 $1 ;; *.rar) unrar x $1 ;; *.gz) gunzip $1 ;; *.tar) tar xf $1 ;; *.tbz2) tar xjf $1 ;; *.tgz) tar xzf $1 ;; *.zip) unzip $1 ;; *.Z) uncompress $1;; *.7z) 7z x $1 ;; *) echo "'$1' cannot be extracted via ex()" ;; esac else echo "'$1' is not a valid file" fi } #——— cut here —————- ...

August 15, 2026 · 3 min · Kanehekili

Firefox Notes

DO not prefer http over https: ( aka accept http pages) dom.security.https_first = false Ubuntu If you do not want to use the Ubuntu snap firefox - this link explains how to remove it: https://askubuntu.com/questions/1369159/how-to-remove-snap-completely-without-losing-firefox

August 15, 2026 · 1 min · Kanehekili

Systemd

Show all running services systemctl list-units --type=service Creation of a failsafe service [Unit] Description=My App StartLimitIntervalSec=30 StartLimitBurst=2 [Service] ExecStart=/usr/local/sbin/my-app.sh Restart=on-failure The StartLimitBurst=2 and StartLimitIntervalSec=30 settings tell systemd that if the service unsuccessfully tries to restart itself twice within 30 seconds, it should enter a failed state and no longer try to restart. hard iron in Service: Restart=always RestartSec=10 (or more seconds) Delay a service: [Service] ExecStartPre=/bin/sleep 30 Build a timer that runs a script /etc/systemd/system/foo.timer ...

August 15, 2026 · 1 min · Kanehekili

Make apt-distupgrade silent

In order to ensure an update that does not need interaction from a user create an alias in your local .bashrc_aliases: alias forcedist='sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade'

August 14, 2026 · 1 min · Kanehekili

Add a new PiPy project

Publishing to PyPI First time only: Create an account at https://pypi.org Create an API token under Account Settings → API tokens Install twine: pip install twine Save your token in ~/.pypirc: [pypi] username = __token__ password = pypi-YOUR-TOKEN-HERE Every release: Run gradle build_all Build the wheel and tarball: cd dist/pypi && python -m build Upload: twine upload dist/* The GitHub Release upload (step 2 for AUR) is the only manual step that ties the two together — the AUR PKGBUILD’s source URL points to that release asset for its MD5 check.

June 21, 2026 · 1 min · Kanehekili