Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Self-host a pip repo

tl;dr

Use apache httpd with autoindex on. In the module project, make file pyproject.toml. Run python3 -m build and take the dist/*.tar.gz files and place in the apache web directories underneath a normalized directory name.

  • /var/www/
    • python/
      • tkstackrpms/
        • tkstackrpms-0.0.1.tar.gz
        • tkstackrpms-0.0.2.tar.gz

Using your self-hosted repo

pip install --extra-index-url http://server3/internal/repo/python/ --trusted-host server3 tkstackrpms

Or load into ~/.config/pip/pip.conf the following.

[global]
trusted-host = server3
extra-index-url = http://server3/internal/repo/python
                  https://www.example.com/internal/repo/python

Narrative

I have a small python module I wrote, and I want it to be available to me inside a python virtual environment (venv). Since I don't really want to go through whatever rigamarole would be required for a public package, and not sure I want to burden the world with my creation, I wanted to self-host a repository.

Inside a venv one can't just install my dpkg, so I needed a proper pip web repository.

Thankfully, the process is well documented and works with some basic httpd configuration I already was using!

References

See all links in-line.

Customize lintian warnings and errors

My current environment variables that help debuilds, i.e., part of my ~/.bashrc. These could, and probably should be, placed in the next file.

export DEBEMAIL=bgstack15@gmail.com
export DEBFULLNAME="B. Stack"

My current ~/.devscripts:

RMADISON_URL_MAP_DEVUAN=https://api.pkginfo.devuan.org/madison
DEBUILD_LINTIAN_OPTS="--profile stackrpms"
DEBUILD_DPKG_BUILDPACKAGE_OPTS="-us -uc -sa -i -I"

I wrote file /usr/share/lintian/profiles/stackrpms/main.profile.

# The default profile for stackrpms builds
Profile: stackrpms/main
Extends: debian/main
Disable-Tags:
 bugs-field-does-not-refer-to-debian-infrastructure
 maintainer-upload-has-incorrect-version-number
 bad-distribution-in-changes-file

And now I never have to see those by name again.

In conclusion, now I only need to run this:

time debuild

Instead of some longer invocation of debuild -us -uc --lintian-opts --profile=stackrpms which was not guaranteed to grab the lintian opts value.

References

Change the last value of this url with whichever tag you are investigating. https://udd.debian.org/lintian-tag/bad-distribution-in-changes-file

  1. GettingStartedWithDevelopment – Debathena

LibreOffice recent documents list all filetypes

LibreOffice recently changed how it displays the recent files list (aka MRU, most recently used). It now shows only the current context (Writer, Calc, Impress, etc.)'s filetype in the MRU. But if you want to revert to the original functionality, there is a feature flag for it!

You have to go into Expert Config (menu Tools -> Options... -> treeview LibreOffice -> Advanced -> button "Open Expert Configuration") and change org.openoffice.Office.Common to False. That's it! Isn't FLOSS so great, because they can add feature flags instead of just making an unchangeable decision? It's almost like there are real people involved who care about their users.

Screenshot of LibreOffice Expert configuration

References

Weblinks

  1. 'Recent Documents' List - modify? - English - Ask LibreOffice
  2. Expert Configuration

Web searches

  1. libreoffice recent file list all file types

Corsair Void RGB Elite Wireless headset notes

Notes

Status indicator colors on headset:

  • charging = amber
  • done charging = green

If you use headsetcontrol to disable lights, it also disables the mute indicator light, and the mute button on the headset.

Review

One gift to me at Christmastime was the Corsair Void RGB Elite Wireless headset.

No, nobody's paying me to say any of this (or not say any of this!). If there are any offers, let me know!

The ear cushions barely fit over my ears, and I suspect they are curling my ears down a little bit, but at least it's not terribly obvious that it doesn't fit on my ears. I don't like that the headband part leans far forward on my head to make that happen too. The shape of the ear cushions depends on it sitting farther forward on my head than I would prefer, but I can probably get used to it.

The headset did not come with a manual, so it's a good thing I searched it and found it on the WWW (reference 1). There was a printed "Safety and compliance information" booklet and a "Warranty guide," but I'd rather just have a real manual. The manual states that for optimal battery life, unplug the headset when it is fully charged. It did not suggest a timeframe for that, but the initial charge was less than 7 hours. It also didn't indicate how the status indicator would tell the user that it was done charging, so that's why I have this note.

The device worked the first time when I plugged in the USB dongle to my Devuan GNU+Linux system. I use pulseaudio on top of Alsa, and pulse easily controlled the new output and input sinks. I never had to drop down to Alsamixer but maybe I should have poked around with it.

I have no ability or interest to deal with any 5.1 or 7.1 stereo stuff. Just I could tell left and right ears worked, and the mic worked. VLC piped music to it, and Discord could play back my voice to me.

My friends recommended this model to me, and in the 5 minutes I tested with it, including with Discord, shows that it should be fine. I hope my friends appreciate that my mic will have less crackle with it.

Extra features

To disable the silly rgb lights, compile https://github.com/Sapd/HeadsetControl and run:

./headsetcontrol -l 0

Interesting links

If I want to research further, check these out.

References

  1. https://www.manualslib.com/manual/1868257/Corsair-Void-Rgb-Elite-Wireless.html

The Unix master generates a playlist

The Unix master wanted to create a playlist of music, so he wrote a small script.

files/2024/listings/generate-all.sh (Source)

#!/usr/bin/env sh
find /mnt/public/Music/Christmas/ ! \( \
   -ipath '*/Various/*' \
   -o -ipath '*/Other Artist To Skip/*' \
\) -name '*.mp3' | sed -r -e 's@^@file://@;' -e 's@ @%20@g;' | shuf > /mnt/public/Music/Christmas/all-christmas.m3u

These playlists work for VLC on a system with the correct paths mounted with nfs. But since the Unix master also wanted playlists that Jellyfin/Finamp could use, he farmed out the job to a Unix noob.

files/2024/listings/make-relative-playlist.sh (Source)

#!/bin/sh
# Startdate: 2024-10-17-5 09:52
# Purpose: facilitate converting an m3u playlist to relative paths for Jellyfin/Finamp to play well
# Usage:
#    < input.m3u make-relative-playlist.sh > input-relative.m3u
sed -r -e 's@file:///mnt/public/Music/@@g;'