Do it the Hard Way - Yakka.space

welcome to yakka.space

Reading the man is Fine

Things to remember. June 14, 2025

Like a lot of old people, i have a huge e-book collection. The files are in a bunch of different formats, from a bunch of different sources; Some legal, some dubious. Jellyfin is a fine platform for serving e-books but it kinda sucks at anything that isnt an epub. Luckily Calibre has an easy to use tool: ebook-convert.One at a time conversions are super easy. just run

ebook-convert [inputfile] [outputfile]

with outputfile including the extension of the desired format. What if you have a few hundred or thousand crappy amazon files, or mobis or that format microsoft used? Of course that could take the rest of your life to work through and you are lazy so you will never do it. Knowing this i put the power of a for loop into my problem. and immediately got stuck because i suck at programming. my system runs bash by default (this will be important later) and i struggled mightily to dynamically generate a nice output file.

for $f in (./*.mobi) ebook-convert $f.epub

worked, but i got a bunch of ugly two-extension files. After some fucking around with basename and sed and other amateur shit, a random stackexchange pointed me at zsh. From the zshexpn man page:

Modifiers

After the optional word designator, you can add a sequence of one or more of the following modifiers, each preceded by a `:'. These modifiers also work on the result of filename generation and parameter expansion, except where noted.

r

Remove a filename extension leaving the root name. Strings with no filename extension are not altered. A filename extension is a `.' followed by any number of characters (including zero) that are neither `.' nor `/' and that continue to the end of the string. For example, the extension of `foo.orig.c' is `.c', and `dir.c/foo has no extension.

After installing zsh on the ubuntu box and a few test runs, i pointed for $f in (./*.mobi) ebook-convert $f $f:r.epub at my collection and calibre produced a pile of elegant epub files i will probably never read.

Fifth

Home Assistant and MIDAS. June 13, 2025

occupy California Public Utilities Commission

or monitor your energy costs and make your HA do cool stuff with the data

Fourth

Do it the hard way. December 14, 2024

whatsmyipagain?

two ways to set your ip4 address on a modern ubuntu

Third

Do it the hard way. December 13, 2024

Shells in Shells

If you have a vps with only an ip6 address and you have to connect to it from an ipv4 endpoint, you can hop your ssh credential through to the vps via another host.

first, be sure your ssh key is available to the local agent with: ssh-add ~/.ssh/id_rsa (or whatever your key is)

if you are on a mac, like me, you can add your ssh key to keychain: ssh-add -K ~/.ssh/id_rsa

enable forwarding on the client with the following in your .ssh/config:

Host server1 server2 server3 ForwardAgent yes

this will allow your jump host to pass your ssh creds to a next hop system

https://blog.johnsonpremier.net/ssh_agent_forwarding/

second

Bell Riots day August 30, 2024
Sisko and Bashir looking rioty

radical resistance

there must be a rebellion against the status quo before there can be change.

First

Do it the hard way. August 29, 2024

what is a web site

why would i want one? is social media the internet?.

right now, i am turning over and ripping off this from Tiger Pajamas

About Me

I am an old man

ill tell you more when i get better at the typing

What am i up to Now?

talk to me

@h2onolan

E Mail

Email is fine and fun but please encrypt. break the surveillance economy!

My public key