Form 1120S Schedule K-1 Worksheet

After my corporation bought back some stock certificates, the method I used to calculate Item F, “Shareholder’s percentage of stock ownership for tax year,” became more complex. Neither Google nor WolframAlpha led me to an equation so I set about creating a spreadsheet to simplify the problem.

The IRS instructions for form 1120S Schedule K-1, Line F, describe the method to use thusly:

Each shareholder’s pro rata share items are figured separately for each period on a daily basis, based on the percentage of stock held by the shareholder on each day.


If there was a change in shareholders or in the relative interest in stock the shareholders owned during the tax year, figure the percentage as follows.
• Each shareholder’s percentage of ownership is weighted for the number of days in the tax year that stock was owned. For example, A and B each held 50% for half the tax year and A, B, and C held 40%, 40%, and 20%, respectively, for the remaining half of the tax year. The percentage of ownership for the year for A, B, and C is figured as presented in the illustration and is then entered in item F.

IRS Form 1120S Schedule K-1 Item F table

I built myself a spreadsheet to calculate Item F correctly in the simple and complex cases. My spreadsheet implements the IRS described method without requiring the preparer to manually perform all the interim calculations. The only required inputs are the quantify of shares held by each shareholder and the number of days they were held.

Without any alteration, it supports up to 4 changes in shareholders and there’s no limit to the number of shareholders. I just plop in the raw numbers from the Stock Transfer Ledger and the spreadsheet does the rest.

I post it in Numbers and Excel formats, hoping that others will find it useful as well.



Walking desk – improved

After 50 hours of walking at my desk, a few shortcomings compelled me to action. Most of the treadmill surface was under the desk and not available for walking, forcing a shortened stride. It was also unsuitable for jogging or running. We left the treadmill on sliders, so it could be slid out for running. The most annoying problem was not being able to use the controls while standing on the treadmill.

On Saturday I did a little measuring and planning, and then cut out a 11″ x 32″ rectangle for the treadmills console to protrude through. I positioned the cutout 8″ from the front of the desk, leaving exactly enough space behind the console for my iMac to perch on. Then I slid the desk over the control unit and moved the desk surface up.

After everything was in position, I found two problems. The iMac fit but there wasn’t enough space between its chin and the back of the treadmill console to tilt. The solution was cutting a 1.5″ x 14″ notch at the rear (the part I stand in front of) of the desk cutout. That allowed the treadmill to move forward 1.5″ and now I can tilt the iMac.

The other problem was the shelf. With the initial cut, it didn’t fit. Anywhere. After adding the notch and moving the treadmill forward, it was mountable as can be seen. The ideal mounting distance from the front edge of the desk to the cutout is 12.5″. Everything fits perfectly.

I have used this new configuration for 10 hours now. I would like a little more desk available for my forearms to rest on, and I need to raise the desk surface. When I last raised it, I forgot to factor in the incline of the treadmill. Without intent, I created an adjustable height walking desk!

My walking desk

Last year I bought a standing desk. Along with biking to work a couple days each week, it was part of my plan to shed 20 excess pounds. I like my standing desk. I like it a lot. But what I discovered is that I can’t stand all day long without my knees aching. I adjusted by sitting while at work, and standing while at home.

I read that standing all day is a great way to experience joint pain. The solution is always the same: don’t just stand there, walk. I researched treadmills and decided a Bowflex Series 7 treadmill was the one. And I wanted to pay the lowest possible price. So I set up a RSS feed to watch craigslist. After several months, I didn’t see a single one sell for less than $700. So I started bidding $700 on every one that showed up on craigslist. Finally, 9 months later, I have my treadmill.

I had to move the desk up a few inches to slide the treadmill in under it. I’m tempted to move it up another couple inches. As you can see, my arms are actually sloping downwards from my elbows. I’d rather they were nearly level, but I also want Jen to be able to use my workstation.

I’ve now worked at my walking desk for two days. I walked barefoot for the first 4 miles and found the treadmill belt to be abrasive on my feet. Now I’m alternating between barefeet and socks, until my feet have built up some calluses.

Update: I did move it up 3 more inches. Now it’s just right.

ZFS is production ready


In July of 2008, I was tasked with building a system to back up thousands of Linux based servers. Previous systems using Amanda and Bacula had failed, principally because they required a full time backup administrator to maintain. My job was to build a backup system that required very little maintenance, scaled well, and made restoring data straight forward and easy.

