“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.

When To Buy Your Own ISBNs

In 2017, I bought a block of one thousand ISBNs. Other authors have been asking me why I did that and if they should do the same. I’m writing this blog post so I can point them at it. The short but glib answer is, when the missed opportunity cost of piggybacking on Amazon’s (previously CreateSpace’s) free ISBNs exceeds the expense of buying your own ISBNs.

But let’s break this down a little more.

Most indie authors don’t sell many books. If you have only one or two titles, don’t even think about getting your own ISBNs. Spend your money on editing your next book.

If your book does sell, chances are it only sells on Amazon. Amazon doesn’t care where an ISBN comes from. I imagine they’d happily ditch ISBNs, except for that pesky Expanded Distribution to the wider world of bookstores.

And that wider world of bookstores is where your own ISBNs come in.

If you are regularly making sales in Expanded Distribution, you’re selling print to the world outside Amazon. Those are the folks where ISBNs matter. The reason that they matter isn’t because they check your ISBN against a list of Amazon-owned ISBNs and refuse to buy. It’s because:

the owner of the ISBN controls where the book can be printed.

This is vital.

If your ISBN comes from Amazon, you can only get your book printed at Amazon.

If you own your ISBNs you can have your book printed anywhere. Use Amazon and IngramSpark alike. If a book really takes off and you need to do an actual print run, you can do that and slip those printed books into the supply chain with the same ISBN. Stores and readers don’t care who printed the book so long as it’s of reasonable quality and doesn’t fall apart as they’re reading it. (I’m looking at you, Robert Jordan.)

Your own print run might seem ambitious right now, but while the plan “I’m gonna sell a million copies a year” might not be realistic, the plan of “If I sell a million a year I want to do it in the least profitable way” is just plain daft. Just as you have a backup plan in case of failure, have a route open to maximize success.

So how did I make this calculation?

One, I was being directly contacted for bulk orders on books in locations I couldn’t serve. I could drop-ship books from CreateSpace US, but many of these orders came from overseas. And CreateSpace wouldn’t put customs paperwork on overseas shipments, so I’d have to have the books shipped to me, prepare the customs paperwork, and ship them over to Europe or Asia or wherever. The shipping costs on orders of even 20 books were prohibitive.

The cost of a lost opportunity.

Additionally, my Expanded Distribution sales were growing. ED pays about 40% of cover price on sales. IngramSpark lets you set your own rate, but “50% no returns” is perfectly acceptable. That’s an extra 20% on each unit sold.

I counted my annual sales through Expanded Distribution. I figured out how many ISBNs I needed to buy. I assumed that I’d get an extra 15% on each ED sale (because I’m pessimistic), and that sales would go they way they had for last few years (because I had to pick a value). Yes, these are fragile assumptions.

When the calculation showed that the increased proceeds from IngramSpark sales would pay for the whole block of ISBNs in about a year, and everything after that would be extra income, I bought my ISBNs.

How did I decide how many ISBNs to buy?

I averaged how many titles I publish in a year. Multiplied that by the number of writing years I hope to have left. The math said I’d need a little less than 300 ISBNs. As I’m in the US, it was cheaper to buy 1000 ISBNs than 300, because Bowker is milking the US ISBN market for every last penny.

So I bought 1000. (Before you ask, I can’t resell my extras.)

I am now done with the ISBN problem forever. FOREVER.

To my shock, the investment paid off in three months. My unit sales almost doubled. My books sell in places they never could reach before, mostly in Asia. I sell print books in Malaysia and India. Will that happen to you? Dunno. It won’t hurt your sales, though.

And I have enough to experiment with things like hardcover books. Which, to my surprise, sell. Even in Asia, where they’re not merely expensive but fiendishly expensive.

