Letters

Renewal

Sorry guys, I just can't hack reading PDF files. When you switched, you effectively stopped me from renewing when my subscription finally ran out. My eyes are worn out from sitting in front of a computer ten hours a day and spending another hour or more reading the PDF just doesn't cut it. I'll go to purchasing a CD every couple years instead, thank you very much. I realize it probably saved the mag and increased revenue, but I am just not cut out to be a subscriber to a PDF. It won't stack up on my shelf and allow me to thumb through it.


Doug Glenn

I'm not sure if you are specifically talking about the PDF version, or if you are referring to all the digital formats. Although the PDF does visually resemble the print magazine more than the other formats, EPUB and Mobi are often the better choice for reading the content, especially on smaller devices. With the Mobi version, it's possible to read Linux Journal on an E Ink Kindle, for instance. Either way, I'm sorry the experience has been unpleasant for you. Hopefully in the future, some combination of hardware and format will bring you back.—Shawn Powers

EdgeRouter Lite

It's great that you sing the praises of the EdgeRouter Lite to your readers, but be ready to point them to the community-provided fix when it stops working. [See Shawn Powers' “EdgeRouter Lite” piece in the October 2014 UpFront section.]

Part of the cost-saving has been achieved through using a poor quality USB stick as the Flash memory. Many, including mine, start to die after a year of read/write operations. When it does, it is a simple fix, but you need to get yourself a serial cable, a new USB drive of the correct size and head over to the community forum for dmbaturin's rescue kit.

Best to be prepared, or you might spend a week without a network while you work out what's happening.


Harry

I haven't experienced any issues, and as such, haven't had to look for fixes. So thank you very much for pointing me and our fellow readers to the fix! (Open Source communities, we really do make the world a better place.)—Shawn Powers

I'm Back

I had a subscription for many years to the print edition. I really enjoyed all of the articles, and over all, the journal helped me in my everyday administration of Linux servers in my company. Well, things change, and I let my subscription go.

But, now I'm back. I just subscribed again last night, and I'm going through some of the old editions. While I must admit I do like having a paper version, I find the EPUB editions work very nicely on my Kobo e-reader. I was a little skeptical at first, but since I moved from paper books to e-books, I thought I would give it a go. Of course, I don't get the pictures in colour, but that's no a big deal.

I just wanted to say thanks for keeping the magazine alive and well. I know digital-only isn't everyone's cup of tea, but it's better than just closing the doors.


Stephen

Thank you Stephen, and welcome back! I'm still nostalgic for the paper version of Linux Journal, but I'd be lying if I didn't admit the digital versions have some advantages over the dead-tree variety. And whether it's a full-color PDF on a big 10" tablet, or the Mobi version on a Kindle Paperwhite under the covers at night, having Linux Journal with me everywhere is pretty awesome.—Shawn Powers

Dave Taylor's daysago.sh

I've only just recently been able to catch up on a stack of back issues, and Dave Taylor's efforts to calculate the number of days between dates (see Dave's column in the July to September 2014 issues) has been excruciating to watch, to say the least. There are much more clever ways to go about this.

The key is to find a way to map dates onto consecutive integers. Zeller's Congruence (en.wikipedia.org/wiki/Zeller%27s_congruence) is one way to do it that has existed since the 1880s; I have implemented a slightly modified version below. Once you have such a function, calculating days between dates or the day of the week for a particular date becomes trivial:

#!/bin/sh

# Calculate the number of days to the given date,
#  starting from March 1 "year 0"
zeller () {
    year=$1
    month=$2
    day=$3

    # Adjust the year and month so that the "year" 
    # starts on March 1, and
    # therefore the "leap day" occurs at the end of 
    # the year.
    year=$(( $year + ($month+9)/12 - 1 ))
    month=$(( ($month+9) % 12 ))
    # Calculate the number of days to the 
    # start of the given "year"
    leap_val=$(( ($year*365 + $year/4 - $year/100) 
     ↪+ $year/400))
    zeller_val=$(($leap_val + $month*30 + 
     ↪(6*$month+5)/10 + $day + 1))
}

# Get today's date
eval $(date "+thismon=%m;thisday=%d;thisyear=%Y")

# Calculate its zeller value
zeller $thisyear $thismon $thisday
ztoday=$zeller_val
echo Zeller value for $thisyear-$thismon-$thisday 
 ↪is $ztoday

# Do the same thing for the given date
zeller $1 $2 $3
echo Zeller value for $1-$2-$3 is $zeller_val

# Show the difference
echo difference is $(($ztoday - $zeller_val)) days



Dave Tweed

Dave Taylor replies: Sorry that you find my column excruciating, David, but we each know only so much and then just push ahead from there. I've never heard of Zeller's Congruence, but it's definitely interesting. Your code is definitely more efficient than mine.

Do keep in mind, however, that my column has never been about “the optimal solution for a problem”, something that's rarely a shell script at all, but rather “the process of solving a problem within the shell”. I'm interested in the journey far more than the destination from a philosophical perspective.

Hope that clarifies things, and thanks again for your sample code.

ZFS and BTRFS

I read Russell Coker's article covering ZFS and BTRFS in the September 2014 issue, but the quoted passage below doesn't make sense:

ZFS supports even greater redundancy via the copies= option. If you specify copies=2 for a filesystem, then every data block will be written to two different parts of the disk. The number of copies of metadata will be one greater than the number of copies of data, so copies=2 means that there will be three copies of every metadata block. The maximum number of copies for data blocks in ZFS is three, which means that the maximum number of copies of metadata is four.

The last sentence is plain wrong. Each ZFS block is limited to a maximum of three copies.

I'm no ZFS expert nor a ZFS developer, but I think I strongly believe the ZFS copies property works like this:

  • Number of data blocks for ordinary files: min(copies, 3).

  • Number of data blocks for directories: min(copies+1, 3).

  • Number of data blocks for metadata: min(copies+2, 3).

That is, with copies=1, ordinary files are stored once, directories are stored twice, and metadata are stored three times.

With copies=2, ordinary files are stored twice, and both directories and metadata are stored three times.

With copies=3, all of the ordinary files, directories and metadata, are stored three times.


Trond Endrestol

Long Live EPUBs

Just a word of thanks, for the interesting content first of all, but more important, for the choice of format that make a real difference to me. It was about a year ago that I was first tempted to try out a subscription to Linux Journal, having generally abandoned magazine reading over the past few years while living in a place with no chance of receiving physical media. What finally made me a subscriber was your offer of non-DRM EPUB files. It's now a piece of cake on the first of every month to download the EPUB and transfer it to my e-reader, Android tablet and a backup on my hard drive. It works great and ensures that I have great reading material even where there's no network connection. To those who say the world of magazine publishing has come to an end, a great user experience like this one is a good reminder that it's just beginning! Raising a glass to the Linux Journal team for many years of success and an epub every month.


Randall Wood

Thank you for the kind words, Randall!

One of the best things about the switch to digital was the ability to offer several formats, and releasing them to all our readers via e-mail, app and so on. And we respect our readers enough that we wouldn't wrap the issues in DRM—that only causes frustration for the folks we consider family. Plus, it would be a bit strange when I had to write an article on stripping DRM from our own magazine, LOL!—Shawn Powers