January “SSH Mastery” sales, by the numbers

I’ve promised several authors to share the results of my self-publishing experiment with SSH Mastery. I don’t have complete data yet, but I do have sales numbers for January from Amazon, B&N, and Smashwords.

Some caveats here:

  • This includes only “SSH Mastery.” I have removed my fiction from the totals. (Fiction sales are considerably lower, but growing.)
  • February’s initial results are much lower than January’s. January’s sales are obviously to my “hard-core fans” and people close to the community.
  • My expenses aren’t yet totaled, as the print version isn’t available yet. I expect them to come in at roughly $3000. The majority of this expense is the class I took to learn how to self-pub properly, which is a one-time expenditure. A business person would argue that this expense doesn’t count, as it should be spread across multiple books. But as an author running a test project, I have to count this expense somewhere, so it’s attached to this book. Also, these expenses are only cash out of pocket; they assume my time is free.
  • On a related note, an accountant would probably find my reasoning naive. I already have two careers (writer and engineer), I’m not going to add a third.
  • I’m not going to regularly report sales numbers to the general public. I will say when I break even.
  • Before I published, I expected to make most of my sales through Amazon, then Barnes & Noble, and then Smashwords last. I had no idea of how many sales I would make, but I figured they’d be in that order. Let’s see how this compared to reality.

  • Amazon Kindle: 123 books sold (92 US, 12 UK, 14 DE, 2 FR, 1 IT, 2 ES), for a total of $810.27 USD at today’s exchange rates. (Amazon reports European royalties in euros or pounds.)
  • Barnes & Noble: 4 books sold, for $25.96 USD.
  • Smashwords: 76 books sold, for $607.65
  • Total: 202 books sold, for a total of $1443.88
  • Some interesting things here:

    I’m shocked at how low Barnes & Noble sales are. The book was available on B&N a couple days after Smashwords and Amazon, mainly because getting the book through B&N’s internal systems took longer. Apparently my readers don’t use the Nook.

    Smashwords sales as a proportion of total sales is much higher than I expected.

    Averaging the royalty per book is also interesting.

    Amazon: $6.58/sale
    Smashwords: $7.99/sale
    B&N: $6.49/sale

    You’ll hear lots of commentary about how Amazon offers a 70% royalty on ebooks. This has all sorts of exceptions and exclusions, where you’ll only get a 35% royalty. My effective average royalty at Amazon is about 65%, so that’s not bad.

    Barnes & Noble, at just under 65%, offers the worst net royalty.

    Smashwords: I love you. Just saying. My core audience really wants the book as PDF, and Smashwords offers PDF, epub, mobi, and all the other big ebook formats with one purchase. And they pay me the highest per-sale royalty. I still haven’t gotten the book through Meatgrinder into the other channels they feed, such as iBooks and Kobo. Once that happens, I expect to see their percentage rise. I wouldn’t be surprised if they overtake Amazon.

    The real lesson is: sell your work through all available channels. You can’t tell who will buy what from where.

    Installing WHMCS on FreeBSD 9.0-RELEASE

    Or, if you prefer: “WHMCS versus PHP.” Blogged for the next sysadmin searching Google.

    $DAYJOB recently acquired WHMCS to help automate virtual server provisioning, billing, and so on. According to everything I’ve read, WHMCS runs just fine on FreeBSD, so I installed the prerequisites on a 9.0-i386 machine. As with any server for PHP-based Web sites, I verified that the server processed PHP with a simple phpinfo() page. I then grabbed the WHMCS tarball (no link, you must be a customer, sorry), extracted it into the directory, ran the setup program, fed in the database information and license key…

    ..and it wouldn’t run. Calling up the app resulted in a blank page. WHMCS provides troubleshooting instructions for this exact circumstance. I enabled the requested debugging, but couldn’t get WHMCS to produce an error. Adding a bogus argument to my phpinfo() test page made an error appear, so I was confident the failure to display an error message wasn’t a server configuration problem.

    This comes down to FreeBSD’s PHP packaging.

    When you install PHP on the popular varieties of Linux, you generally get a whole slew of PHP extensions with it. BSD-based systems only install exactly what you ask for: if you want PHP but don’t request any extensions, you won’t get any extensions.

    I agree with this approach. Every piece of installed software needs patching and updating. Every piece of installed software is a potential attack vector. If I don’t need a piece of software, I don’t want it on my server.

    WHMCS doesn’t list all of the required extensions. They assume you have a kitchen-sink PHP install. After some reading and research, I found that WHMCS runs fine with the following PHP modules and extensions installed. I’ve included the version numbers for reference, but you should be able to just pkg_add -r all of these by name.

    php5-5.3.8
    php5-bz2-5.3.8
    php5-ctype-5.3.8
    php5-curl-5.3.8
    php5-dom-5.3.8
    php5-extensions-1.6
    php5-filter-5.3.8
    php5-gd-5.3.8
    php5-hash-5.3.8
    php5-iconv-5.3.8
    php5-json-5.3.8
    php5-ldap-5.3.8
    php5-mysql-5.3.8
    php5-openssl-5.3.8
    php5-pdo-5.3.8
    php5-pdo_sqlite-5.3.8
    php5-phar-5.3.8
    php5-posix-5.3.8
    php5-session-5.3.8
    php5-simplexml-5.3.8
    php5-tokenizer-5.3.8
    php5-xml-5.3.8
    php5-xmlreader-5.3.8
    php5-xmlwriter-5.3.8
    php5-zip-5.3.8
    php5-zlib-5.3.8

    I’d really like to trim this down to only what is strictly necessary to run WHMCS, but that information doesn’t seem to be available. I could methodically remove and reinstall extensions to see when WHMCS breaks, but I have better things to do than debug missing docs for a commercial PHP app.

    On the plus side: now that WHMCS is installed, it’s really slick. I’m looking forward to using it. Actually, I’m looking forward to having other people use it for me, so I can do more interesting things than provision servers, accounts, and billing.

    Basic DNSSEC with BIND 9.9

    Everybody knows that DNS is insecure, and DNS Security Extensions (DNSSEC) is supposed to fix that. I know that several of my readers consider DNSSEC suboptimal, but it’s the standard, so we get to live with it. I recently got DNSSEC working on BIND 9.9. As I write this 9.9 is in Release Candidate state, but the functionality should be basically unchanged. My goals for DNSSEC on BIND were to manually edit my zone files, but have the DNS server maintain the keys. BIND 9.9 makes this possible.

    This is a limited example of how to get basic DNSSEC working. To use it, your registrar must support DNSSEC. There’s ways around this, such as DLV, but they’re out of scope for this document. Also note that I’m not covering key rotation. That’ll be a future post.

    You also must have a domain whose parent is signed. The root zone, .com, .net, and .org are all signed, but not all top-level domains are signed. Verify your particular TLD before proceeding. Again, you can use DLV for these orphaned domains, but that’s out of scope for this document.

    I’d also suggest that you read the BIND 9.9 ARM first. But if you were going to bother to do that, you wouldn’t have done the Google search to find this article.

    You will almost certainly have service interruptions as you learn DNSSEC. I strongly recommend that you set up a test server for your DNSSEC testing. Move a test domain to it. You cannot test DNSSEC on a private domain; it must be a real, Internet-facing domain. Configure dnssec validation on this test server.

    You also need a server that provides DNSSEC resolution, but will not be authoritative for your test domain. I’m assuming that you configure DNSSEC resolution on your production server. If you only have one DNS server, you can use an offsite public resolver such as unbound.odvr.dns-oarc.net. (Note that Google DNS, like most public DNS servers, does not validate DNSSEC.)

    Verify that DNSSEC resolution works on both servers with dig(1).

    $ dig www.isc.org +dnssec

    ; <<>> DiG 9.8.1-P1 <<>> www.isc.org +dnssec
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28734 ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 5, ADDITIONAL: 13

    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags: do; udp: 4096
    ;; QUESTION SECTION:
    ;www.isc.org. IN A

    ;; ANSWER SECTION:
    www.isc.org. 600 IN A 149.20.64.42
    www.isc.org. 600 IN RRSIG A 5 3 600 20120305233238 20120204233238 21693 isc.org. IKekIJVV99bkTYw4L2KG/xZpQ+BYlCK0IDSsWXKZRD8ceR/VNcfNFxV2 5VK51Fqmy...
    ...

    Two interesting things here. First, the ad flag indicates that this is “authenticated data,” also known as DNSSEC-validated. Second, the RRSIG (Resource Record Signature) is the actual DNSSEC signature. isc.org is DNSSEC-validated.

    DNSSEC generates a lot of key files. You don’t edit these key files by hand, and you rarely look at their contents, so use a separate directory. If you have a lot of zones, you’ll want a separate directory for each zone.

    You’ll need a directory for keys.

    $ mkdir /etc/namedb/keys

    To start you need a “master” key to sign other keys with (the Key Signing Key, or KSK), and then a key for each zone (the Zone Signing Key, or ZSK). Your nameserver must be able to read these keys.

    # dnssec-keygen -f KSK -a RSASHA1 -b 2048 -n ZONE example.net
    Generating key pair…………………………………………………………………………………………………………………………………………….+++ ……………………..+++
    Kexample.net.+005+38287
    # dnssec-keygen -a RSASHA1 -b 2048 -n ZONE example.net
    Generating key pair………….+++ ..+++
    Kexample.net.+005+55896
    # chown bind:bind *

    We’ve generated two key files: Kexample.net.+005+38287 (the KSK) and Kexample.net.+005+55896 (the ZSK).

    Now that you have keys, let’s look at configuring named and the zone itself.

    I recommend you enable DNSSEC logging in named.conf. If you have trouble, the DNSSEC log will identify the problem. (Actually Understanding the log is left as an exercise for the reader, the ARM, and their favorite search engine.) Make a separate directory for the log.

    # mkdir /etc/namedb/log
    # chown bind:bind /etc/namedb/log

    Then add a logging stanza in named.conf. With this configuration, the log file will never grow larger than 20Mb.

    logging {
    channel dnssec_log {
    file "log/dnssec" size 20m;
    print-time yes;
    print-category yes;
    print-severity yes;
    severity debug 3;
    };
    category dnssec {
    dnssec_log;
    };
    };

    Now set up a zone. Here I add DNSSEC data to my test domain.

    zone example.net {
    type master;
    file "master/example.net";
    key-directory "keys/";
    inline-signing yes;
    auto-dnssec maintain;
    };

    Reload your nameserver. You’ll now see the following files in the zone file directory:

    example.net
    example.net.jbk
    example.net.signed
    example.net.jnl

    Inline signing works by taking the zone file you manually maintain, transforming it into a dynamic zone, and signing the dynamic zone. DNSSEC changes are made to the journal file. As a result of this, the serial number shown to the world can differ from the serial number in your file. That’s a minor change that I’m perfectly happy to live with.

    You should now see RRSIG records in your test zone. You will not see the AD flag, however. You never see an AD flag for a zone on its authoritative nameserver.

    So, how do you test DNSSEC on your domain? You might try your second nameserver. It won’t show the AD flag either, but it should also show the RRSIG records.

    DNSSEC works via a chain of digital signatures. The root zone is signed, and your server knows about that signature. Most delegations beneath root are also signed. Your parent zone doesn’t know to trust your KSK until you tell it. This is where your registrar comes in. Create a delegation signature key (DSKEY) from your KSK.

    # dnssec-dsfromkey Kexample.net.+005+38287
    example.net. IN DS 38287 5 1 E8C01C990ACC8CEDF48379EDF9EDAB5389A9CB4E
    example.net. IN DS 38287 5 2 57EC9364CEAE50B17C0C251950B4E5B8870F6A479A94C3A92359A623 39703D53

    Copy these two lines and paste them into your registrar’s DSKEY interface. Your registrar might take one or both types of DSKEY records. I found that GoDaddy took both, but I had to remove the space from the SHA-256 (second) record.

    When your registrar updates the TLD’s zone, DNS servers that are not your authoritative zone will return the DS flag. You’ll have functioning DNSSEC.

    (Thanks to Jeffry A. Spain for his invaluable hints in debugging my first DNSSEC setup.)

    New review of SSH Mastery, and print pre-order status

    There’s a new review of SSH Mastery over at DragonFlyBSD Digest. I’m delighted that Justin liked the book. (Mind you, I’m appalled that he’s actually reading and paying attention to the minutia I occasionally post here. But I’m delighted he liked the book.)

    On the pre-order front: Austin Hook just ordered 200 copies of SSH Mastery for the OpenBSD Project. He will be listing the book for pre-order “soon.” I’ve given them the greatest discount possible, and they’ll be selling the book for list price. Proceeds will go to support OpenBSD/OpenSSH development. I will fill Austin’s order at the first opportunity.

    When is that? When the book exists in finished form. I reviewed the print layout today, made some corrections, and sent them back to the layout person. If she doesn’t kill me outright, I’ll be able to order proofs in a few days. If the proofs show an error, I do another cycle. (Print pages look nothing like on-screen pages.) Once I approve the proofs, I can order books.

    A normal publisher (whatever that means) would have a scheduled print time. They’d push out the release date, and delay the book if necessary to fit that window. That gives them a known release date. Me, I’m not going to set a sufficiently-padded arbitrary date when I can get them sooner.

    And for those of you who wonder when I’m going to quit pushing my wares and post techie stuff again, I’ll have a post on DNSSEC deployment next week.

    SSH Mastery now #2 best-seller on Smashwords

    Smashwords is an ebook retailer that sells books in ten different electronic formats in one purchase. If you want a book in .pdb for your Palm Pilot, in PDF for your laptop, and epub for your Nook, that’s where you go.

    I just saw this in their best-seller list.

    I’m at #2 site-wide, right behind the Fat Loss Bible.

    The implications are obvious: I must write a book for fat techies. I’ll make a fortune!

    SSH Mastery Review from Peter Hansteen

    Peter has already read and reviewed SSH Mastery. While a few of my readers have been kind enough to post reviews on Amazon and Smashwords (which I very deeply appreciate), Peter’s is the first long review.

    And here I should confess something: The very existence of SSH Mastery is Peter’s fault.

    Peter will be doing the tech review of Absolute OpenBSD 2nd Edition. He looked over the outline and said “You need more SSH in here. You need SSH here, and here. More SSH love!” So, I listened to him. The SSH content overflowed the OpenBSD book from a planned 350K words to closer to 400K. I can’t comfortably read a 400K-word book. So, something had to give. And it was SSH.

    And to again answer what people keep emailing me and asking: yes, a print version is coming. Yes, I am writing AO2e. When I have dates, I will announce them.

    SSH Mastery Round-Up

    I went to bed last night, satisfied that I had gotten SSH Mastery uploaded to the various ebook sites. I figured that I’d contact some people about doing reviews this weekend, maybe generate one or two sales. Awoke to discover ten copies sold while I slept. And I received a whole bunch of messages via Twitter, Facebook, and email. Rather than try to answer them all individually, I decided to answer here.

    If you’ve bought the book: thank you! Please consider leaving a review on your ebook site and/or Amazon, it would seriously help me out.

    SSH Mastery is currently available via Smashwords and Kindle, and Nook. The Nook version seems to be missing it’s cover, I’ll take that up with B&N once I post this.

    Want it in your preferred format? Permit me to direct you to Smashwords. Buy the book once, get it in any or all of ten different formats, from epub to PDF to old formats like PalmDoc and LRF. It doesn’t sync to your device, but you can read it anywhere, and it’s stored “In The Cloud (ooooh!)”. There is no DRM, on any version where I control DRM. SSH Mastery is only $9.99. If someone goes to the trouble to illicitly download a tightly-focused, task-specific tech book that’s less expensive than lunch, well, they suck. Please tell them that.

    Once Smashwords finishes digesting the book, they will feed it to iBooks, Kobo, and all the other online retailers. I have no insight into how long this will take. If you sight SSH Mastery on iBooks or Kobo, please let me know! Actually, I’m shocked that Smashwords was able to process the highly-formatted original document. Their Meatgrinder only takes Microsoft Word files, and my file was full of headers and in-document hyperlinks and text styles and images. It’s obviously much improved over the early days. Following their instructions works. Amazing, that.

    There will be a print version. The print layout person works from the same files I feed to the ebookstores. The print will take time. She will lay out a chapter for me, so that I can approve a rough design. She will then lay out the entire book. That will give us a page count and let me do the index. We’ll proof that a few times, to catch any errors, and then kick it out to the printer. But I didn’t want to delay the ebook until the print was ready.

    The page count is critical. Page count dictates the price. I’m 90% confident of the price, but I can’t announce it until I know. Once I have the price, we can start taking pre-orders. Now, I don’t have the infrastructure to take pre-orders. Any number of third-party companies would hold your money in escrow until I delivered the books to them. That would take a whole bunch of legal agreements, and frankly, I’m too dang lazy to be bothered.

    Especially when the OpenSSH/OpenBSD folks already have that infrastructure, and they have an existing trust relationship with the community. I plan to let them have the books at my cost plus expenses (shipping and CreateSpace fulfillment costs, not sunk costs), to funnel some money into OpenSSH. CreateSpace is doing the printing, so I don’t think I can offer an exclusivity window — once I order a crate of books, Amazon will list and ship to their direct customers. But I will ship those books at the earliest opportunity.

    I’m also looking for a solution to let me sell print/ebook combinations. That’s how I like my books, after all. I can work out a cost-effective solution that doesn’t involve me hand-mailing books, I’ll do it.

    But you want the book now. You really do. Mind you, I know all of my readers are good people. You don’t use passwords with SSH. You tightly secured all of your SSH servers. You know when and how to forward ports, and X11, and when to use a SSH VPN. But you know people who need this book. You know people who think that SSH-ing in as root with a password is a good idea. Make them buy the book. For their own good.