Home of @CodeCleric

There is where I post random tech stuff. Enjoy!

Resurrecting languishing LXC instances

I had a number of LXC instances running various services on a 3-node docker swarm. Through various and sundry misadventures, that swarm was displaced from it’s original context and wound up at my house. Did I mention it used to be a 5-node swarm? On a different subnet?

Well, I got the swarm part working again and a couple of the LXC nodes I cared about. Then I started a new job, and kind of let it all go.

Python is not so slow

Here is a good article about the topic: The Speed of Python: It Ain’t That Bad!.

I wholeheartedly agree with the article - Python is implemented in C, with a module system that allows C libraries and code to be used in a given module. If you benchmark Python using numerical computation, but don’t allow numpy or some other C library for optimized computation, you are being disingenuous.

Python’s string manipulation routines are also implemented in C, but a user doesn’t have to install that as a separate module. It’s not an argument against Python to use the Python ecosystem when you need to optimize for performance.

CLI movie conversion with ffmpeg

.mov to mp4

ffmpeg -i my-video.mov -vcodec h264 -acodec mp3 my-video.mp4

Any to any

ffmpeg -i inputVideoName.mkv -c:v copy -c:a copy outputVideoName.mp4

This keeps the audio and video codec whatever it was.

Cooklang - a recipe markup language

Cooklang is a recipe markup langage that I ran across. It also has a cook CLI to help manage and deal with recipes. Oh, and a mobile app.

For example, from their documentation:

To define an ingredient, use the @ symbol. If the ingredient’s name contains multiple words, indicate the end of the name with {}.

Then add @salt and @ground black pepper{} to taste.

To indicate the quantity of an item, place the quantity inside {} after the name.