Talking Jails at Semibug, 9 April 2019

I’ve written a jails talk to go with the book.

I plan to give this talk three times: a dry run at next week’s Semibug, then in May at Penguicon and BSDCan. The Semibug talk, at 7 PM Tuesday at Altair Engineering, will be the most honest version of the talk. And by honest, I mean it will still include the bad language. I’ll also have the most time to talk afterwards.

With any sort of luck, I’ll have copies of FreeBSD Mastery: Jails at all three events.

“FreeBSD Mastery: Jails” and a new novella

The paperback, hardcover, and electronic versions of FreeBSD Mastery: Jails are all available at multiple stores. Not all stores–Powell’s and Waterstones, for example, always seems slow to get my new books. But it’s at Barnes & Noble, Amazon, and several others. And the reviews seem positive:

The timing for this book release is perfect; coinciding with my exploration of the use of jails within FreeBSD. I’ve yet to read this book, however, the author being Michael Lucas, I trust it will not disappoint.

Haven’t read it, but trusts me? That’s great, and slightly worrisome. I hope I don’t find one day it’s been revised to a single star. In any event, the jails book took longer to write than any other tech book I’ve written. I hope you find it useful.

And then I have a new novella out–Winner Breaks All. And it already has a review:

Do you ever wonder if you’re a psychopath or just really efficient?
Do you think indecision is the worst possible sin?
Do you really dislike when people talk about curing you of what makes you you?

Then this is the book for you.

A fascinating and insightful exploration of “personality disorders” and what can be done about them and what should be done about them packed into a very tightly plotted story of future corporation intrigue.

Although I’ve published this on 1 April, it’s a very real post.

“Sudo Mastery 2/e” sponsorships available

People, especially those who have previously sponsored my books, keep asking me when the sponsorships for the second edition of Sudo Mastery will be available.

I don’t intend to start seriously writing this book until the end of April. May has Penguicon and BSDCan, which will take lumps of time out of my schedule. I meant to hold off. But people ask enough that it’s turned out to be easier to open sponsorships than keep answering “not yet.” So:

Here’s ebook sponsorships and print sponsorships for the second edition of Sudo Mastery.

Patronizers, of course, will get their name in this book as their patronage level dictates.

And as a reminder: I now have a mailing list to notify people when I’m ready to take their money for no good reason I have sponsorship opportunities.

Ebook sponsors get their name in the mobi and PDF versions. Print sponsors get their name in every version of the book, plus a physical gift to show my gratitude.

Why am I not starting work on this book until late April?

My health was iffy for the last couple of years. Now that the bad half of my thyroid is out, I feel much better.

But during those two years, I started four novels. I finished zero, because I lacked the energy to drag the book through the critical middle. That many incomplete manuscripts has built up into a mental bugaboo, a nasty little voice in my head that says I can’t finish a novel any more and that I’ve lost the mysterious “it” and I should get a job as a hamster cage cleaner.

If I take two-three weeks and pound hard on Terrapin Sky Tango, I will a) finish a novel and b) get that little voice to shut the heck up. I know what the rest of the book is. Sort of. Okay, I know where the climactic final fight is, that’s close enough to knowing the ending, right? And it’s a blood-and-guts novel, which comes more naturally than eating gelato. I’ve spit out some successful short stories after that bad lump of Lucas Loaf got extracted, so I know the fiction-writing brain works again.

I just need to grit my teeth and spend some time with Beaks, crushing that inner critic. Which isn’t that bad. I mean, if I get killed hanging around with her, she’ll feel bad about it.

New sponsorship announcement mailing list

Many people who have sponsored books asked me to let them know when I have another book sponsorship open. They sincerely want to help me. Between the black pit masquerading as my inbox and my unease with daring to take money for books that I haven’t yet written, however, I can’t actually accomplish that.

I have elected to outsource yet another job that I’m no good at.

In addition to my fiction announcement and nonfiction book announcement lists, I have a sponsorship announcement list.

You’ll only get mail when I open a sponsorship.

(Wow. Three blog posts in two days. Weird.)

Restore Woocommerce Users from Backup

(This post is for sysadmins. If you use WooCommerce but aren’t a sysadmin, it won’t help you. I can’t help you either. Sorry.)

I use WooCommerce on my bookstore. It’s built on top of WordPress and, as such, attracts spam users. About 40,000 of them since I opened it. The last time I investigated performance problems, I installed Bulk WP Delete to get rid of them. From everything I saw, it would only remove the spam users and leave the customers unaffected.

I was wrong. A small percentage of customers lost their accounts.

I took a backup of the database before purging the spam users, because I’m not a complete idiot. And I kept it close at hand.