I initially deployed BackupPC which features data deduplication and would likely have reduced our storage needs by more than 60%. I deployed on two SuperMicro systems, each equipped with dual quad-core CPUs, 16GB RAM, and 24 one terabyte disks. I built out one system with OpenSolaris and the other with FreeBSD. After testing, we deployed both with FreeBSD.

BackupPC ended up being inadequate so I wrote my own backup system on top of rsnapshot. My backup system generates rsnapshot config files and then drives multiple concurrent rsnapshot processes on each of the backup servers, pumping data to the backup disks as fast as they’ll take it. I hacked up rsnapshot for better error handling and reporting. I log exactly how much data each remote system has, as well as how much is transferred during each backup.

About ZFS

The main reason we deployed on ZFS was file system compression. After testing several settings, I settled on compression=gzip. I noticed no difference in system performance between compression settings. The backup system has been in production since, with very little attention since deployment.

When initially deployed, each backup server required manual tweaks so that they would only crash once a day. The multiple concurrent rsync processes created a workload that stressed the ZFS memory pools. Working with the lead FreeBSD ZFS developer helped the situation and my systems only crashed once a week. When ZFS v13 was merged into FreeBSD 8-current, memory management improved and my systems only crashed once a month.

Even during the months of using ZFS with frequent crashes, I never lost any data. And there’s no need to fsck the disks after crashes. My confidence in ZFS grew enough that when I upsized the disks in my home file server, I switched from gmirror (tried and true) to ZFS mirrors. I back up my public server to my home file server and saw the same occasional rsync induced crashes. About the time FreeBSD released 8.0 beta releases, I updated and the crashes ceased. So I updated these backup servers and they too have been stable ever since.

I have added another server to the pool and currently store 58 terabytes of data and over a billion files. My compression ratio averages 2.25, more than doubling the effective capacity of the disks we purchased. After FreeBSD 8 was released, I upgraded all the backup servers and could scarcely be more pleased.

And then I learned that deduplication is coming to ZFS. I can’t wait to test it.

ssh bruteforce attacks become sophisticated

SSH scans and bruteforce attacks that have have been common since my first SSH enabled server was attacked in 1996. Back then, attacks were so rare that monitoring logins and manually adding attackers IPs to /etc/hosts.allow (TCP Wrapper) was sufficient to keep systems secure.

In the mid 2000’s, the rise of botnets resulted in distributed bruteforce attacks, in which dozens of IPs (bots) would attempt to bruteforce my SSH daemons. I wrote a shell script that collected the IPs and added them to the TCP Wrappers deny list. A while later, denyhosts, was released and I started using it instead of my shell script.

Since installing denyhosts, I only monitor logins and scan the nightly security reports. In the past few years, the frequency of attacks has slowly risen but occasionally there are significant changes in attack frequency and duration. The last significant escalation I can recall was in the months leading up to McColo being shut down. Immediately after their shutdown, I noticed a dramatic reduction in bruteforce SSH attacks.

It was during that time of increased activity that I wrote Sentry. Like my original shell script and denyhosts, it adds attacking IPs to the TCP Wrappers deny list. Sentry also adds their IPs to my PF firewall. Sentry worked much the same as denyhosts, except that when someone attacks one of my IPs, they got blacklisted on all of them. The number of attacks that made it into my security logs dropped accordingly.

Months later, after McColo was shut down, the distributed attacks all but ceased. Since then, attacks have remained sporadic, perhaps 10 a week. In the last couple weeks, the number of attacks spiked. I’m seeing dozens of new IPs getting blacklisted each day. Unlike previous attacks, the usernames the attackers are using are not being duplicated, which means the command & control network behind this latest round of attacks is more intelligent than most.

e-delivery of invoices

While I’m ranting about business practices stuck in the 20th century, there is a simple reason I frequently decline online delivery of statements. What assurance do I have that after I terminate my account, I will still have access to my account records?

If you want me to sign up for e-delivery, give me some assurance that my records will remain online and accessible for a reasonable period of time. Regardless of the status of my account with you. In other words, match the functionality of paper statements.

If I cancel my account with you, my paper records don’t self-destruct. If you want me sign up for e-delivery, implement and publish your document retention policy that is client friendly and aligns with IRS guidelines. If I have an account with you and cancel it, my account history must remain accessible to me for at least 3 years. 

