Monday, February 13, 2012

Opinion: Should I use Linux, Mac, or Windows?

"A craftswoman never blames her tools."

For most, whether or not you can get your work done well on a certain platform is all that matters.

To me, the three major operating platforms are tools that all have strengths and weaknesses. In the same way that I wouldn't use my nice chisels to loosen a laptop screw, I wouldn't use a MacBook for writing code for our Linux infrastructure. I am more efficient doing that work on Linux itself.

At the same time, I shoot photos and video, and do some writing to take a break from IT. I've tried doing that work using the included tools on all three platforms. I find the Mac platform the most efficient and trouble-free for that work. I can do the work on Linux as well, but Linux has frustrating workflow gaps - especially regarding video.

At work, even though we have a heterogenous server environment, we communicate using Microsoft Office, SharePoint, and Lync. My opinion of those tools does not matter. We chose them for communication and therefore I need them to work well. Thus, at work I use Windows 7 with PuTTY, Gnu Screen, and several Linux VMs to do my Linux systems engineering. At home I use a MacBook with iLife and a Linux VM. These two setups let me use the three PC platforms for the workflows for which they seem best suited. [1]

I think it's missing the point to debate which is the one true platform. We all have things we want to do, things we want to create. In my experience, the question is not "which platform is better in general?", it's "on which platform can I most easily get my work done?". If my current platform no longer works well, I try the others. In the end, I'm paid more for getting more work done in less time, so the efficiency of a platform for that work decides the question.

-Adam Keck


[1] Note that there are six major personal computing platforms today, Linux, Mac, Windows, iOS, Android, and Web, so the landscape is actually more complex. Many tasks that were once the purview of the desktop/laptop platforms have been reimplemented with better workflows on the web and mobile platforms. Some people I know find a decent browser sufficient for all the personal computing tasks they need or want to do. Others use only their iPads for everything.

Friday, February 3, 2012

Shell one liner to analyze sendmail mail queue for mail "bomb" sources

If your sendmail server gets "bombed" by some sender, one task you may need to do is to find the most common patterns in the massive pile up of mail in your queues. This one liner counts Subject, To, and From fields from the qf files, and then counts the list. With the double sort, it's a bit on the inefficient side, but it may help you anyway.

find /local/apps/mail/spool/mqueue -type f -name "qf*" -exec cat {} \; \
| awk -F: '/From|To|Subject/ {for(k=2;k<=NF;++k)printf $k; print "\n"}' \
| sort \
| uniq -c \
| sort -n

I have broken line across multiple lines for clarity by escaping the ends. You may want to paste the sections in to one line for convenience. In that case drop the trailing '\'s.