If you accidentally blow away user accounts you need, and want to restore them without touching the rest of your database, you can. I used the command line. You can probably do the same using whatever pointy-clicky tool you like, but don’t ask me for help–I don’t know how to use them. Talk to your sysadmin.

The first step is to take a backup of your database. Make sure it’s a good backup, and keep it close at hand. If you screw up, you’ll need it.

I created a VM on my desktop, installed MariaDB, and restored the pre-purge database on that VM. Check the name of your Woocommerce database. Mine is named rapacity, because that’s why I run my own bookstore.

When a user tells you that their account is missing, get the email address they used to create their account. My example user is joe@bucketsofmoney.com.

On your VM, extract the user’s account information to a file.

# mysqldump --user=root -p rapacity wp_users --where='user_email="joe@bucketsofmoney.com"' --skip-add-drop-table --no-create-info > bucketsofmoney.wp_users

Go into the file and look for the user description.

INSERT INTO `wp_users` VALUES (3185...

The first number is user ID. Grab that user’s metadata.

# mysqldump --user=root -p rapacity wp_usermeta --where='user_id=3185' --skip-add-drop-table --no-create-info > bucketsofmoney.wp_usermeta

Copy these two files to your web server. Log into the web server,

MariaDB [(none)]> use rapacity;
MariaDB [rapacity]> source bucketsofmoney.wp_users;
MariaDB [rapacity]> source bucketsofmoney.wp_usermeta;

Now log into the WooCommerce interface and go to Users. Search for that account. Switch the user’s role to Customer.

The user now exists, but their existing orders are disassociated from their account. Go to the Woocommerce page, then Reports, and hit the Customers report. Under the “All Customers” tab, search for the restored account. Over on the right side, one of the buttons will give the option to reconnect previous orders to the account. That button doesn’t appear unless there are previous orders. Hit it.

The account is now restored.

If you screw up and fry the existing database, restore from backup:

# mysql -u root -p --one-database rapacity < mysql-backup-2019-03-23

As you might guess, this blog is mostly for my own later reference.

And the next time I have to delete spam users, I plan to just go into the database and drop every user who has never ordered anything. Forget plugins.

How did I solve the performance issues? My new web site has more images per page, especially the fancy new front page. Installing “WP Super Cache” dramatically improved everything.

“FreeBSD Mastery: Jails” ebook escaping!

After far too long, the ebook of FreeBSD Mastery: Jails is out. Not all stores have it yet, I’m waiting for vendor databases to finish churning.

The paperback and hardcovers? I have a paperback proof.

They should be at Amazon within a few days, and at other stores as soon as book distributor IngramSpark completes their approval process.

End-of-February Update

Yeah, we’re a third of the way into March. I spent the first week of March at a writing workshop, which I might blog about separately. My writing workshops are basically 14-hour days, because if you’re not working why did you leave the house? Anyway, how did February measure up?

10,000 words.

Yep. That’s it.

I spent the first third of the month finishing the first complete draft of FreeBSD Mastery: Jails and sending it for ready for tech edit. That’s where most of the words came from.

The middle third of the month was spent dismantling the first edition of Sudo Mastery, crying reading sudoers, and assembling the outline of the new edition. This is a little tricky, as I need to retain what made the first edition so amusing but update it for 2019. Words were made, but none of them are saleable so they don’t count–like this blog post.

The last third went to collecting FMJ tech edits and integrating them into the completed manuscript. FMJ is at the copyeditor now, and is due back by the end of the week. I expect to have print copies for Penguicon or, at worst, BSDCan. With any luck I’ll have hardcovers by then too.

That leaves me this week to do creative crap. I have a story due for Boundary Shock, so that needs to get drafted and out to first readers. I also have an absolutely business-critical task that I must finish this week. Can’t say what it is yet, but here’s a hint.

It involves crayons.

No, wait–“oil pastels.”

So, adult crayons.

So if you excuse me, I better pour a glass of milk and get scribbling.

“Sudo Mastery, Second Edition” and Cover Art

“FreeBSD Mastery: Jails” is out for tech edit. Reviews are due back on the 25th, so I can get it to the copyeditor before I leave for a writing conference on the 28th. Right now the manuscript is laying fallow and I’m not allowed to look at it. Next week, I need to be able to read what I actually wrote instead of what I think I wrote.

That means I need something else to work on. I scheduled a bunch of chores and stuff this week, plus fixing the women’s shelter computer lab, so it’s not a good week to buckle down and finish Terrapin Sky Tango. But I had enough time to dig into outlining my next tech book, a new Sudo Mastery.

This was originally prompted by various publishing industry neepery reasons, but as I’ve dug into the docs it turns out that a second edition is warranted. There’s lots of new options. Features I didn’t cover in the first edition have grown more knobs and do merit a mention. cvs2ldif is no longer a thing, thankfully. And Sun’s iPlanet LDAP server has been eaten by The Beast and rebranded as the Oracle Damnation Directory or something. Fortunately, the LDAP stuff hasn’t changed much. My LDAP setup is much smaller than when I wrote the first edition.

The hard part is, of course, the cover art.

I always post requests for suggestions on Twitter and Mastodon. I can count on three responses.

  • Munch’s The Scream — Endlessly applicable to any topic in IT. I want to do something special with this one. I don’t know what that “special” is, but it’ll come to me.
  • Any number of paintings by Hieronymus Bosch — I adore Bosch. His work will get used as a wraparound for the cover of “Ansible for {Artisan|Legacy|Heterogenous} {Systems|Networks},” which has moved towards the top of my queue but isn’t ripe yet. (That wraparound will go around the inside of the hardcover dust jacket, by the way. It’s going to be glorious.)
  • Dogs playing poker — because Americans.

Thinking about it, though: dogs playing poker might actually fit here. Specifically, “A Friend in Need.”

Dogs playing poker, and cheating
A Friend in Need, 1903

Why this one? Cheating.

I can have a couple Beasties, a couple Tuxes, a Dragonfly, and a Puffy playing poker. Sudo runs on all of those. I’d like as many actual mascots playing poker as I can get, though. I know that sudo runs on OSX, but there’s no mascot. Am I missing any big mascots? (Note that I’ve considered and consciously rejected a gnu. I won’t give press to a group whose front man declares that conference codes of conduct doesn’t apply to him.)

Also, who should be passing the card, and who should be receiving it?

“FreeBSD Mastery: Jails” first draft complete

After far too long, I have a complete first draft of “FreeBSD Mastery: Jails.”

I have quite a few FreeBSD developers doing tech review for it. They’re the folks most qualified to check my work. I’ve also made copies available to sponsors and the Patronizers who will get a copy of the finished ebook, mostly so they know that the book really exists.

This means I have a whole bunch of folks offering feedback–almost, but not quite, more than I can handle. I promised I’d post here when this book reached the point where I could use technical feedback on the book, though. So, if you’re really qualified to tech review a jails book, and you desperately want to spend your next couple weeks doing just that, drop me an email and tell me why you should be a reviewer. Don’t assume I know who you are, because I’m ignorant of dang near everyone.

Now if you excuse me, I’m gonna go stare blankly into space until my brain restarts.

End-Of-January Update

Part of having an annual goal is accountability, so: how did January go?

I wrote 27,500 words, or a little over half my goal. Given that I wrote 14,100 words in November 2018, doing my best to write full-out: I’ll take it.

Also, a big chunk of this was redrafting parts of the jails book. I don’t count rewritten words. I only count words that make the manuscript longer. If a book is at, say, 30,000 words, and I discard 5,000 of them and rewrite them in a day, how many words did I write? Well, if the book is 30,000 words at the end of the day, then I wrote… zero words.

Why count this way?

I am not paid to rewrite. I am paid to produce quality books. Left to my own devices, I’ll fiddle with text until it’s absolutely perfect. Long obsolete, but perfect.

But it’s clear that a whole bunch of what I wrote before my thyroid lobectomy was… unacceptable. I have no idea what some of those sentences were supposed to mean. So they had to go. (See the “quality” part of what I’m paid for.)

I could whinge and weasel and say that I actually wrote another 15,000 words this month, but you know what? That’s bogus. I’m a word factory. Factories don’t get paid when quality control throws out two months of product. That’s why I don’t count blog posts. (Which is part of why I don’t blog so much these days. Blogs do not pay the mortgage.)

The good news is, the jails books nears completion. I have to write about RCTL, figure out my last problems with delegating ZFS datasets to a jail, and a couple tidbits about iocage migration. Once I finish the first draft of the book, the print and ebook sponsorships close.

I’m drawing the tech reviewers for this book from the FreeBSD developers. I always give them first dibs, mind you, but the response this time was overwhelming. Seems a whole bunch of developers want this book to exist. Which is really cool! But it does mean that I have all the tech reviewers I can handle right now.

With any luck I’ll have FMJ for BSDCan. Perhaps even Penguicon, if everything goes really well.

As the tech reviewers and copyeditors do their work on FMJ, I’ll finish up Terrapin Sky Tango (Beaks #2) and get my lab set up for a second edition of the sudo book. After pounding my head on the bars of the jail for almost a year, I can really use a comparatively easy book.

I’ll leave you with the draft cover for FreeBSD Mastery: Jails. In addition to the nifty back cover quote from PHK, I also asked him to write a foreword. He was gracious enough to indulge me.