Once you have your own ISBNs, the real fun begins. You need to re-issue all existing titles under your own ISBNs, so that you can control the printing. This is vital. Someone that wants to order your book will look up the title in their online system and order it by ISBN. If you have one version of the book on Amazon with one ISBN, and the identical book with a different ISBN in IngramSpark, who knows what they’ll wind up ordering? Basic business says you must have a consistent product line. When two hundred people order your book, you don’t want them either getting two different products or, worse, half of them unable to get your book because it’s not available in their area under that ISBN.

This means you need to prepare for success.

Changing your ISBNs means changing your book interior. Adding IngramSpark as a printer means changing your cover.

Are you prepared to make those changes?

Yes, your cover and interior designers are professionals and would never screw you over. Maybe your designer is a dear friend or an award-winning master with a sterling reputation. But people get hit by busses, leave the field, or eaten by antelopes all the time. If nothing else, there’s retirement.

You need not only the finished product, but the source files for them as well. (Some designers will offer digital escrow services, which can be okay so long as it’s at their expense.) When the time comes for you to update fifty titles with your own ISBN, the last thing you want to have to do is redo the covers of your best-selling series because you can’t change shift the design as needed to match IngramSpark’s requirements. You want to have your designer or their successor open the original design, shift a couple items a millimeter or two, and be done.

Do the math now. Figure out how many you need and what the cost would be. Once you know the answer: forget about it until you hit those numbers. Put your energy and your worry on the thing that you can control: your craftsmanship and the amount of time you spend making words.

Because making words is how you get to have problems like needing your own ISBNs.

FreeBSD Journal column

As of the January issue, the FreeBSD Journal will be free. You can access it, and all back issues, through a browser. You’ll need to register for it–the Foundation is still using it for fund-raising, but in a less direct manner.

So it’s probably time for me to confess: last year I got suckered into writing a letters column for them. I, of course, wanted to call it “Letters to ed(1),” but the board got all prosaic and went with “We Get Letters.”

What sort of letters column would I write?

Here’s the first.

Hi Michael,

We were brainstorming column ideas for the FreeBSD Journal, and Kode Vicious suggested that you might be willing to handle a “Letters” column for us. People would submit their questions to the Journal, and you’d answer them for us. Any chance you’d be interested?

Best,

George V Neville-Neil

FreeBSD Foundation President

Hi George,

This is a terrible idea. It’s just awful. This is the Internet age. Nobody reads letters columns, advice columns, or anything like that. We have Stack Exchange, and all kinds of places for people to beg for advice.

FreeBSD has a whole bunch of places where users can go to get specific help. Help ships with the system, in the man pages. Where a bunch of Unix-like operating systems made this absurd decision to bundle manual pages separately, FreeBSD ships with the manual. Actually, you can’t not install the manual. You could build a FreeBSD that doesn’t include the manual, of course, but to do that means reading a whole bunch of man pages.

People say that the manual isn’t a tutorial, and they’re right. That’s why FreeBSD has the Handbook and a whole bunch of articles. Unlike the man pages, you can choose to not install those on a FreeBSD host. You can browse all of the documentation online at https://docs.freebsd.org, though.

New users can start with the FAQ (Frequently Asked Questions) file, which contains literally dozens of questions and answers. It goes into everything from hardware compatibility to ZFS, and while some of the gags in “The FreeBSD Funnies” have aged dreadfully—nothing scratches in memory banks these days, they fixed that bug back in 1996—the rest of the document is rock-solid. Looking at it now, I realize just how useful it is to new users. I still remember that feeling of enlightenment when I understood why du(1) and df(1) give different answers for disk space usage. Setting aside an hour to read the FAQ will give new users that enlightened feeling over and over again.

Then there’s the Handbook. It’s broken up by tasks. If a user’s question has a little more depth than what’s in the FAQ, the Handbook is there for you. Some of the material orients the reader, and is well worth reading so that new FreeBSD administrators understand why there’s so much in /usr/local when everybody else just dumps everything in /etc and /bin.

Plus there’s all sorts of FreeBSD-related sites these days. Even my blog has some FreeBSD tutorials on it.