Considering the cost of printing and mailing statements versus the incredibly cheap cost of storing electronic records, this seems like a no-brainer.

Here are a few more suggestions for a good implementation:

 • Provide a simple method for downloading multiple statements. Quite often I don’t care at all about my statements until the end of the year when I want to download all of them. Selecting a period, clicking download, renaming the statement, and repeating a dozen times is tedious.
 • Give the downloaded files a name useful to humans. Filenames like 82383423546602382_08-08.pdf are not  human friendly.
 • Prefix filenames with a date nomenclature like: YYYY_MM or YYYY_q1. That way, when I’m looking at a folder with several years worth of statements, they are sorted properly.
 • If I cancelled my account with you N years ago and you’re about to expunge my records, make a good faith attempt to inform me prior to that event.

bicycling to work, update

As I reported last month, I have been bicycling to work. Since I was out of shape and the ride is 9 miles each way, I started slowly and rode only two days a week. Since Jun 11, I have bicycle commuted 16 days and rode 288 miles. During that time I have cut my commute time from 50 minutes to 35. My legs aren’t yet strong enough that I get a good cardio workout but I’m making good progress. My one-way commute times are:

  • By Car: 20m
  • By Bike: 35m
  • By Bus: 55-65m

Each day I bicycle to work instead of driving costs 30 minutes of time. In exchange for that 30 minutes, I get my prescribed 70 minutes of exercise. It also saves about $4 in diesel fuel but that cost is offset by buying and maintaining my bike. Of course, there are fringe benefits to biking to work. After the initial weight spike as my leg muscles rejuvenated, I am losing a pound a week. Very soon I shall start riding 3 days a week. 

Extra springy

Since we enjoy springtime and it is nearly over in Dallas, we packed up our house into a truck today and drove NW to Amarillo, TX. Tomorrow we’ll drive through Albuquerque, NM and Durango, CO. Then we’ll drive the Colorado Skyway ending in Grand Junction, Colorado for the night. We’ll get to Seattle just in time for spring to arrive.

Another look at the 20″ iMac Core Duo

Two weeks ago we arrived in Seattle. We planned at least seven weeks here. Being gone for so long required that I set up a portable office so Jen and I could work. She brought her laptop, I limited myself to the PowerBook and 20″ iMac Core Duo. Upon arrival, I accepted a one week contract job helping out Microsoft. That contract meant putting my iMac to work in new ways.

My project was the instruction of a course on LAMP (Linux Apache MySQL PHP/Perl/Python) development. I had to document a process by which Microsoft employees could install LAMP on their computers and then use the LAMP stack in a development environment. Of course, it had to be delivered in the form of Word docs and PowerPoint “decks.” With that in mind, I had to have several things all running at the same time:

  • Windows XP
  • LAMP: Linux (via virtualization)
  • MS Word & PowerPoint

While instructing the course, I learned quite a few things about my Core Duo iMac, Parallels Desktop, and MS Office under Rosetta.

For starters, and reference, Parallels Desktop does a great job of running Windows XP. Previous to this contract, I had no problems running XP under it, but I had not really used it other than to boot it up and see that it worked.

Parallels Desktop & Boot Camp
While Parallels Desktop lets me run XP under Mac OS X, it is not quite as good as rebooting into XP via Boot Camp. I ran into a limitation when I installed and attempted to use Virtual PC 2004 for Windows. It simply will not run under XP when XP is running under Parallels, giving a “CPU not supported” error. Since I needed Virtual PC 2004 to work, I had to reboot into Windows under Boot Camp.

When Jon, the project manager, came over to broadcast the Live Meeting from my house, he looked at Windows XP on the screen and asked, “Where’s the computer?” I replied, “that is the computer.” Apple hardware rocks. As I have pointed out in previous articles, and continue to be surprised by, Windows XP runs much faster and smoother under Boot Camp on my iMac than on the dual 3.0GHz Xeon server I have. I was reminded of how “authentic” my experience was when MSN Messenger asked to enable my video camera. When I allowed it, the system promptly rebooted. I let it try once more with the same results before disabling the built-in iSight’s hardware profile. Am I the only one that finds it inexcusable that a vendor supplied chat program can crash the operation system?

