Skip to content

Instantly share code, notes, and snippets.

View cbrunnkvist's full-sized avatar

Conny Brunnkvist cbrunnkvist

View GitHub Profile
@cbrunnkvist
cbrunnkvist / RAGEMEMO.md
Last active October 10, 2025 14:27
WTF IS "Failed to connect to bus: No medium found"

Background

You are logged into a Linux console in some unique fashion, e.g. "The Proxmox web console of an LXC guest".

Problem

You want to start a service, as a REGULAR USER, using the forever 🤬 CURSED systemd in the correct fashion (i.e. "in the user's process namespace").

Since you're logged in with root on the Proxmox web console of the guest LXC and still setting things up, you su - $user in order to get a login shell session of the target user:

root@vinecraft:~# su - minecraft
@cbrunnkvist
cbrunnkvist / laptop-battery-to-nut.md
Created August 13, 2025 12:51
Laptop battery as virtual NUT UPS (via dummy-ups driver)

NUT Configuration for Laptop Battery Virtual UPS

1. /etc/nut/ups.conf

Add this section to your ups.conf:

[laptop-battery]
    driver = dummy-ups
    port = /var/lib/nut/laptop-battery.dev
@cbrunnkvist
cbrunnkvist / asound.conf
Created July 26, 2025 06:17
Linux ALSA software preamp config
# (I use /etc/asound.conf instead of ~/.asoundrc because I run `shairport-sync` as a system service)
pcm.analog_out { # Defines a new PCM (Pulse Code Modulation) device named "analog_out". This serves as a direct reference to your physical analog output.
type plug # Specifies that this PCM is a "plug" type, which means it can handle format conversions and routing to another PCM.
slave.pcm "hw:PCH,0" # Sets the "slave" PCM to the actual hardware device. "hw:PCH,0" refers to your sound card (PCH) and its analog output device (device 0).
}
# ---
pcm.preamp { # Defines a new PCM device named "preamp". This is your software pre-amplifier.
@cbrunnkvist
cbrunnkvist / xterm-256color vs. xterm-ghostty .md
Last active January 9, 2025 11:22
Tell me about the differences in terminal capabilities between these two terminfo entries...

Thinking

Highlighting key distinctions The request involves examining Unix terminal capabilities for xterm-256color and xterm-ghostty. A side-by-side ASCII table will compare color and line features, emphasizing specific differences.

Noticing key differences I’m examining xterm-256color and xterm-ghostty. xterm-256color supports 65536 color pairs and lacks advanced features. xterm-ghostty, specialized, includes extended sequences and unique capabilities.

Analyzing terminal sequences I'm working through the terminal sequences of xterm-256color and xterm-ghostty, noting differences such as color pairs, clipboard support, and advanced capabilities like status lines and full keyboard support.

@cbrunnkvist
cbrunnkvist / config.conf
Last active November 19, 2024 11:27
Neofetch: Current IPv4 details (macOS)
# ~/.config/neofetch/config.conf
# (snippet - not including the default full file here)
# This goes inside the ...
# print_info() {
# I place this just below the "Memory" section, but... Up 2 U!
prin
prin "en0 $(tput sgr0)IPv4 status"
info underline
@cbrunnkvist
cbrunnkvist / highlight-bip-39-words.js
Last active July 24, 2024 07:32
Highlight all words of a page that are also valid BIP-39 mnemonic seed phrase words
// Run in browser JavaScript Console / save under Developer Tools -> Sources -> Console Snippets for easy access
words=`abandon
ability
able
about
above
absent
absorb
abstract
absurd
@cbrunnkvist
cbrunnkvist / GRUB_INIT_TUNE.md
Last active June 13, 2024 02:31 — forked from ArtBIT/GRUB_INIT_TUNE.md
A collection of GRUB init tunes

Docs

http://wiki.thorx.net/wiki/GRUB

My tunes

That ringtone of the CTU intercom you know 😎

36600 740 22 0 10 740 22 0 60 740 22 0 10 740 22 0 180 1050 22 0 10 1050 22 0 10 1050 22 0 10 1050 22 0 20 520 22 0 10 520 22 0 10 520 22 0 10 520 22 0 10 520 22 0 10 520 22 0 10 520 22 0 10 520 22 (demo)

@cbrunnkvist
cbrunnkvist / shell
Created June 9, 2024 12:05
Colorize any log (ANSI, sed)
#!/bin/bash
echo "Starting screens with logs tailing ..."
colors="sed --unbuffered \
-e 's/\\(.*\\[ERROR.*\\)/\\o033[1;31m\\\1\\o033[0;39m/' \
-e 's/\\(.*\\[WARN.*\\)/\\o033[1;33m\\\1\\o033[0;39m/' \
-e 's/\\(.*\\[INFO.*\\)/\\o033[1;32m\\\1\\o033[0;39m/' \
-e 's/\\(.*\\[DEBUG.*\\)/\\o033[1;34m\\\1\\o033[0;39m/' \
-e 's/\\(.*\\[TRACE.*\\)/\\o033[1;35m\\\1\\o033[0;39m/'"
@cbrunnkvist
cbrunnkvist / perl locale warning
Last active June 6, 2024 10:06
How to resolve perl warnings about locale when SSH:ing from macOS into Debian/Ubuntu Linux
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
@cbrunnkvist
cbrunnkvist / performers_next_level.txt
Created June 8, 2023 13:34
Ode to the Noble Commodore 64
Ode to the Noble Commodore 64
06/03/23 13:37 PM
When, in the midst of Time's swift race,
Did mortals first spy Cyberspace,
And in their humble dwellings brought
Machines to weave their cyber-thought?
From whence did spring this wondrous beast,
This great enabler of the least,