If anyone did write in for help, it would be because they didn’t use these resources.

==ml

Michael,

Not necessarily. People do have problems that aren’t yet documented. We really think a letters column could be useful addition to the Journal, and that you’re the right person to write it.

Best,

George

George,

Okay, let’s talk about the those folks who have issues that truly aren’t in the Handbook.

Back when I started with FreeBSD, you got help via the FreeBSD-questions@FreeBSD.org mailing list. And it’s still around today. The people on that list want to answer questions. They subscribe specifically so they can help people with their issues. Those brave people volunteer their time to answer user questions. What can I do that those heroes can’t?

For those young punks who’ve forgotten how email works, there’s a FreeBSD forum at https://forums.freebsd.org. Unlike the mailing list, the forums are broken up by category. Users can delve into detailed discussions of installation, storage, hardware, packages, or whatever. Whenever I look at the forums, I find interesting discussions.

There’s a quarter century of problem-solving in the mailing list archives. What can I say that hasn’t been said many times over?

These channels are really suitable for issues with particular hardware. The Handbook and FAQ are permanent fixtures in the FreeBSD ecosystem—they’ve been around for decades. But if some chipset in your brand-new knock-off laptop is causing you grief, you can search the mailing list or the forum to see if anyone else has that same issue with that hardware.

Users who can’t be bothered to DuckDuckGo the mailing list archives or search the forums certainly aren’t going to bother composing a coherent letter to me.

==ml

Michael,

Seriously, there’s people out there who have problems that aren’t in the Forums or mailing list archives yet. You really could help them. When they see how helpful you are, it might even encourage them to buy your books.

Best,

George

Dang it, George, you just don’t give up, do you?

Okay, fine. Let’s walk this through.

A user has a problem. A truly unique problem, that doesn’t appear anywhere in the mailing list archives, the forums. The only reference on the Internet to a problem even vaguely like this is on a darknet site and in Siberian. They’re sincerely and honestly in trouble.

Before anyone could help this user, they’d need to describe their problem in a useful way. This means they’d have to send a complete description of the problem. Most people who compose a request for help can’t be bothered to give the output of “uname -a” and a copy of dmesg.boot. They can’t trouble themselves by giving actual error output or the contents of /var/log/messages. Or they “helpfully” strip out stuff they think is irrelevant, like the messages saying “PHP is dumping core” that appear all through their web server logs.

And that’s another thing. People want help with stuff that has no relevance to FreeBSD. They know it has nothing to do with FreeBSD. And yet they send a message to a FreeBSD mailing list? I mean, that’s just rude.

And speaking of rudeness—would it hurt people to be polite when they ask for help? Anyone on the mailing list or the forum who takes time to help a user is volunteering their own time. They have better things to do than to put up with your tantrum. I mean, I get that computers can really torque people off. I myself have more than once stood on a rooftop and screamed foul obscenities at the buffer cache—who hasn’t? But there’s no need to take that out on someone who’s trying to help you.

Most often, the mere act of writing the problem description is enough to make my own brain to solve the problem.

And nothing short of high voltage would encourage people to buy my books.

So, no. Let users with trouble go to the mailing lists or the Forums. I have enough to do.

==ml

Michael,

We’ll only send good letters. I promise.

Best,

George

No. No, no, no.

NO.

Do you have any idea how many books I still have to write in my lifetime?

Ain’t gonna. Can’t make me.

==ml

We’ll pay you in gelato.

George

George,

Curse you. I’m in.

But tell Kode Vicious that if he drops my name again, he’s going home in a bucket.

==ml

Questions?

Contact letters@freebsdjournal.org. Letters will be answers in the order that they enlighten or amuse the columnist.

Michael W Lucas has been a sysadmin for over twenty years. His latest books include “SSH Mastery, 2nd edition,” “Ed Mastery,” the third edition of “Absolute FreeBSD,” and “git commit murder.” Learn more at https://mwl.io.