MS Office & Core Duo Macs
Previously I noted that PowerPC apps like MS Office work just fine on the new Core Duo systems running under Rosetta. I have found that my assertation was a bit hasty. While Office does run and appears to work fine, when I began using it I found its performance is intolerably slow. I had to generate a number of PowerPoints and Word docs. None were very large, 15-30 slides for PowerPoint and 5-15 page Word docs. I started out building them on the iMac in Office 2004 but redraws, scrolling, and general use was too slow. This is on a 2GHz Core Duo with 2GB of RAM!

How slow is “too slow?” I did not bother with benchmarks because I had work to do. When I grabbed a scroll bar and drug, I would have to drag and wait for the screen to update, and it would often take up to a second and sometimes a few to redraw a page or a slide. This was after turning all of the auto-* features. If you are content with the speed of OS X or XP on a 4 year old computer, then the performance would be acceptable to you. For everyone else, if you must use Office regularly, avoid the new Intel powered Mac system unless you intend to buy the new version of Office the day it ships so you get get decent performance again.

I worked around the problem in two ways. The first was by running Office under XP (under Parallels). The rest of the time I edited the files on my aged but trustworthy G4 PowerBook. To summarize, the Core Duo equipped macs are really great systems, but if you spent a good portion of your day working in Office or any other app that is not yet Universal, you will want to continue using a PowerPC based Macintosh.

A cornucopia of things

We are in Seattle (Lake City) at least until mid-July. We fled Texas to escape the heat. Jen found us a housesitting job.

Weather in Seattle is wonderful! It’s cold in the morning (60s) and warms up into the 70s during the day. There are no mosquitoes. The doors and windows of the house are open all day (and night). I can be out in the sun for hours and not get burnt. I burn in less than 40 minutes of Texas sun.

Honda Odyssey
We drove our new minivan up to Seattle. It is a 2004 Honda Odyssey. We got it last month with 26,000 miles. It is like new. It is so anti-Jetta. The Jetta is small, the Odyssey is not. The Jetta is frugal (35mph), the Odyssey is not (24). The Jetta begs to race down the backside of mountains at 120mph, the Odyssey says, “grow up, speed racer.” The Jetta is cute, the Odyssey is…is…practical. 534

The Jetta: Let’s DRIVE!
Odyssey: Let’s ride.

The Jetta: Go, Go, Go! Faster, faster, I can do it!
Odyssey: Hey, look at the pretty mountains and the cool morning air that I have conditioned to exactly 72° for your riding comfort. Would you like a massage with your soft cushy seats?

After driving 400 miles:
The Jetta: Stop? Why? I can go for 200 more miles on this tank!
Odyssey: I’m thirsty. Don’t you have to pee or something?

After looking at the pile of stuff to take for 6 weeks:
The Jetta: Where?
Odyssey: Is that it?

Things that would not have fit in the Jetta: 20″ iMac, crate full of rock climbing and camping gear, portable office (phones, routers, power adapters, etc), a really big bag of Kayla toys. It really was quite dramatic. We filled up the Odyssey with everything we wanted to bring and was still below the bottom of the windows.

Contrast that with our two weeks in Michigan over new years. The Jetta was packed to the gills with the roof rack on top and not an inch to spare anywhere.

Junior 2.0
We had Junior’s big ultrasound yesterday. Junior appears to be very healthy. In fact, Junior is quite vigorous, refusing to hold still for the ultrasound technician. She claimed never to have seen such an active fetus. There were a couple images she simply could not get because Junior refused to hold still. After 15 minutes trying to get a particular shot, in frustration she held the probe still and said, “Look at this, I’m holding this still and he is just going and going!”

Junior’s mommy was not the least bit surprised. Kayla was an active baby and we had nicknamed her “Dances in Womb.” Junior is hyperactive and seldom pauses. Junior is more like “Spastic Bounces Off Walls.” His activity level is almost constant. Many things about this pregnancy are different than the last, but of course, every pregnancy is different. The nausea that abated in the second trimester last time has not. Other little things are different. We had our suspicions.

As the technician probed, daddy and Kayla watched. I asked, “Did I just see what I thought I saw?” The technician slid a knowing grin and continued. She paused, and froze the screen. There it was again, and this time she caught it before Junior swam away. Junior is sporting the goods.

Workin’ for the man
The day after we arrived in Seattle, I got the phones set up and then they rang. A certain mega-sized monopolistic computer software corporation (MSMCSC) based in Redmond, Washington wanted my assistance. Oddly, they had no idea I was only a few miles away. So, I am finishing up a one week consulting project with, guess who?