InkScape Printing

In making the labels for my NFC music tags, I ran into a fun bug when printing from InkScape. Sometimes it doesn’t print your entire image. In my case, it printed all the outline boxes for the labels but NONE of the actual images for the labels. I found out from a forum post that this is a common problem for more complex images.

The way to get around this is to”Save a Copy” of your document as a PDF format, open that PDF in your favorite PDF viewer and print that out. Ensure in the print dialog that the PDF isn’t being scaled as well, as the application might try to be “helpful” in that way (which is entirely unhelpful when you need it to be a specific size). Don’t print the InkScape drawing as a PDF since that runs into the same print bug, it needs to be save as to the format for everything to work.

“Actual Size” is the setting you want here

I use Edge to open and print PDF documents, so I make sure “actual size” is selected rather than “fit to printable area” which will shrink the document that already fits just fine on a sheet of paper.

Oddity in ESPHome

I ran into an oddity with the latest NFC Deck that I built. When starting up, it would take an hour for home assistant to connect and for me to be able to get logs out of it over WiFi with the ESPHome addon. The ESP I used was no different from the first NFC Deck that I built, and the vast majority of the configuration was the same too.

There were however a few things that were different this time based on how the ESPHome web installer and home assistant adoption process went. The big one I found was the web_server was enabled on the new one. This lets you access a little web page to see everything onboard and interact with it. I guess it just couldn’t handle the number of components and sensors onboard the NFC Deck ( 9 buttons, 27 templates, 9 lights, NFC reader, piezo buzzer, rotary), because removing that from the configuration and uploading a new firmware fixed it.

TlDr: If you have an ESP that takes FOREVER for home assistant to connect to, check to see if the web_server component is included in the build, if it is, try removing it and see if that fixes everything.

Removing Passwords from Git Repos

For those who have accidentally committed passwords, api keys, etc to a guy repo, we have a great tool available to take care of it, BFG. BFG will remove those secrets from the entire git repository’s history, not just the most recent commit.

bfg --replace-text passwords.txt

git reflog expire --expire=now --all && git gc --prune=now --aggressive

Passwords.txt is just a line delimited list of passwords. Just don’t commit this to your repo

The tool is available here on github

Changing DNS Servers with NetworkManager

I’ve never used network manager before, and right now I have a need to change the DNS settings on a system of mine that just so happens to be using it. Let’s look at the commands to change the DNS servers using network manager.

To modify the DNS server settings, we’ll want to call the network manager CLI modify connection and input the DNS settings we want to change. For the terminal, this becomes “nmcli con mod”. We then give it the connection name, “ipv4.dns” argument, and a list of the DNS servers to set. The full command can be seen below.

nmcli con mod $connectionName ipv4.dns "8.8.8.8 8.8.4.4"

connectionName can be found by command: nmcli con. In the question case, it will be "System eth0"as always, after configuration changes, restart the service

As always, after configuration changes, restart the service

service NetworkManager restart

Now we should have our new DNS servers active for our network configuration.

Resources

Vxworks 6.9 Ping

I’ve started working with VXWorks now a bit, so I feel like providing some information in working in that sort of system/environment. Some of these will be short docs and some will be more in depth. Here we’ll look at the ping command.

ping("host to ping", "number of packets to receive", "options flag")

Setting options greater than 1 for printing out ping information. The list of options flags are below.

  • PING_OPT_SILENT 0x1
    • Work silently
  • PING_OPT_DONTROUTE 0x2
    • Don’t route
  • PING_OPT_DEBUG 0x3
    • Print debugging messages
  • PING_OPT_NOHOST 0x4
    • Suppress just lookup

Converting 3MF files to STL

We’ll be using Microsoft 3D builder for this conversion. Its a simple use of the tool but it works out well. Just open your .3mf file in Microsoft 3D builder, and save it back out as an STL. I’ve found this to be the easiest way as its all free software provided by MS.

It’s no simpler than opening the file in 3d builder, clicking save as, and saving it out as a new file type.

Release info change

Just about every time I update my unifi commissioner installation, I run into an error from apt about the updated codename. I should probably remember the flag by now to get past this, but I never do. Hopefully this blog post will jog my memory next time. The error is related to the repository changing it’s codename to update the version number. An example is shown below.

Repository 'x' changed it's 'Codename' value from'x' to 'y'

This must be accepted explicitly before updates for this repair can be applied. See apt-secure(8) manpage for details.

Getting around it is easy enough if you remember the apt flag, –allow-releaseinfo-change, that’s all that’s needed.

apt-get update --allow-releaseinfo-change

Using Qemu Tools

While moving virtual machines from my unraid NAS to my new proxmox node way back when, I ended up needing to use a few of the qemu-img tools. This is a toolset for handling virtual disks used by kvm/qemu.

Conversions

Something I hadn’t realized while using unraid as my kvm host was that it wasn’t always using qcow2 format, which was my go to format, despite that the webui saying that the file format was qcow2. There were also a few virtual machines I made that ended up in different forms, so to handle these, I ended up having to convert the machines using the following commands.

The first command is to convert from a raw image to a qcow2 file.

qemu-img convert -f raw - O qcow2 /path/to/file.img

The second command is to convert from a qcow to a qcow2 file.

qemu-img convert -f qcow2 -O qcow2 /path/to/img.qcow

File Information

The other command I made use of was the info command from the qemu-img tool. This gives out useful file information for the file input to the command.

qemu-img info

These are just some useful, small commands in the qemu toolbox that can help significantly when working with the VM disk files directly.