Installing Packages from Koji

Quick script to install the version of PHP that’s been patched for the two critical vulns today

dnf install koji

mkdir -p /root/php-8.5.12-koji
cd /root/php-8.5.12-koji

koji download-build --arch=x86_64 --arch=noarch php-8.5.12-1.fc44

# Select only RPMs whose package name and architecture are already installed.
rpms=()
for file in ./*.rpm; do
package=$(rpm -qp --qf '%{NAME}.%{ARCH}' "$file") || exit 1
if rpm -q "$package" >/dev/null 2>&1; then
rpms+=("$file")
fi
done

if ((${#rpms[@]} == 0)); then
echo "No downloaded RPMs match installed packages."
exit 1
fi

printf 'Selected: %s\n' "${rpms[@]}"

dnf install "${rpms[@]}"

Bernette B70 Reminder: Back Up Your Position

The Bernette B70 has a standby mode (Eco) for when you need to pause a job. Very convenient – especially since we’re still at the “babysit it the whole time” level of machine embroidery usage. Except — it appears that (at least for long-term standby), the system loads before the USB drive is mounted. It has cached information for the job preview, but it doesn’t actually have access to the stepper instructions. The machine essentially loses its place.

Which is fine if you know where you were when you stopped. There’s a sequence control section (#3 below)

Which allows you to use the upper and lower knobs to advance through the instructions. Upper knob is a slow advance, lower makes bigger jumps. You can also click on the magnifying glass and type in where you were. If, of course, you had backed up where you were when you paused the job!

Threads – Pixel Art to Embroidery Stitch Digitization

Learning how to use Threads to digitize pixel art into embroidery patterns. I thought it might be easier to learn with a simpler design. So I created a quick lace/filigree cat silhouette.

If this is your first time designing for this hoop size, go to settings

Scroll down and use the drop-down to select “Custom Size” in the hoop selection

Input the dimensions of the hoop and give it a name (The 6×10 frame for our Bernette is called “Bernette B70 – Large”

You can also adjust some values to control the stitch density — these are the settings I am using for dense designs being embroidered on t-shirts.

Upload the image —

Adjust the size (if needed), select the number of thread colors. For now, I’m leaving the fill method set to the defaults!

Scroll down and click the “AI Layers” button

This will break your image into layers and begin the digitization process.

Click on each layer – you can adjust the settings used to compute stitches for the layer. You can change the color, use a different fill pattern, adjust density settings.

Alternately – you can click “Digitize” which doesn’t provide as much editing prior to digitization.

Don’t forget to save the digitized project

You can sort the patterns by “Client” — I made sections for each of us

Clicking on the project will bring up a summary where you can download a DST file for use in an embroidery machine or the “Worksheet”, which is a PDF with the thread order.

 

Ink/Stitch and Threads

I had been trying to use InkScape and Ink/Stitch to digitize images for embroidery patterns. While I am certain that not really knowing what I’m doing is a huge component … I never manage to get a good pattern. The digitization process also sucks up all the resources on my laptop before falling over and requiring a restart. I was going to borrow Scott’s gaming laptop (lots of memory, lots of CPU, and GPU). Then I came across Threads — a Python Uvicorn server that uses the Ink/Stitch API to digitize images into embroidery patterns.

There was a significant limitation that I assume comes from the documented usage: you cannot create a pattern with a large number of unique colors. You can select up to six thread colors. However, I wasn’t going to run the tool on a laptop. I’m going to run it on a VM on our big server. Plenty of memory and processor available. And it can chug along, doing its thing, without impacting other VMs. So I created a fork that allows up to 32 unique thread colors (more than you probably want).

I want to digitize this mushroom design I created for Scott:

Blender Script: Moving Object

This script moves the selected object to be centered on the world origin but it sits on the z plane rather than half of it being below the z plane.

 

import bpy
from mathutils import Vector

# Put the origin at the center of volume
bpy.ops.object.origin_set(
type='ORIGIN_CENTER_OF_VOLUME',
center='MEDIAN',
)

for obj in bpy.context.selected_objects:
# The bounding-box corners are stored in object-local coordinates.
# Transform them to world coordinates before finding the lowest point.
lowest_z = min(
(obj.matrix_world @ Vector(corner)).z
for corner in obj.bound_box
)

world_matrix = obj.matrix_world.copy()
world_matrix.translation.x = 0.0
world_matrix.translation.y = 0.0
world_matrix.translation.z -= lowest_z
obj.matrix_world = world_matrix

Changing Password in an RDP session in an RDP session

You can use Ctrl-Alt-Del to bring up a menu to invoke a password change on your local machine. When you RDP to a box, there’s Ctrl-Alt-End but when you are using a jump box (rdp to box1 to rdp to box2), ctrl-alt-end lets you change the password on Box1, but how do you change the password on Box2?

explorer.exe shell:::{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}

Run that command

And you get the menu to change that password