Friday, February 5, 2021

Serial device passthrough from Linux KVM host to guest operating system

Today's challenge was to run some archaic Windows software within a kernel virtual machine (KVM) with the end goal of programming radio equipment through a RS232 serial connection.

I own a programming cable that has a male USB-A connector on one end and a male RJ-45 connector that is plugged into the serial port of a Motorola CDM1550-LS+. This connector presents a Prolific PL2303 USB to serial chipset on the USB, which is handily recognized by Linux. I was then able to get this to show up as a normal serial port under KVM, but, unfortunately, virt-manager 3.2.0 doesn't provide this capability in the UI when adding serial hardware.

Therefore, XML editing must be enabled before making the appropriate addition to the hardware tree.

<serial type="dev">
  <source path="/dev/ttyUSB0"/>
  <target type="isa-serial" port="1">
    <model name="isa-serial"/>
  </target>
  <alias name="serial1"/>
</serial>

Adding serial device in virt-manager
Thanks, virt-manager, but where's "Pass-through serial device (dev)"


Tuesday, August 4, 2020

Fixing fontconfig for proper rendering of Microsoft fonts

This post is more of a reminder / howto to *me* and is lifted from stefan.angrick's blog.

This, in particular, applies to Cambria and Calibri.

If it doesn't already exist, create a file fonts.conf in the directory ~/.config/fontconfig/  That file will need to contain the following content:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="embeddedbitmap" mode="assign">
      <bool>false</bool>
    </edit>
  </match>
</fontconfig>

Wednesday, August 29, 2018

The *actual* way of getting CUPSD to share printers

Although modern cupsd documentation describes a couple of simple steps that should theoretically enable sharing of printers on your system, one critical component is missing.

Documentation on cups.org suggests using cupsctl and lpadmin to enable sharing of a printer; this is all fine and good:
cupsctl --share-printers
lpadmin -p printer -o printer-is-shared=true

Inside of the default cupsd.conf there is a section

  Allow @LOCAL
  Order deny,allow
You need to add the Allow @LOCAL line in order to enable sharing from local subnets, which is probably the most common user case.

Afterward, restart the cups daemon.

Thursday, August 2, 2018

A better formatted version of the clinically useful depression outcome scale (CUDOS)

During the past week, including today... Never 1-2 days 3-4 days 5-6 days Every Day 1. I felt sad or depressed 2. I was not as interested in my usual activities 3. My appetite was poor and I didn't feel like eating 4. My appetite was much greater than usual 5. I had difficulty sleeping 6. I was sleeping too much 7. I felt very fidgety, making it difficult to sit still 8. I felt physically slowed down, like my body was stuck in mud 9. My energy level was low 10. I felt guilty 11. I thought I was a failure 12. I had problems concentrating 13. I had more difficulties making decisions than usual 14. I wished I was dead 15. I thought about killing myself 16. I thought that the future looked hopeless 0 1 2 3 4 17. Overall, how much have symptoms of depression interfered with or caused difficulties in your life during the past week? 0) not at all 1) a little bit 2) a moderate amount 3) quite a bit 4) extremely 18. How would you rate your overall quality of life during the past week? 0) very good, my life could hardly be better 1) pretty good, most things are going well 2) the good and bad parts are about equal 3) pretty bad, most things are going poorly 4) very bad, my life could hardly be worse